Author: lewing
Date: 2007-10-09 16:11:44 -0400 (Tue, 09 Oct 2007)
New Revision: 87216
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/runtime.cpp
trunk/moon/src/shape.cpp
Log:
2007-10-09 Larry Ewing <[EMAIL PROTECTED]>
* media.cpp: add clipping to shape::DoDraw and to the bounds
computations.
2007-10-08 Larry Ewing <[EMAIL PROTECTED]>
* media.cpp:
* panel.cpp: intersect the bounds with the clip path to
optimize the invalidated region.
* shape.cpp: return 0.0 when shape_get_stroke_thickness is called
with a NULL.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-10-09 20:02:15 UTC (rev 87215)
+++ trunk/moon/src/ChangeLog 2007-10-09 20:11:44 UTC (rev 87216)
@@ -42,6 +42,8 @@
* debug.cpp, debug.h: Conditionally compile support for managed stack
frames.
+ * runtime.cpp: add more debug code.
+
2007-10-08 Jeffrey Stedfast <[EMAIL PROTECTED]>
* text.cpp (OnPropertyChanged): We may need to relayout even if
@@ -72,6 +74,11 @@
* runtime.h: Add a downloader_context field, and CreateDownloader
methods.
* runtime.cpp: Add a downloader_context field.
+2007-10-09 Larry Ewing <[EMAIL PROTECTED]>
+
+ * media.cpp: add clipping to shape::DoDraw and to the bounds
+ computations.
+
2007-10-08 Larry Ewing <[EMAIL PROTECTED]>
* media.cpp:
@@ -83,6 +90,15 @@
2007-10-08 Larry Ewing <[EMAIL PROTECTED]>
+ * media.cpp:
+ * panel.cpp: intersect the bounds with the clip path to
+ optimize the invalidated region.
+
+ * shape.cpp: return 0.0 when shape_get_stroke_thickness is called
+ with a NULL.
+
+2007-10-08 Larry Ewing <[EMAIL PROTECTED]>
+
* runtime.cpp: change previous logic to drop the alpha
completely here until more testing can be done.
Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp 2007-10-09 20:02:15 UTC (rev 87215)
+++ trunk/moon/src/runtime.cpp 2007-10-09 20:11:44 UTC (rev 87216)
@@ -47,6 +47,7 @@
#include <X11/extensions/Xrandr.h>
#endif
+//#define DEBUG_EXPOSE 1
//#define DEBUG_INVALIDATE 1
#define DEBUG_REFCNT 0
@@ -772,16 +773,31 @@
// FIXME dropping the alpha seems the closest to correct we
// have at the moment.
cairo_set_operator (ctx, CAIRO_OPERATOR_SOURCE);
- cairo_set_source_rgba (ctx,
- s->background_color->r,
- s->background_color->g,
- s->background_color->b,
- s->transparent ? s->background_color->a
: 1.0);
+ if (s->transparent)
+ cairo_set_source_rgba (ctx,
+ s->background_color->r,
+ s->background_color->g,
+ s->background_color->b,
+ s->background_color->a);
+ else
+ cairo_set_source_rgb (ctx,
+ s->background_color->r,
+ s->background_color->g,
+ s->background_color->b);
+
cairo_paint (ctx);
}
cairo_set_operator (ctx, CAIRO_OPERATOR_OVER);
s->Paint (ctx, event->area.x, event->area.y, event->area.width,
event->area.height);
+
+#if DEBUG_EXPOSE
+ gdk_cairo_region (ctx, event->region);
+ cairo_set_line_width (ctx, 2.0);
+ cairo_set_source_rgb (ctx, (double)(s->frames % 2), (double)((s->frames
+ 1) % 2), (double)((s->frames / 3) % 2));
+ cairo_stroke (ctx);
+#endif
+
cairo_destroy (ctx);
#if TIME_REDRAW
Modified: trunk/moon/src/shape.cpp
===================================================================
--- trunk/moon/src/shape.cpp 2007-10-09 20:02:15 UTC (rev 87215)
+++ trunk/moon/src/shape.cpp 2007-10-09 20:11:44 UTC (rev 87216)
@@ -138,6 +138,13 @@
cairo_set_matrix (cr, &absolute_xform);
+ Value *value = GetValue (UIElement::ClipProperty);
+ if (value) {
+ Geometry *geometry = value->AsGeometry ();
+ geometry->Draw (NULL, cr);
+ cairo_clip (cr);
+ }
+
// printf ("Draw, xform: %g %g %g %g %g %g\n",
// absolute_xform.xy,
// absolute_xform.xx,
@@ -285,6 +292,15 @@
//printf ("%f,%f,%f,%f\n", bounds.x, bounds.y, bounds.w,
bounds.h);
}
+ Value *value = GetValue (UIElement::ClipProperty);
+ if (value) {
+ Geometry *geometry = value->AsGeometry ();
+ Rect box = geometry->ComputeBounds (NULL);
+ box = bounding_rect_for_transformed_rect (&absolute_xform,
+ box);
+ bounds = box.Intersection (bounds);
+ }
+
/* standard "grow the rectangle by enough to cover our
asses because of cairo's floating point rendering"
thing */
@@ -975,6 +991,15 @@
calc_line_bounds (line_get_x1 (this), line_get_x2 (this), line_get_y1
(this), line_get_y2 (this), thickness, &bounds);
bounds = bounding_rect_for_transformed_rect (&absolute_xform, bounds);
+
+ Value *value = GetValue (UIElement::ClipProperty);
+ if (value) {
+ Geometry *geometry = value->AsGeometry ();
+ Rect box = geometry->ComputeBounds (NULL);
+ box = bounding_rect_for_transformed_rect (&absolute_xform,
+ box);
+ bounds = box.Intersection (bounds);
+ }
}
double
@@ -1239,6 +1264,15 @@
}
bounds = bounding_rect_for_transformed_rect (&absolute_xform, bounds);
+
+ Value *value = GetValue (UIElement::ClipProperty);
+ if (value) {
+ Geometry *geometry = value->AsGeometry ();
+ Rect box = geometry->ComputeBounds (NULL);
+ box = bounding_rect_for_transformed_rect (&absolute_xform,
+ box);
+ bounds = box.Intersection (bounds);
+ }
}
void
@@ -1442,6 +1476,15 @@
}
bounds = bounding_rect_for_transformed_rect (&absolute_xform, bounds);
+
+ Value *value = GetValue (UIElement::ClipProperty);
+ if (value) {
+ Geometry *geometry = value->AsGeometry ();
+ Rect box = geometry->ComputeBounds (NULL);
+ box = bounding_rect_for_transformed_rect (&absolute_xform,
+ box);
+ bounds = box.Intersection (bounds);
+ }
}
void
@@ -1616,6 +1659,15 @@
}
bounds = bounding_rect_for_transformed_rect (&absolute_xform, bounds);
+
+ Value *value = GetValue (UIElement::ClipProperty);
+ if (value) {
+ Geometry *geometry = value->AsGeometry ();
+ Rect box = geometry->ComputeBounds (NULL);
+ box = bounding_rect_for_transformed_rect (&absolute_xform,
+ box);
+ bounds = box.Intersection (bounds);
+ }
}
void
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches