https://bugs.webkit.org/show_bug.cgi?id=131185
Reviewed by Tim Horton.
r166309 added a short circuit in GraphicsLayerCA::updateContentsScale()
when the scale didn't change. This broke layers which expected to
unconditionally receive a setContentsScale(), namely the WebTiledBackingLayer
which owns the TileController. WebTiledBackingLayer overrode -setContentsScale:
to pass the scale down to the TileController; however, it didn't override
-contentsScale, and it mucked with the scale passed in.
Fix by having setting and fetching contentsScale on a WebTiledBackingLayer
work as expected. Also rename the TileController functions to mirror the
CALayer functions better.
* WebCore.exp.in:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateContentsScale):
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::TileController):
(WebCore::TileController::contentsScale):
(WebCore::TileController::setContentsScale):
(WebCore::TileController::scale): Deleted.
(WebCore::TileController::setScale): Deleted.
* platform/graphics/ca/mac/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer setContentsScale:]):
(-[WebTiledBackingLayer contentsScale]):
Source/WebKit2: Pixelated WebView when display is changed from hiDPI to regularDPI
https://bugs.webkit.org/show_bug.cgi?id=131185
<rdar://problem/
16512184&
16503714>
Reviewed by Tim Horton.
TileController function was renamed.
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
(WebKit::PlatformCALayerRemoteTiledBacking::setContentsScale):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166748
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-04-03 Simon Fraser <simon.fraser@apple.com>
+
+ Pixelated WebView when display is changed from hiDPI to regularDPI
+ https://bugs.webkit.org/show_bug.cgi?id=131185
+
+ Reviewed by Tim Horton.
+
+ r166309 added a short circuit in GraphicsLayerCA::updateContentsScale()
+ when the scale didn't change. This broke layers which expected to
+ unconditionally receive a setContentsScale(), namely the WebTiledBackingLayer
+ which owns the TileController. WebTiledBackingLayer overrode -setContentsScale:
+ to pass the scale down to the TileController; however, it didn't override
+ -contentsScale, and it mucked with the scale passed in.
+
+ Fix by having setting and fetching contentsScale on a WebTiledBackingLayer
+ work as expected. Also rename the TileController functions to mirror the
+ CALayer functions better.
+
+ * WebCore.exp.in:
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::updateContentsScale):
+ * platform/graphics/ca/mac/TileController.h:
+ * platform/graphics/ca/mac/TileController.mm:
+ (WebCore::TileController::TileController):
+ (WebCore::TileController::contentsScale):
+ (WebCore::TileController::setContentsScale):
+ (WebCore::TileController::scale): Deleted.
+ (WebCore::TileController::setScale): Deleted.
+ * platform/graphics/ca/mac/WebTiledBackingLayer.mm:
+ (-[WebTiledBackingLayer setContentsScale:]):
+ (-[WebTiledBackingLayer contentsScale]):
+
2014-04-03 Zoltan Horvath <zoltan@webkit.org>
[CSS Shapes] LineSegment logicalLeft and logicalRight members should be floats
__ZN7WebCore14TileController14setTilesOpaqueEb
__ZN7WebCore14TileController15containerLayersEv
__ZN7WebCore14TileController15setNeedsDisplayEv
+__ZN7WebCore14TileController16setContentsScaleEf
__ZN7WebCore14TileController21setAcceleratesDrawingEb
__ZN7WebCore14TileController21setNeedsDisplayInRectERKNS_7IntRectE
__ZN7WebCore14TileController23setTileDebugBorderColorENS_5ColorE
__ZN7WebCore14TileController23setTileDebugBorderWidthEf
__ZN7WebCore14TileController27tileCacheLayerBoundsChangedEv
__ZN7WebCore14TileController6createEPNS_15PlatformCALayerE
-__ZN7WebCore14TileController8setScaleEf
__ZN7WebCore14decodeHostNameEP8NSString
__ZN7WebCore14encodeHostNameEP8NSString
__ZN7WebCore14endOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
void setNeedsDisplay();
void setNeedsDisplayInRect(const IntRect&);
- void setScale(float);
- float scale() const;
+ void setContentsScale(float);
+ float contentsScale() const { return m_contentsScale; }
bool acceleratesDrawing() const { return m_acceleratesDrawing; }
void setAcceleratesDrawing(bool);
RepaintCountMap m_tileRepaintCounts;
+ float m_contentsScale;
float m_deviceScaleFactor;
TileCoverage m_tileCoverage;
, m_tileSize(defaultTileWidth, defaultTileHeight)
, m_exposedRect(FloatRect::infiniteRect())
, m_tileRevalidationTimer(this, &TileController::tileRevalidationTimerFired)
+ , m_contentsScale(1)
, m_deviceScaleFactor(1)
, m_tileCoverage(CoverageForVisibleArea)
, m_marginTop(0)
return owningGraphicsLayer()->platformCALayerShowRepaintCounter(0);
}
-float TileController::scale() const
-{
- return tileGrid().scale();
-}
-
-void TileController::setScale(float scale)
+void TileController::setContentsScale(float scale)
{
+ m_contentsScale = scale;
+
ASSERT(owningGraphicsLayer()->isCommittingChanges());
float deviceScaleFactor = platformCALayerDeviceScaleFactor();
- (void)setContentsScale:(CGFloat)contentsScale
{
- _tileController->setScale(contentsScale);
+ _tileController->setContentsScale(contentsScale);
+}
+
+- (CGFloat)contentsScale
+{
+ return _tileController->contentsScale();
}
- (WebCore::TiledBacking*)tiledBacking
+2014-04-03 Simon Fraser <simon.fraser@apple.com>
+
+ Pixelated WebView when display is changed from hiDPI to regularDPI
+ https://bugs.webkit.org/show_bug.cgi?id=131185
+ <rdar://problem/16512184&16503714>
+
+ Reviewed by Tim Horton.
+
+ TileController function was renamed.
+
+ * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
+ (WebKit::PlatformCALayerRemoteTiledBacking::setContentsScale):
+
2014-04-03 Sam Weinig <sam@webkit.org>
[WebKit2] Promote user script SPI to API
void PlatformCALayerRemoteTiledBacking::setContentsScale(float scale)
{
- m_tileController->setScale(scale);
+ m_tileController->setContentsScale(scale);
}
void PlatformCALayerRemoteTiledBacking::setBorderWidth(float borderWidth)