Title: [91207] branches/chromium/782/Source/WebCore
Revision
91207
Author
[email protected]
Date
2011-07-18 13:56:42 -0700 (Mon, 18 Jul 2011)

Log Message

Merge 90599 - Work around Skia PDF's lack of inverted path support.
https://bugs.webkit.org/show_bug.cgi?id=64032

Patch by Steve VanDeBogart <[email protected]> on 2011-07-07
Reviewed by James Robinson.

The trick used in http://neugierig.org/software/chromium/notes/2010/07/clipping.html
to support antialiased clips doesn't work when printing to Skia's PDF backend because
the backend does not support inverted paths. This manifests as rounded buttons not being
drawn when printing, tracked as Chrome bug 79519.

However, when the output is a vector device, like PDF, we don't need antialiased clips.
It's up to the PDF rendering engine to do that.  So we can simply disable the antialiased
clip code if the output is a vector device.

I think the fix isn't testable because it requires examining the printed output.

* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::clipPathAntiAliased):

[email protected]
Review URL: http://codereview.chromium.org/7398032

Modified Paths

Diff

Modified: branches/chromium/782/Source/WebCore/ChangeLog (91206 => 91207)


--- branches/chromium/782/Source/WebCore/ChangeLog	2011-07-18 20:38:42 UTC (rev 91206)
+++ branches/chromium/782/Source/WebCore/ChangeLog	2011-07-18 20:56:42 UTC (rev 91207)
@@ -1,3 +1,24 @@
+2011-07-07  Steve VanDeBogart  <[email protected]>
+
+        Work around Skia PDF's lack of inverted path support.
+        https://bugs.webkit.org/show_bug.cgi?id=64032
+
+        Reviewed by James Robinson.
+
+        The trick used in http://neugierig.org/software/chromium/notes/2010/07/clipping.html
+        to support antialiased clips doesn't work when printing to Skia's PDF backend because
+        the backend does not support inverted paths. This manifests as rounded buttons not being
+        drawn when printing, tracked as Chrome bug 79519.
+        
+        However, when the output is a vector device, like PDF, we don't need antialiased clips.
+        It's up to the PDF rendering engine to do that.  So we can simply disable the antialiased
+        clip code if the output is a vector device.
+        
+        I think the fix isn't testable because it requires examining the printed output.
+
+        * platform/graphics/skia/PlatformContextSkia.cpp:
+        (WebCore::PlatformContextSkia::clipPathAntiAliased):
+
 2011-06-23  John Bates  <[email protected]>
 
         Reviewed by James Robinson.

Modified: branches/chromium/782/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp (91206 => 91207)


--- branches/chromium/782/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp	2011-07-18 20:38:42 UTC (rev 91206)
+++ branches/chromium/782/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp	2011-07-18 20:56:42 UTC (rev 91207)
@@ -297,6 +297,14 @@
 
 void PlatformContextSkia::clipPathAntiAliased(const SkPath& clipPath)
 {
+    if (m_canvas->getTopDevice()->getDeviceCapabilities() & SkDevice::kVector_Capability) {
+        // When the output is a vector device, like PDF, we don't need antialiased clips.
+        // It's up to the PDF rendering engine to do that. We can simply disable the
+        // antialiased clip code if the output is a vector device.
+        canvas()->clipPath(clipPath);
+        return;
+    }
+
     // If we are currently tracking any anti-alias clip paths, then we already
     // have a layer in place and don't need to add another.
     bool haveLayerOutstanding = m_state->m_antiAliasClipPaths.size();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to