Author: toshok
Date: 2008-02-08 13:35:53 -0500 (Fri, 08 Feb 2008)
New Revision: 95291
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/media.cpp
Log:
2008-02-08 Chris Toshok <[EMAIL PROTECTED]>
* media.cpp (MediaElement::Render): reorder things so that we're
calculating the brush pattern matrix with the snapped pixels.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2008-02-08 18:26:20 UTC (rev 95290)
+++ trunk/moon/src/ChangeLog 2008-02-08 18:35:53 UTC (rev 95291)
@@ -1,3 +1,8 @@
+2008-02-08 Chris Toshok <[EMAIL PROTECTED]>
+
+ * media.cpp (MediaElement::Render): reorder things so that we're
+ calculating the brush pattern matrix with the snapped pixels.
+
2008-02-08 Stephane Delcroix <[EMAIL PROTECTED]>
* brush.cpp: fix Image|Video|VisualBrushes for Shapes.
Modified: trunk/moon/src/media.cpp
===================================================================
--- trunk/moon/src/media.cpp 2008-02-08 18:26:20 UTC (rev 95290)
+++ trunk/moon/src/media.cpp 2008-02-08 18:35:53 UTC (rev 95291)
@@ -647,24 +647,7 @@
}
cairo_save (cr);
- if (!EnableAntiAlias ())
- cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
- pattern = cairo_pattern_create_for_surface (surface);
-
- if (flags & RecalculateMatrix) {
- image_brush_compute_pattern_matrix (&matrix, w, h,
mplayer->width, mplayer->height, stretch,
- AlignmentXCenter,
AlignmentYCenter, NULL, NULL);
- flags &= ~RecalculateMatrix;
- }
-
- cairo_pattern_set_matrix (pattern, &matrix);
-
- cairo_set_source (cr, pattern);
- cairo_pattern_destroy (pattern);
-
- cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_FAST);
-
cairo_set_matrix (cr, &absolute_xform);
// if we're opaque, we can likely do this and hopefully get a
@@ -672,33 +655,51 @@
//cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_new_path (cr);
- double x1, y1, x2, y2;
+ double x, y, x2, y2;
- x1 = y1 = 0;
+ x = y = 0;
x2 = w;
y2 = h;
if (absolute_xform.xy == 0
&& absolute_xform.yx == 0) {
- // we're not skewed/rotated, so let's snap to the pixel grid
+
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
- cairo_user_to_device (cr, &x1, &y1);
+ cairo_user_to_device (cr, &x, &y);
cairo_user_to_device (cr, &x2, &y2);
// effectively RoundIn. not sure if this is what we want..
- x1 = ceil (x1);
- y1 = ceil (y1);
+ x = floor (x);
+ y = floor (y);
- x2 = floor (x2);
- y2 = floor (y2);
+ x2 = ceil (x2);
+ y2 = ceil (y2);
- cairo_device_to_user (cr, &x1, &y1);
+ cairo_device_to_user (cr, &x, &y);
cairo_device_to_user (cr, &x2, &y2);
}
- cairo_rectangle (cr, x1, y1, x2 - x1, y2 - y1);
+ w = x2 - x;
+ h = y2 - y;
+ if (flags & RecalculateMatrix) {
+ image_brush_compute_pattern_matrix (&matrix, w, h,
mplayer->width, mplayer->height, stretch,
+ AlignmentXCenter,
AlignmentYCenter, NULL, NULL);
+ flags &= ~RecalculateMatrix;
+ }
+
+ pattern = cairo_pattern_create_for_surface (surface);
+
+ cairo_pattern_set_matrix (pattern, &matrix);
+
+ cairo_set_source (cr, pattern);
+ cairo_pattern_destroy (pattern);
+
+ cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_FAST);
+
+ cairo_rectangle (cr, x, y, w, h);
+
cairo_fill (cr);
cairo_restore (cr);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches