summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-09-11 11:43:17 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-09-11 11:43:17 +0000
commit9615e7bc4c328afdd4643db434e843f181604198 (patch)
tree6291cdb8ced268d175f06e0579e8de1103f161fa
parent4b1e2578b0a2c6e1066adcb5b010e4abfa7f551a (diff)
formatting
seriously, who breaks this shit? SVN revision: 76455
-rw-r--r--legacy/evas/src/lib/canvas/evas_clip.c177
1 files changed, 89 insertions, 88 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_clip.c b/legacy/evas/src/lib/canvas/evas_clip.c
index b1ff8c2308..f1e9de339a 100644
--- a/legacy/evas/src/lib/canvas/evas_clip.c
+++ b/legacy/evas/src/lib/canvas/evas_clip.c
@@ -7,7 +7,7 @@ evas_object_clip_dirty(Evas_Object *obj)
7 Eina_List *l; 7 Eina_List *l;
8 Evas_Object *data; 8 Evas_Object *data;
9 9
10 if (obj->cur.cache.clip.dirty) return ; 10 if (obj->cur.cache.clip.dirty) return;
11 11
12 obj->cur.cache.clip.dirty = 1; 12 obj->cur.cache.clip.dirty = 1;
13 EINA_LIST_FOREACH(obj->clip.clipees, l, data) 13 EINA_LIST_FOREACH(obj->clip.clipees, l, data)
@@ -22,9 +22,9 @@ evas_object_recalc_clippees(Evas_Object *obj)
22 22
23 if (obj->cur.cache.clip.dirty) 23 if (obj->cur.cache.clip.dirty)
24 { 24 {
25 evas_object_clip_recalc(obj); 25 evas_object_clip_recalc(obj);
26 EINA_LIST_FOREACH(obj->clip.clipees, l, data) 26 EINA_LIST_FOREACH(obj->clip.clipees, l, data)
27 evas_object_recalc_clippees(data); 27 evas_object_recalc_clippees(data);
28 } 28 }
29} 29}
30 30
@@ -33,20 +33,20 @@ evas_object_clippers_was_visible(Evas_Object *obj)
33{ 33{
34 if (obj->prev.visible) 34 if (obj->prev.visible)
35 { 35 {
36 if (obj->prev.clipper) 36 if (obj->prev.clipper)
37 return evas_object_clippers_is_visible(obj->prev.clipper); 37 return evas_object_clippers_is_visible(obj->prev.clipper);
38 return 1; 38 return 1;
39 } 39 }
40 return 0; 40 return 0;
41} 41}
42 42
43/* aaaaargh (pirate voice) ... notes! 43/* aaaaargh (pirate voice) ... notes!
44 * 44 *
45 * we have a big problem until now that's gone undetected... until yesterday. 45 * we have a big problem until now that's gone undetected... until yesterday.
46 * that problem involves clips and maps and smart objects. hooray! 3 of the 46 * that problem involves clips and maps and smart objects. hooray! 3 of the
47 * more complex bits of evas - and maps and smart objects being one of the 47 * more complex bits of evas - and maps and smart objects being one of the
48 * nastiest ones. 48 * nastiest ones.
49 * 49 *
50 * what is the problem? when a clip crosses a map boundary. that is to say 50 * what is the problem? when a clip crosses a map boundary. that is to say
51 * that when the clipper and clippee are not within the child tree of the 51 * that when the clipper and clippee are not within the child tree of the
52 * mapped object. in this case "bad stuff" happens. basically as clips are 52 * mapped object. in this case "bad stuff" happens. basically as clips are
@@ -63,13 +63,13 @@ evas_object_clippers_was_visible(Evas_Object *obj)
63 * thats silly-expensive and i was about to fix it that way but it has since 63 * thats silly-expensive and i was about to fix it that way but it has since
64 * dawned on me that that is just going to kill performance in some critical 64 * dawned on me that that is just going to kill performance in some critical
65 * areas like during object setup and manipulation, as well as teardown. 65 * areas like during object setup and manipulation, as well as teardown.
66 * 66 *
67 * aaaaagh! best for now is to document this as a "don't do it damnit!" thing 67 * aaaaagh! best for now is to document this as a "don't do it damnit!" thing
68 * and have the apps avoid it. but even then - how to do this? this is not 68 * and have the apps avoid it. but even then - how to do this? this is not
69 * easy. everywhere i turn so far i come up to either expensive operations, 69 * easy. everywhere i turn so far i come up to either expensive operations,
70 * breaks in logic, or nasty re-work of apps or4 the whole concept of clipping, 70 * breaks in logic, or nasty re-work of apps or4 the whole concept of clipping,
71 * smart objects and maps... and that will have to wait for evas 2.0 71 * smart objects and maps... and that will have to wait for evas 2.0
72 * 72 *
73 * the below does clip fixups etc. in the even a clip spans a map boundary. 73 * the below does clip fixups etc. in the even a clip spans a map boundary.
74 * not pretty, but necessary. 74 * not pretty, but necessary.
75 */ 75 */
@@ -87,7 +87,7 @@ evas_object_child_map_across_mark(Evas_Object *obj, Evas_Object *map_obj, Eina_B
87 if (obj->smart.smart) 87 if (obj->smart.smart)
88 { 88 {
89 Evas_Object *obj2; 89 Evas_Object *obj2;
90 90
91 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2) 91 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
92 { 92 {
93 // if obj has its own map - skip it. already done 93 // if obj has its own map - skip it. already done
@@ -99,12 +99,12 @@ evas_object_child_map_across_mark(Evas_Object *obj, Evas_Object *map_obj, Eina_B
99 { 99 {
100 Eina_List *l; 100 Eina_List *l;
101 Evas_Object *obj2; 101 Evas_Object *obj2;
102 102
103 EINA_LIST_FOREACH(obj->clip.clipees, l, obj2) 103 EINA_LIST_FOREACH(obj->clip.clipees, l, obj2)
104 evas_object_child_map_across_mark(obj2, map_obj, force); 104 evas_object_child_map_across_mark(obj2, map_obj, force);
105 } 105 }
106 } 106 }
107#endif 107#endif
108} 108}
109 109
110void 110void
@@ -113,8 +113,8 @@ evas_object_clip_across_check(Evas_Object *obj)
113#ifdef MAP_ACROSS 113#ifdef MAP_ACROSS
114 if (!obj->cur.clipper) return; 114 if (!obj->cur.clipper) return;
115 if (obj->cur.clipper->cur.map_parent != obj->cur.map_parent) 115 if (obj->cur.clipper->cur.map_parent != obj->cur.map_parent)
116 evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1); 116 evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1);
117#endif 117#endif
118} 118}
119 119
120void 120void
@@ -131,30 +131,30 @@ evas_object_clip_across_clippees_check(Evas_Object *obj)
131 evas_object_child_map_across_mark(obj, obj->cur.map_parent, 0); 131 evas_object_child_map_across_mark(obj, obj->cur.map_parent, 0);
132 if (obj->cur.cache.clip.dirty) 132 if (obj->cur.cache.clip.dirty)
133 { 133 {
134 EINA_LIST_FOREACH(obj->clip.clipees, l, obj2) 134 EINA_LIST_FOREACH(obj->clip.clipees, l, obj2)
135 evas_object_clip_across_clippees_check(obj2); 135 evas_object_clip_across_clippees_check(obj2);
136 } 136 }
137#endif 137#endif
138} 138}
139 139
140// this function is called on an object when map is enabled or disabled on it 140// this function is called on an object when map is enabled or disabled on it
141// thus creating a "map boundary" at that point. 141// thus creating a "map boundary" at that point.
142// 142//
143// FIXME: flip2 test broken in elm - might be show/hide of clips 143// FIXME: flip2 test broken in elm - might be show/hide of clips
144void 144void
145evas_object_mapped_clip_across_mark(Evas_Object *obj) 145evas_object_mapped_clip_across_mark(Evas_Object *obj)
146{ 146{
147#ifdef MAP_ACROSS 147#ifdef MAP_ACROSS
148 if ((obj->cur.map) && (obj->cur.usemap)) 148 if ((obj->cur.map) && (obj->cur.usemap))
149 evas_object_child_map_across_mark(obj, obj, 0); 149 evas_object_child_map_across_mark(obj, obj, 0);
150 else 150 else
151 { 151 {
152 if (obj->smart.parent) 152 if (obj->smart.parent)
153 evas_object_child_map_across_mark 153 evas_object_child_map_across_mark
154 (obj, obj->smart.parent->cur.map_parent, 0); 154 (obj, obj->smart.parent->cur.map_parent, 0);
155 else 155 else
156 evas_object_child_map_across_mark(obj, NULL, 0); 156 evas_object_child_map_across_mark(obj, NULL, 0);
157 } 157 }
158#endif 158#endif
159} 159}
160 160
@@ -169,8 +169,8 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
169 MAGIC_CHECK_END(); 169 MAGIC_CHECK_END();
170 if (!clip) 170 if (!clip)
171 { 171 {
172 evas_object_clip_unset(obj); 172 evas_object_clip_unset(obj);
173 return; 173 return;
174 } 174 }
175 MAGIC_CHECK(clip, Evas_Object, MAGIC_OBJ); 175 MAGIC_CHECK(clip, Evas_Object, MAGIC_OBJ);
176 return; 176 return;
@@ -216,36 +216,36 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
216 } 216 }
217 if (obj->smart.smart) 217 if (obj->smart.smart)
218 { 218 {
219 if (obj->smart.smart->smart_class->clip_set) 219 if (obj->smart.smart->smart_class->clip_set)
220 obj->smart.smart->smart_class->clip_set(obj, clip); 220 obj->smart.smart->smart_class->clip_set(obj, clip);
221 } 221 }
222 if (obj->cur.clipper) 222 if (obj->cur.clipper)
223 { 223 {
224 /* unclip */ 224 /* unclip */
225 obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj); 225 obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj);
226 if (!obj->cur.clipper->clip.clipees) 226 if (!obj->cur.clipper->clip.clipees)
227 { 227 {
228 obj->cur.clipper->cur.have_clipees = 0; 228 obj->cur.clipper->cur.have_clipees = 0;
229 if (obj->cur.clipper->cur.visible) 229 if (obj->cur.clipper->cur.visible)
230 evas_damage_rectangle_add(obj->cur.clipper->layer->evas, 230 evas_damage_rectangle_add(obj->cur.clipper->layer->evas,
231 obj->cur.clipper->cur.geometry.x, 231 obj->cur.clipper->cur.geometry.x,
232 obj->cur.clipper->cur.geometry.y, 232 obj->cur.clipper->cur.geometry.y,
233 obj->cur.clipper->cur.geometry.w, 233 obj->cur.clipper->cur.geometry.w,
234 obj->cur.clipper->cur.geometry.h); 234 obj->cur.clipper->cur.geometry.h);
235 } 235 }
236 evas_object_change(obj->cur.clipper); 236 evas_object_change(obj->cur.clipper);
237 evas_object_change(obj); 237 evas_object_change(obj);
238 obj->cur.clipper = NULL; 238 obj->cur.clipper = NULL;
239 } 239 }
240 /* clip me */ 240 /* clip me */
241 if ((!clip->clip.clipees) && (clip->cur.visible)) 241 if ((!clip->clip.clipees) && (clip->cur.visible))
242 { 242 {
243 /* Basically it just went invisible */ 243 /* Basically it just went invisible */
244 clip->changed = 1; 244 clip->changed = 1;
245 clip->layer->evas->changed = 1; 245 clip->layer->evas->changed = 1;
246 evas_damage_rectangle_add(clip->layer->evas, 246 evas_damage_rectangle_add(clip->layer->evas,
247 clip->cur.geometry.x, clip->cur.geometry.y, 247 clip->cur.geometry.x, clip->cur.geometry.y,
248 clip->cur.geometry.w, clip->cur.geometry.h); 248 clip->cur.geometry.w, clip->cur.geometry.h);
249 } 249 }
250 obj->cur.clipper = clip; 250 obj->cur.clipper = clip;
251 clip->clip.clipees = eina_list_append(clip->clip.clipees, obj); 251 clip->clip.clipees = eina_list_append(clip->clip.clipees, obj);
@@ -259,32 +259,32 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
259 /* If it's NOT a rectangle set the mask bits too */ 259 /* If it's NOT a rectangle set the mask bits too */
260 /* FIXME: Optmz ths chck */ 260 /* FIXME: Optmz ths chck */
261 if (clip->type == o_rect_type) 261 if (clip->type == o_rect_type)
262 obj->cur.mask = NULL; 262 obj->cur.mask = NULL;
263 else 263 else
264 { 264 {
265 void *engdata; 265 void *engdata;
266 obj->cur.mask = clip; 266 obj->cur.mask = clip;
267 engdata = clip->func->engine_data_get(clip); 267 engdata = clip->func->engine_data_get(clip);
268 /* FIXME: Images only */ 268 /* FIXME: Images only */
269 clip->layer->evas->engine.func->image_mask_create( 269 clip->layer->evas->engine.func->image_mask_create(
270 clip->layer->evas->engine.data.output, 270 clip->layer->evas->engine.data.output,
271 engdata); 271 engdata);
272 } 272 }
273 evas_object_change(clip); 273 evas_object_change(clip);
274 evas_object_change(obj); 274 evas_object_change(obj);
275 evas_object_clip_dirty(obj); 275 evas_object_clip_dirty(obj);
276 evas_object_recalc_clippees(obj); 276 evas_object_recalc_clippees(obj);
277 if ((!obj->smart.smart) && 277 if ((!obj->smart.smart) &&
278 (!((obj->cur.map) && (obj->cur.usemap)))) 278 (!((obj->cur.map) && (obj->cur.usemap))))
279 { 279 {
280 if (evas_object_is_in_output_rect(obj, 280 if (evas_object_is_in_output_rect(obj,
281 obj->layer->evas->pointer.x, 281 obj->layer->evas->pointer.x,
282 obj->layer->evas->pointer.y, 1, 1)) 282 obj->layer->evas->pointer.y, 1, 1))
283 evas_event_feed_mouse_move(obj->layer->evas, 283 evas_event_feed_mouse_move(obj->layer->evas,
284 obj->layer->evas->pointer.x, 284 obj->layer->evas->pointer.x,
285 obj->layer->evas->pointer.y, 285 obj->layer->evas->pointer.y,
286 obj->layer->evas->last_timestamp, 286 obj->layer->evas->last_timestamp,
287 NULL); 287 NULL);
288 } 288 }
289 evas_object_clip_across_check(obj); 289 evas_object_clip_across_check(obj);
290} 290}
@@ -309,39 +309,39 @@ evas_object_clip_unset(Evas_Object *obj)
309 if (evas_object_intercept_call_clip_unset(obj)) return; 309 if (evas_object_intercept_call_clip_unset(obj)) return;
310 if (obj->smart.smart) 310 if (obj->smart.smart)
311 { 311 {
312 if (obj->smart.smart->smart_class->clip_unset) 312 if (obj->smart.smart->smart_class->clip_unset)
313 obj->smart.smart->smart_class->clip_unset(obj); 313 obj->smart.smart->smart_class->clip_unset(obj);
314 } 314 }
315 if (obj->cur.clipper) 315 if (obj->cur.clipper)
316 { 316 {
317 obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj); 317 obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj);
318 if (!obj->cur.clipper->clip.clipees) 318 if (!obj->cur.clipper->clip.clipees)
319 { 319 {
320 obj->cur.clipper->cur.have_clipees = 0; 320 obj->cur.clipper->cur.have_clipees = 0;
321 if (obj->cur.clipper->cur.visible) 321 if (obj->cur.clipper->cur.visible)
322 evas_damage_rectangle_add(obj->cur.clipper->layer->evas, 322 evas_damage_rectangle_add(obj->cur.clipper->layer->evas,
323 obj->cur.clipper->cur.geometry.x, 323 obj->cur.clipper->cur.geometry.x,
324 obj->cur.clipper->cur.geometry.y, 324 obj->cur.clipper->cur.geometry.y,
325 obj->cur.clipper->cur.geometry.w, 325 obj->cur.clipper->cur.geometry.w,
326 obj->cur.clipper->cur.geometry.h); 326 obj->cur.clipper->cur.geometry.h);
327 } 327 }
328 evas_object_change(obj->cur.clipper); 328 evas_object_change(obj->cur.clipper);
329 } 329 }
330 obj->cur.clipper = NULL; 330 obj->cur.clipper = NULL;
331 evas_object_change(obj); 331 evas_object_change(obj);
332 evas_object_clip_dirty(obj); 332 evas_object_clip_dirty(obj);
333 evas_object_recalc_clippees(obj); 333 evas_object_recalc_clippees(obj);
334 if ((!obj->smart.smart) && 334 if ((!obj->smart.smart) &&
335 (!((obj->cur.map) && (obj->cur.usemap)))) 335 (!((obj->cur.map) && (obj->cur.usemap))))
336 { 336 {
337 if (evas_object_is_in_output_rect(obj, 337 if (evas_object_is_in_output_rect(obj,
338 obj->layer->evas->pointer.x, 338 obj->layer->evas->pointer.x,
339 obj->layer->evas->pointer.y, 1, 1)) 339 obj->layer->evas->pointer.y, 1, 1))
340 evas_event_feed_mouse_move(obj->layer->evas, 340 evas_event_feed_mouse_move(obj->layer->evas,
341 obj->layer->evas->pointer.x, 341 obj->layer->evas->pointer.x,
342 obj->layer->evas->pointer.y, 342 obj->layer->evas->pointer.y,
343 obj->layer->evas->last_timestamp, 343 obj->layer->evas->last_timestamp,
344 NULL); 344 NULL);
345 } 345 }
346 evas_object_clip_across_check(obj); 346 evas_object_clip_across_check(obj);
347} 347}
@@ -354,3 +354,4 @@ evas_object_clipees_get(const Evas_Object *obj)
354 MAGIC_CHECK_END(); 354 MAGIC_CHECK_END();
355 return obj->clip.clipees; 355 return obj->clip.clipees;
356} 356}
357