Title: [94185] trunk
Revision
94185
Author
r...@google.com
Date
2011-08-31 07:03:26 -0700 (Wed, 31 Aug 2011)

Log Message

[skia] antialias images if we're rotated
https://bugs.webkit.org/show_bug.cgi?id=67207

Reviewed by Stephen White.

Source/WebCore:

* platform/graphics/skia/ImageSkia.cpp:
(WebCore::hasNon90rotation):
(WebCore::paintSkBitmap):

LayoutTests:

* platform/chromium/test_expectations.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94184 => 94185)


--- trunk/LayoutTests/ChangeLog	2011-08-31 13:37:12 UTC (rev 94184)
+++ trunk/LayoutTests/ChangeLog	2011-08-31 14:03:26 UTC (rev 94185)
@@ -1,3 +1,12 @@
+2011-08-31  Mike Reed  <r...@google.com>
+
+        [skia] antialias images if we're rotated
+        https://bugs.webkit.org/show_bug.cgi?id=67207
+
+        Reviewed by Stephen White.
+
+        * platform/chromium/test_expectations.txt:
+
 2011-08-31  Balazs Kelemen  <kbal...@webkit.org>
 
         [Qt] Unreviewedly skip new failures.

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (94184 => 94185)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-08-31 13:37:12 UTC (rev 94184)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-08-31 14:03:26 UTC (rev 94185)
@@ -2340,6 +2340,13 @@
 BUG_YUTAK LINUX WIN : fast/images/imagemap-polygon-focus-ring.html = IMAGE+TEXT
 BUG_YUTAK LEOPARD : fast/images/imagemap-polygon-focus-ring.html = IMAGE
 
+// Need to rebaseline now that we antialias rotated images
+BUGCR36902 LINUX WIN : fast/borders/border-image-rotate-transform.html = IMAGE
+BUGCR36902 LINUX WIN : media/audio-repaint.html = IMAGE
+BUGCR36902 LINUX WIN : media/video-zoom-controls.html = IMAGE
+BUGCR36902 LINUX WIN : svg/batik/filters/feTile.svg = IMAGE
+BUGCR36902 LINUX WIN : svg/custom/focus-ring.svg = IMAGE
+
 ///////////////////////////////////////////////////////////////////////////
 // Regressions caused by switching to DRT.
 ///////////////////////////////////////////////////////////////////////////

Modified: trunk/Source/WebCore/ChangeLog (94184 => 94185)


--- trunk/Source/WebCore/ChangeLog	2011-08-31 13:37:12 UTC (rev 94184)
+++ trunk/Source/WebCore/ChangeLog	2011-08-31 14:03:26 UTC (rev 94185)
@@ -1,3 +1,14 @@
+2011-08-31  Mike Reed  <r...@google.com>
+
+        [skia] antialias images if we're rotated
+        https://bugs.webkit.org/show_bug.cgi?id=67207
+
+        Reviewed by Stephen White.
+
+        * platform/graphics/skia/ImageSkia.cpp:
+        (WebCore::hasNon90rotation):
+        (WebCore::paintSkBitmap):
+
 2011-08-31  Alexander Pavlov  <apav...@chromium.org>
 
         Web Inspector: Having the "Metrics" pane open affects the node highlight display

Modified: trunk/Source/WebCore/platform/graphics/skia/ImageSkia.cpp (94184 => 94185)


--- trunk/Source/WebCore/platform/graphics/skia/ImageSkia.cpp	2011-08-31 13:37:12 UTC (rev 94184)
+++ trunk/Source/WebCore/platform/graphics/skia/ImageSkia.cpp	2011-08-31 14:03:26 UTC (rev 94185)
@@ -205,6 +205,11 @@
     canvas.drawBitmapRect(resampled, 0, destRectVisibleSubset, &paint);
 }
 
+static bool hasNon90rotation(PlatformContextSkia* context)
+{
+    return !context->canvas()->getTotalMatrix().rectStaysRect();
+}
+
 static void paintSkBitmap(PlatformContextSkia* platformContext, const NativeImageSkia& bitmap, const SkIRect& srcRect, const SkRect& destRect, const SkXfermode::Mode& compOp)
 {
     SkPaint paint;
@@ -212,6 +217,8 @@
     paint.setFilterBitmap(true);
     paint.setAlpha(platformContext->getNormalizedAlpha());
     paint.setLooper(platformContext->getDrawLooper());
+    // only antialias if we're rotated or skewed
+    paint.setAntiAlias(hasNon90rotation(platformContext));
 
     SkCanvas* canvas = platformContext->canvas();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to