⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 90599 in webkit


Ignore:
Timestamp:
Jul 7, 2011, 4:16:19 PM (15 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Steve VanDeBogart <vandebo@chromium.org> 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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90596 r90599  
     12011-07-07  Steve VanDeBogart  <vandebo@chromium.org>
     2
     3        Work around Skia PDF's lack of inverted path support.
     4        https://bugs.webkit.org/show_bug.cgi?id=64032
     5
     6        Reviewed by James Robinson.
     7
     8        The trick used in http://neugierig.org/software/chromium/notes/2010/07/clipping.html
     9        to support antialiased clips doesn't work when printing to Skia's PDF backend because
     10        the backend does not support inverted paths. This manifests as rounded buttons not being
     11        drawn when printing, tracked as Chrome bug 79519.
     12       
     13        However, when the output is a vector device, like PDF, we don't need antialiased clips.
     14        It's up to the PDF rendering engine to do that.  So we can simply disable the antialiased
     15        clip code if the output is a vector device.
     16       
     17        I think the fix isn't testable because it requires examining the printed output.
     18
     19        * platform/graphics/skia/PlatformContextSkia.cpp:
     20        (WebCore::PlatformContextSkia::clipPathAntiAliased):
     21
    1222011-07-07  Emil A Eklund  <eae@chromium.org>
    223
  • trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp

    r90498 r90599  
    297297void PlatformContextSkia::clipPathAntiAliased(const SkPath& clipPath)
    298298{
     299    if (m_canvas->getTopDevice()->getDeviceCapabilities() & SkDevice::kVector_Capability) {
     300        // When the output is a vector device, like PDF, we don't need antialiased clips.
     301        // It's up to the PDF rendering engine to do that. We can simply disable the
     302        // antialiased clip code if the output is a vector device.
     303        canvas()->clipPath(clipPath);
     304        return;
     305    }
     306
    299307    // If we are currently tracking any anti-alias clip paths, then we already
    300308    // have a layer in place and don't need to add another.
Note: See TracChangeset for help on using the changeset viewer.