- Revision
- 131489
- Author
- [email protected]
- Date
- 2012-10-16 13:00:07 -0700 (Tue, 16 Oct 2012)
Log Message
Add a new layer type for the page tiled cache layer
https://bugs.webkit.org/show_bug.cgi?id=99491
Reviewed by Dean Jackson.
In preparation for using tile cache layers in place of CATiledLayer,
add a new PlatformCALayer layer type LayerTypePageTileCacheLayer,
since the page tile cache will have some different behavior from
other tile cache layers.
Generalize code that was looking at LayerTypeTileCacheLayer to use
usesTileCacheLayer() if it applies to both types of tile caches.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::recursiveCommitChanges): Show the tile
wash for tiled layers as well as layers with transforms (the tile
wash is just for debugging).
(WebCore::GraphicsLayerCA::platformCALayerDidCreateTiles):
(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::usesTileCacheLayer):
(PlatformCALayer):
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayer::PlatformCALayer):
(PlatformCALayer::~PlatformCALayer):
(PlatformCALayer::tiledBacking):
* platform/graphics/mac/WebLayer.mm:
(drawLayerContents): Avoid double-drawing the repaint counter in tile cache layers.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (131488 => 131489)
--- trunk/Source/WebCore/ChangeLog 2012-10-16 19:48:18 UTC (rev 131488)
+++ trunk/Source/WebCore/ChangeLog 2012-10-16 20:00:07 UTC (rev 131489)
@@ -1,3 +1,35 @@
+2012-10-16 Simon Fraser <[email protected]>
+
+ Add a new layer type for the page tiled cache layer
+ https://bugs.webkit.org/show_bug.cgi?id=99491
+
+ Reviewed by Dean Jackson.
+
+ In preparation for using tile cache layers in place of CATiledLayer,
+ add a new PlatformCALayer layer type LayerTypePageTileCacheLayer,
+ since the page tile cache will have some different behavior from
+ other tile cache layers.
+
+ Generalize code that was looking at LayerTypeTileCacheLayer to use
+ usesTileCacheLayer() if it applies to both types of tile caches.
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::GraphicsLayerCA):
+ (WebCore::GraphicsLayerCA::recursiveCommitChanges): Show the tile
+ wash for tiled layers as well as layers with transforms (the tile
+ wash is just for debugging).
+ (WebCore::GraphicsLayerCA::platformCALayerDidCreateTiles):
+ (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
+ * platform/graphics/ca/PlatformCALayer.h:
+ (WebCore::PlatformCALayer::usesTileCacheLayer):
+ (PlatformCALayer):
+ * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+ (PlatformCALayer::PlatformCALayer):
+ (PlatformCALayer::~PlatformCALayer):
+ (PlatformCALayer::tiledBacking):
+ * platform/graphics/mac/WebLayer.mm:
+ (drawLayerContents): Avoid double-drawing the repaint counter in tile cache layers.
+
2012-10-16 Stephen Chenney <[email protected]>
An feImage that tries to render itself should be stopped
https://bugs.webkit.org/show_bug.cgi?id=94652
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (131488 => 131489)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2012-10-16 19:48:18 UTC (rev 131488)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2012-10-16 20:00:07 UTC (rev 131489)
@@ -280,7 +280,7 @@
{
PlatformCALayer::LayerType layerType = PlatformCALayer::LayerTypeWebLayer;
if (client && client->shouldUseTileCache(this)) {
- layerType = PlatformCALayer::LayerTypeTileCacheLayer;
+ layerType = PlatformCALayer::LayerTypePageTileCacheLayer;
m_isPageTileCacheLayer = true;
}
@@ -964,7 +964,7 @@
#ifdef VISIBLE_TILE_WASH
// Use having a transform as a key to making the tile wash layer. If every layer gets a wash,
// they start to obscure useful information.
- if (!m_transform.isIdentity() && !m_visibleTileWashLayer) {
+ if ((!m_transform.isIdentity() || m_usingTiledLayer) && !m_visibleTileWashLayer) {
static Color washFillColor(255, 0, 0, 50);
static Color washBorderColor(255, 0, 0, 100);
@@ -1036,7 +1036,7 @@
void GraphicsLayerCA::platformCALayerDidCreateTiles(const Vector<FloatRect>& dirtyRects)
{
- ASSERT(m_layer->layerType() == PlatformCALayer::LayerTypeTileCacheLayer);
+ ASSERT(m_layer->usesTileCacheLayer());
for (size_t i = 0; i < dirtyRects.size(); ++i)
setNeedsDisplayInRect(dirtyRects[i]);
@@ -2493,7 +2493,7 @@
void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer, float pageScaleFactor, const FloatPoint& positionRelativeToBase)
{
- ASSERT(m_layer->layerType() != PlatformCALayer::LayerTypeTileCacheLayer);
+ ASSERT(m_layer->layerType() != PlatformCALayer::LayerTypePageTileCacheLayer);
ASSERT(useTiledLayer != m_usingTiledLayer);
RefPtr<PlatformCALayer> oldLayer = m_layer;
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (131488 => 131489)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2012-10-16 19:48:18 UTC (rev 131488)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2012-10-16 20:00:07 UTC (rev 131489)
@@ -60,6 +60,7 @@
LayerTypeTransformLayer,
LayerTypeWebTiledLayer,
LayerTypeTileCacheLayer,
+ LayerTypePageTileCacheLayer,
LayerTypeRootLayer,
LayerTypeCustom
};
@@ -79,6 +80,8 @@
PlatformLayer* platformLayer() const;
+ bool usesTileCacheLayer() const { return m_layerType == LayerTypePageTileCacheLayer || m_layerType == LayerTypeTileCacheLayer; }
+
PlatformCALayer* rootLayer() const;
// A list of sublayers that GraphicsLayerCA should maintain as the first sublayers.
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (131488 => 131489)
--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm 2012-10-16 19:48:18 UTC (rev 131488)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm 2012-10-16 20:00:07 UTC (rev 131489)
@@ -35,6 +35,7 @@
#import "GraphicsContext.h"
#import "GraphicsLayerCA.h"
#import "LengthFunctions.h"
+#import "TiledBacking.h"
#import "WebLayer.h"
#import "WebTiledLayer.h"
#import "WebTileCacheLayer.h"
@@ -193,6 +194,7 @@
layerClass = [WebTiledLayer class];
break;
case LayerTypeTileCacheLayer:
+ case LayerTypePageTileCacheLayer:
layerClass = [WebTileCacheLayer class];
break;
case LayerTypeCustom:
@@ -218,7 +220,7 @@
[tiledLayer setContentsGravity:@"bottomLeft"];
}
- if (m_layerType == LayerTypeTileCacheLayer) {
+ if (usesTileCacheLayer()) {
m_customSublayers = adoptPtr(new PlatformCALayerList(1));
CALayer* tileCacheTileContainerLayer = [static_cast<WebTileCacheLayer *>(m_layer.get()) tileContainerLayer];
(*m_customSublayers)[0] = PlatformCALayer::create(tileCacheTileContainerLayer, 0);
@@ -238,7 +240,7 @@
// Remove the owner pointer from the delegate in case there is a pending animationStarted event.
[static_cast<WebAnimationDelegate*>(m_delegate.get()) setOwner:nil];
- if (m_layerType == LayerTypeTileCacheLayer)
+ if (usesTileCacheLayer())
[static_cast<WebTileCacheLayer *>(m_layer.get()) invalidate];
}
@@ -931,7 +933,7 @@
TiledBacking* PlatformCALayer::tiledBacking()
{
- if (m_layerType != LayerTypeTileCacheLayer)
+ if (!usesTileCacheLayer())
return 0;
WebTileCacheLayer *tileCacheLayer = static_cast<WebTileCacheLayer *>(m_layer.get());
Modified: trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm (131488 => 131489)
--- trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm 2012-10-16 19:48:18 UTC (rev 131488)
+++ trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm 2012-10-16 20:00:07 UTC (rev 131489)
@@ -109,7 +109,7 @@
// Re-fetch the layer owner, since <rdar://problem/9125151> indicates that it might have been destroyed during painting.
layerContents = platformLayer->owner();
ASSERT(layerContents);
- if (layerContents && layerContents->platformCALayerShowRepaintCounter(platformLayer)) {
+ if (!platformLayer->usesTileCacheLayer() && layerContents && layerContents->platformCALayerShowRepaintCounter(platformLayer)) {
bool isTiledLayer = [layer isKindOfClass:[CATiledLayer class]];
char text[16]; // that's a lot of repaints