- Revision
- 200465
- Author
- [email protected]
- Date
- 2016-05-05 11:36:22 -0700 (Thu, 05 May 2016)
Log 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.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (200464 => 200465)
--- trunk/LayoutTests/ChangeLog 2016-05-05 18:33:17 UTC (rev 200464)
+++ trunk/LayoutTests/ChangeLog 2016-05-05 18:36:22 UTC (rev 200465)
@@ -1,3 +1,16 @@
+2016-05-04 Simon Fraser <[email protected]>
+
+ Comments on wired.com are blurry
+ https://bugs.webkit.org/show_bug.cgi?id=148630
+
+ 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.
+
2016-05-05 Ryosuke Niwa <[email protected]>
event.target shouldn't be retargeted as the event bubbles into a slot
Added: trunk/LayoutTests/compositing/contents-scale/rasterization-scale-expected.html (0 => 200465)
--- trunk/LayoutTests/compositing/contents-scale/rasterization-scale-expected.html (rev 0)
+++ trunk/LayoutTests/compositing/contents-scale/rasterization-scale-expected.html 2016-05-05 18:36:22 UTC (rev 200465)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <style>
+ .container {
+ overflow: hidden;
+ padding: 10px;
+ height: 2450px;
+ }
+
+ .child {
+ height: 2500px;
+ overflow: hidden;
+ transform: translateZ(0);
+ }
+ </style>
+</head>
+<body>
+
+<div class="container">
+ <div class="child">
+ <p>This text should not be blurry on retina devices</p>
+ </div>
+</div>
+</body>
+</html>
Added: trunk/LayoutTests/compositing/contents-scale/rasterization-scale.html (0 => 200465)
--- trunk/LayoutTests/compositing/contents-scale/rasterization-scale.html (rev 0)
+++ trunk/LayoutTests/compositing/contents-scale/rasterization-scale.html 2016-05-05 18:36:22 UTC (rev 200465)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <style>
+ .container {
+ perspective: 1000px;
+ overflow: hidden;
+ padding: 10px;
+ height: 2450px;
+ }
+
+ .child {
+ height: 2500px;
+ overflow: hidden;
+ perspective: 1000px;
+ transform: translateZ(0);
+ }
+ </style>
+</head>
+<body>
+
+<div class="container">
+ <div class="child">
+ <p>This text should not be blurry on retina devices</p>
+ </div>
+</div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (200464 => 200465)
--- trunk/Source/WebCore/ChangeLog 2016-05-05 18:33:17 UTC (rev 200464)
+++ trunk/Source/WebCore/ChangeLog 2016-05-05 18:36:22 UTC (rev 200465)
@@ -1,3 +1,25 @@
+2016-05-04 Simon Fraser <[email protected]>
+
+ Comments on wired.com are blurry
+ https://bugs.webkit.org/show_bug.cgi?id=148630
+ 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):
+
2016-05-05 Ryosuke Niwa <[email protected]>
event.target shouldn't be retargeted as the event bubbles into a slot
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (200464 => 200465)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2016-05-05 18:33:17 UTC (rev 200464)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2016-05-05 18:36:22 UTC (rev 200465)
@@ -61,10 +61,10 @@
TileController::TileController(PlatformCALayer* rootPlatformLayer)
: m_tileCacheLayer(rootPlatformLayer)
+ , m_deviceScaleFactor(owningGraphicsLayer()->platformCALayerDeviceScaleFactor())
, m_tileGrid(std::make_unique<TileGrid>(*this))
, m_tileRevalidationTimer(*this, &TileController::tileRevalidationTimerFired)
, m_tileSizeChangeTimer(*this, &TileController::tileSizeChangeTimerFired, tileSizeUpdateDelay)
- , m_deviceScaleFactor(owningGraphicsLayer()->platformCALayerDeviceScaleFactor())
, m_marginEdges(false, false, false, false)
{
}
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (200464 => 200465)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.h 2016-05-05 18:33:17 UTC (rev 200464)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h 2016-05-05 18:36:22 UTC (rev 200465)
@@ -182,6 +182,9 @@
PlatformCALayer* m_tileCacheLayer;
+ float m_zoomedOutContentsScale { 0 };
+ float m_deviceScaleFactor;
+
std::unique_ptr<TileCoverageMap> m_coverageMap;
std::unique_ptr<TileGrid> m_tileGrid;
@@ -194,9 +197,6 @@
Timer m_tileRevalidationTimer;
DeferrableOneShotTimer m_tileSizeChangeTimer;
- float m_zoomedOutContentsScale { 0 };
- float m_deviceScaleFactor;
-
TileCoverage m_tileCoverage { CoverageForVisibleArea };
VelocityData m_velocity;
Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (200464 => 200465)
--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp 2016-05-05 18:33:17 UTC (rev 200464)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp 2016-05-05 18:36:22 UTC (rev 200465)
@@ -48,6 +48,7 @@
, m_tileSize(kDefaultTileSize, kDefaultTileSize)
{
m_containerLayer.get().setName(TileController::tileGridContainerLayerName());
+ m_containerLayer.get().setContentsScale(m_controller.deviceScaleFactor());
}
TileGrid::~TileGrid()
@@ -77,6 +78,8 @@
// FIXME: we may revalidateTiles twice in this commit.
revalidateTiles(PruneSecondaryTiles);
+ m_containerLayer.get().setContentsScale(m_controller.deviceScaleFactor());
+
for (auto& tile : m_tiles.values())
tile.layer->setContentsScale(m_controller.deviceScaleFactor());
}