2011-01-12 Chris Marrin <cmarrin@apple.com>
authorcmarrin@apple.com <cmarrin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jan 2011 22:27:27 +0000 (22:27 +0000)
committercmarrin@apple.com <cmarrin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jan 2011 22:27:27 +0000 (22:27 +0000)
commitaed031c25816770a550c67217149cac2969383aa
tree07a19614040d035db587dddb4eb1cff99f9785e7
parent3492423c490c6ab068be0cd82877848d7fca9796
2011-01-12  Chris Marrin  <cmarrin@apple.com>

        Reviewed by Simon Fraser.

        Pages with accelerated layers lose subpixel-AA and become blurry when a scale factor is applied
        rdar://problem/8824974

        When scaled, WebKit renders the page content at the scaled up size, so there are no
        scaling artifacts. But content drawn into a layer's backing store does not scale up.
        This is made worse by the fact that the root page contents become layered when there
        are other accelerated compositing layers present (video, plugins, etc.).

        Plumb scaling factor from Frame::scalePage() down into all layers with content. It
        eventually calls CALayer::setContentsScale which renders to a backing store whose dimensions
        are scaled, causing them to render larger and appear pixel perfect at the scaled
        page size.

         * page/Frame.cpp:
         (WebCore::Frame::updateContentsScale):
         (WebCore::Frame::scalePage):
         * page/Frame.h:
         * platform/graphics/GraphicsLayer.h:
         * platform/graphics/ca/GraphicsLayerCA.cpp:
         (WebCore::GraphicsLayerCA::setContentsScale):
         (WebCore::GraphicsLayerCA::clampedContentsScaleForScale):
         * platform/graphics/ca/GraphicsLayerCA.h:
         (WebCore::GraphicsLayerCA::contentsScale):
         * platform/graphics/ca/PlatformCALayer.h:
         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
         (PlatformCALayer::contentsScale):
         (PlatformCALayer::setContentsScale):
         * rendering/RenderLayer.cpp:
         (WebCore::RenderLayer::updateContentsScale):
         * rendering/RenderLayer.h:
         * rendering/RenderLayerBacking.cpp:
         (WebCore::RenderLayerBacking::createGraphicsLayer):
         (WebCore::RenderLayerBacking::updateForegroundLayer):
         (WebCore::RenderLayerBacking::updateMaskLayer):
         (WebCore::RenderLayerBacking::updateContentsScale):
         * rendering/RenderLayerBacking.h:
         * rendering/RenderLayerCompositor.cpp:
         (WebCore::RenderLayerCompositor::updateContentsScale):
         * rendering/RenderLayerCompositor.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h