Changeset 200465 in webkit


Ignore:
Timestamp:
May 5, 2016 11:36:22 AM (8 years ago)
Author:
Simon Fraser
Message:

Comments on wired.com are blurry
https://bugs.webkit.org/show_bug.cgi?id=148630
Source/WebCore:

rdar://problem/22499655

Reviewed by Tim Horton.

Make sure to set -rasterizationScale on TileGrid container layers to avoid blurry layers
with some configurations of transforms, perspective and clipping.

Test: compositing/contents-scale/rasterization-scale.html

  • platform/graphics/ca/TileController.cpp:

(WebCore::TileController::TileController): Initialize m_deviceScaleFactor before m_tileGrid,
because TileGrid's constructor needs to read the device scale.

  • platform/graphics/ca/TileController.h:
  • platform/graphics/ca/TileGrid.cpp:

(WebCore::TileGrid::TileGrid): Push a contentsScale (which also sets rasterizationScale) onto
the tile grid container layer on constructions, and in setScale().
(WebCore::TileGrid::setScale):

LayoutTests:

Reviewed by Tim Horton.

This testcase does not fail without the patch because of how WTR does snapshotting,
but some future improvement may fix that.

  • compositing/contents-scale/rasterization-scale-expected.html: Added.
  • compositing/contents-scale/rasterization-scale.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r200464 r200465  
     12016-05-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Comments on wired.com are blurry
     4        https://bugs.webkit.org/show_bug.cgi?id=148630
     5
     6        Reviewed by Tim Horton.
     7
     8        This testcase does not fail without the patch because of how WTR does snapshotting,
     9        but some future improvement may fix that.
     10
     11        * compositing/contents-scale/rasterization-scale-expected.html: Added.
     12        * compositing/contents-scale/rasterization-scale.html: Added.
     13
    1142016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r200464 r200465  
     12016-05-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Comments on wired.com are blurry
     4        https://bugs.webkit.org/show_bug.cgi?id=148630
     5        rdar://problem/22499655
     6
     7        Reviewed by Tim Horton.
     8
     9        Make sure to set -rasterizationScale on TileGrid container layers to avoid blurry layers
     10        with some configurations of transforms, perspective and clipping.
     11
     12        Test: compositing/contents-scale/rasterization-scale.html
     13
     14        * platform/graphics/ca/TileController.cpp:
     15        (WebCore::TileController::TileController): Initialize m_deviceScaleFactor before m_tileGrid,
     16        because TileGrid's constructor needs to read the device scale.
     17        * platform/graphics/ca/TileController.h:
     18        * platform/graphics/ca/TileGrid.cpp:
     19        (WebCore::TileGrid::TileGrid): Push a contentsScale (which also sets rasterizationScale) onto
     20        the tile grid container layer on constructions, and in setScale().
     21        (WebCore::TileGrid::setScale):
     22
    1232016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
    224
  • trunk/Source/WebCore/platform/graphics/ca/TileController.cpp

    r199130 r200465  
    6262TileController::TileController(PlatformCALayer* rootPlatformLayer)
    6363    : m_tileCacheLayer(rootPlatformLayer)
     64    , m_deviceScaleFactor(owningGraphicsLayer()->platformCALayerDeviceScaleFactor())
    6465    , m_tileGrid(std::make_unique<TileGrid>(*this))
    6566    , m_tileRevalidationTimer(*this, &TileController::tileRevalidationTimerFired)
    6667    , m_tileSizeChangeTimer(*this, &TileController::tileSizeChangeTimerFired, tileSizeUpdateDelay)
    67     , m_deviceScaleFactor(owningGraphicsLayer()->platformCALayerDeviceScaleFactor())
    6868    , m_marginEdges(false, false, false, false)
    6969{
  • trunk/Source/WebCore/platform/graphics/ca/TileController.h

    r199130 r200465  
    183183    PlatformCALayer* m_tileCacheLayer;
    184184
     185    float m_zoomedOutContentsScale { 0 };
     186    float m_deviceScaleFactor;
     187
    185188    std::unique_ptr<TileCoverageMap> m_coverageMap;
    186189
     
    194197    Timer m_tileRevalidationTimer;
    195198    DeferrableOneShotTimer m_tileSizeChangeTimer;
    196 
    197     float m_zoomedOutContentsScale { 0 };
    198     float m_deviceScaleFactor;
    199199
    200200    TileCoverage m_tileCoverage { CoverageForVisibleArea };
  • trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp

    r198189 r200465  
    4949{
    5050    m_containerLayer.get().setName(TileController::tileGridContainerLayerName());
     51    m_containerLayer.get().setContentsScale(m_controller.deviceScaleFactor());
    5152}
    5253
     
    7778    // FIXME: we may revalidateTiles twice in this commit.
    7879    revalidateTiles(PruneSecondaryTiles);
     80
     81    m_containerLayer.get().setContentsScale(m_controller.deviceScaleFactor());
    7982
    8083    for (auto& tile : m_tiles.values())
Note: See TracChangeset for help on using the changeset viewer.