Title: [107843] trunk/Source/WebCore
- Revision
- 107843
- Author
- [email protected]
- Date
- 2012-02-15 14:48:36 -0800 (Wed, 15 Feb 2012)
Log Message
TileCache needs to support setting the contents scale
https://bugs.webkit.org/show_bug.cgi?id=78741
<rdar://problem/10710773>
Reviewed by Sam Weinig.
* platform/graphics/ca/mac/TileCache.h:
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::setContentsScale):
Update the contents scale of all the tiles and then revalidate the tile cache since tiles
might have come and gone as a result of setting the contents scale.
(WebCore::TileCache::createTileLayer):
Set the contents scale of the tile layer.
* platform/graphics/ca/mac/WebTileCacheLayer.mm:
(-[WebTileCacheLayer setContentsScale:]):
Call TileCache::setContentsScale.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (107842 => 107843)
--- trunk/Source/WebCore/ChangeLog 2012-02-15 22:36:31 UTC (rev 107842)
+++ trunk/Source/WebCore/ChangeLog 2012-02-15 22:48:36 UTC (rev 107843)
@@ -1,5 +1,26 @@
2012-02-15 Anders Carlsson <[email protected]>
+ TileCache needs to support setting the contents scale
+ https://bugs.webkit.org/show_bug.cgi?id=78741
+ <rdar://problem/10710773>
+
+ Reviewed by Sam Weinig.
+
+ * platform/graphics/ca/mac/TileCache.h:
+ * platform/graphics/ca/mac/TileCache.mm:
+ (WebCore::TileCache::setContentsScale):
+ Update the contents scale of all the tiles and then revalidate the tile cache since tiles
+ might have come and gone as a result of setting the contents scale.
+
+ (WebCore::TileCache::createTileLayer):
+ Set the contents scale of the tile layer.
+
+ * platform/graphics/ca/mac/WebTileCacheLayer.mm:
+ (-[WebTileCacheLayer setContentsScale:]):
+ Call TileCache::setContentsScale.
+
+2012-02-15 Anders Carlsson <[email protected]>
+
Try to fix the Chromium build and remove a snarky comment in the process.
* platform/chromium/PopupListBox.cpp:
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h (107842 => 107843)
--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h 2012-02-15 22:36:31 UTC (rev 107842)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h 2012-02-15 22:48:36 UTC (rev 107843)
@@ -55,6 +55,7 @@
void setNeedsDisplay();
void setNeedsDisplayInRect(const IntRect&);
void drawLayer(WebTileLayer*, CGContextRef);
+ void setContentsScale(CGFloat);
bool acceleratesDrawing() const { return m_acceleratesDrawing; }
void setAcceleratesDrawing(bool);
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (107842 => 107843)
--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm 2012-02-15 22:36:31 UTC (rev 107842)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm 2012-02-15 22:48:36 UTC (rev 107843)
@@ -156,6 +156,18 @@
CGContextRestoreGState(context);
}
+void TileCache::setContentsScale(CGFloat contentsScale)
+{
+ for (TileMap::const_iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it) {
+ [it->second.get() setContentsScale:contentsScale];
+ [it->second.get() setNeedsDisplay];
+ }
+
+ PlatformCALayer* platformLayer = PlatformCALayer::platformCALayer(m_tileCacheLayer);
+ platformLayer->owner()->platformCALayerDidCreateTiles();
+ revalidateTiles();
+}
+
void TileCache::setAcceleratesDrawing(bool acceleratesDrawing)
{
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
@@ -332,6 +344,7 @@
[layer.get() setBorderColor:m_tileDebugBorderColor.get()];
[layer.get() setBorderWidth:m_tileDebugBorderWidth];
[layer.get() setEdgeAntialiasingMask:0];
+ [layer.get() setContentsScale:[m_tileCacheLayer contentsScale]];
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
[layer.get() setAcceleratesDrawing:m_acceleratesDrawing];
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.mm (107842 => 107843)
--- trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.mm 2012-02-15 22:36:31 UTC (rev 107842)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.mm 2012-02-15 22:48:36 UTC (rev 107843)
@@ -72,6 +72,16 @@
return _tileCache->acceleratesDrawing();
}
+- (void)setContentsScale:(CGFloat)contentsScale
+{
+ CGFloat oldContentsScale = [self contentsScale];
+
+ [super setContentsScale:contentsScale];
+
+ if (contentsScale != oldContentsScale)
+ _tileCache->setContentsScale(contentsScale);
+}
+
- (CALayer *)tileContainerLayer
{
return _tileCache->tileContainerLayer();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes