Title: [188379] trunk/Source/WebCore
Revision
188379
Author
[email protected]
Date
2015-08-12 23:07:23 -0700 (Wed, 12 Aug 2015)

Log Message

[Cairo] Improve image quality when using newer versions of cairo/pixman
https://bugs.webkit.org/show_bug.cgi?id=147826

Reviewed by Martin Robinson.

Since cairo 1.14 the image filters changed a bit:

 - CAIRO_FILTER_GOOD uses a box filter when downscaling if the
   scale factor is less than 0.75, otherwise it uses a filter
   equivalent to CAIRO_FILTER_BILINEAR.
 - CAIRO_FILTER_BEST uses always a Catmull-Rom filter.

We are currently using CAIRO_FILTER_BILINEAR for medium, high and
default interpolation levels. We could use CAIRO_FILTER_GOOD for
medium and default, and CAIRO_FILTER_BEST for high. This will not
have any effect in previous versions of cairo because before 1.14
CAIRO_FILTER_GOOD, CAIRO_FILTER_BILINEAR and CAIRO_FILTER_BEST had
the same implementation in pixman.

* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::drawSurfaceToContext):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (188378 => 188379)


--- trunk/Source/WebCore/ChangeLog	2015-08-13 05:51:38 UTC (rev 188378)
+++ trunk/Source/WebCore/ChangeLog	2015-08-13 06:07:23 UTC (rev 188379)
@@ -1,3 +1,27 @@
+2015-08-12  Carlos Garcia Campos  <[email protected]>
+
+        [Cairo] Improve image quality when using newer versions of cairo/pixman
+        https://bugs.webkit.org/show_bug.cgi?id=147826
+
+        Reviewed by Martin Robinson.
+
+        Since cairo 1.14 the image filters changed a bit:
+
+         - CAIRO_FILTER_GOOD uses a box filter when downscaling if the
+           scale factor is less than 0.75, otherwise it uses a filter
+           equivalent to CAIRO_FILTER_BILINEAR.
+         - CAIRO_FILTER_BEST uses always a Catmull-Rom filter.
+
+        We are currently using CAIRO_FILTER_BILINEAR for medium, high and
+        default interpolation levels. We could use CAIRO_FILTER_GOOD for
+        medium and default, and CAIRO_FILTER_BEST for high. This will not
+        have any effect in previous versions of cairo because before 1.14
+        CAIRO_FILTER_GOOD, CAIRO_FILTER_BILINEAR and CAIRO_FILTER_BEST had
+        the same implementation in pixman.
+
+        * platform/graphics/cairo/PlatformContextCairo.cpp:
+        (WebCore::PlatformContextCairo::drawSurfaceToContext):
+
 2015-08-12  Myles C. Maxfield  <[email protected]>
 
         [Cocoa] [CJK-configured device] System font has vertical punctuation

Modified: trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp (188378 => 188379)


--- trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp	2015-08-13 05:51:38 UTC (rev 188378)
+++ trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp	2015-08-13 06:07:23 UTC (rev 188379)
@@ -198,12 +198,11 @@
         cairo_pattern_set_filter(pattern.get(), CAIRO_FILTER_FAST);
         break;
     case InterpolationMedium:
+    case InterpolationDefault:
+        cairo_pattern_set_filter(pattern.get(), CAIRO_FILTER_GOOD);
     case InterpolationHigh:
-        cairo_pattern_set_filter(pattern.get(), CAIRO_FILTER_BILINEAR);
+        cairo_pattern_set_filter(pattern.get(), CAIRO_FILTER_BEST);
         break;
-    case InterpolationDefault:
-        cairo_pattern_set_filter(pattern.get(), CAIRO_FILTER_BILINEAR);
-        break;
     }
     cairo_pattern_set_extend(pattern.get(), CAIRO_EXTEND_PAD);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to