Changeset 130676 in webkit
- Timestamp:
- Oct 8, 2012, 1:10:22 PM (14 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/graphics/GraphicsLayer.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/GraphicsLayer.h (modified) (2 diffs)
-
WebCore/platform/graphics/GraphicsLayerClient.h (modified) (1 diff)
-
WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (modified) (6 diffs)
-
WebCore/platform/graphics/ca/GraphicsLayerCA.h (modified) (3 diffs)
-
WebCore/platform/graphics/ca/PlatformCALayerClient.h (modified) (1 diff)
-
WebCore/platform/graphics/ca/mac/TileCache.mm (modified) (1 diff)
-
WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp (modified) (3 diffs)
-
WebCore/platform/graphics/mac/WebLayer.mm (modified) (2 diffs)
-
WebCore/platform/graphics/mac/WebTiledLayer.mm (modified) (1 diff)
-
WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp (modified) (1 diff)
-
WebCore/rendering/RenderLayerBacking.h (modified) (1 diff)
-
WebCore/rendering/RenderLayerCompositor.cpp (modified) (1 diff)
-
WebKit/win/ChangeLog (modified) (1 diff)
-
WebKit/win/FullscreenVideoController.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r130672 r130676 1 2012-10-08 Simon Fraser <simon.fraser@apple.com> 2 3 Some GraphicsLayer cleanup to separate the concepts of using a tile cache, and being the main tile cache layer 4 https://bugs.webkit.org/show_bug.cgi?id=98574 5 6 Reviewed by Dean Jackson. 7 8 GraphicsLayerCA assumed that using a TileCache equated to being the main page tile 9 cache layer, which has some special considerations. Make these two concepts separate 10 to get closer to being able to use TileCaches in place of CATiledLayer. 11 12 * platform/graphics/GraphicsLayer.h: 13 (GraphicsLayer): Remove m_usingTileCache member, which was not appropriate 14 for this class to have. 15 * platform/graphics/GraphicsLayer.cpp: 16 (WebCore::GraphicsLayer::GraphicsLayer): Remove init of m_usingTileCache. 17 (WebCore::GraphicsLayer::debugBorderInfo): Can no longer use m_usingTileCache to 18 get the blue color, so moved code into a virtual debugBorderInfo() method. 19 (WebCore::GraphicsLayer::updateDebugIndicators): Call the virtual debugBorderInfo(). 20 * platform/graphics/GraphicsLayerClient.h: Remove the usingTileCache() callback; 21 we now just cache this information in the GraphicsLayerCA on creation. 22 * platform/graphics/ca/GraphicsLayerCA.cpp: 23 (WebCore::GraphicsLayerCA::GraphicsLayerCA): Init m_isPageTileCacheLayer to false, 24 then set to m_isPageTileCacheLayer if the client says we should create a tile cache. 25 (WebCore::GraphicsLayerCA::platformCALayerShowRepaintCounter): Overidden to avoid duplicate repaint 26 counters in the top-left tile. 27 (WebCore::GraphicsLayerCA::updateLayerBackgroundColor): If this layer is the page tile cache layer, 28 we allow setting of its background color. 29 (WebCore::GraphicsLayerCA::debugBorderInfo): Overidden to use a blue color for tiles. 30 (WebCore::GraphicsLayerCA::requiresTiledLayer): Don't make CATiledLayers for the page tile cache. 31 * platform/graphics/ca/GraphicsLayerCA.h: 32 (GraphicsLayerCA): 33 * platform/graphics/ca/PlatformCALayerClient.h: 34 (PlatformCALayerClient): Need to pass the platform layer into platformCALayerShowRepaintCounter() 35 so we can distinguish between calls for tiles, and calls for the tile cache layer itself. 36 * platform/graphics/ca/mac/TileCache.mm: 37 (WebCore::TileCache::shouldShowRepaintCounters): Pass 0 to platformCALayerShowRepaintCounter() to 38 indicate that we're asking about a tile. 39 * platform/graphics/mac/WebLayer.mm: 40 (drawLayerContents): Now we can just rely on platformCALayerShowRepaintCounter() to tell us whether 41 to draw the repaint counter. 42 (-[WebLayer setNeedsDisplayInRect:]): 43 * platform/graphics/mac/WebTiledLayer.mm: 44 (-[WebTiledLayer setNeedsDisplayInRect:]): 45 * rendering/RenderLayerBacking.h: 46 (WebCore::RenderLayerBacking::usingTileCache): 47 (RenderLayerBacking): 48 * rendering/RenderLayerCompositor.cpp: 49 (WebCore::RenderLayerCompositor::documentBackgroundColorDidChange): We can ask the RenderLayerBacking 50 whether it's for the tile cache, rather than going to the GraphicsLayer. 51 * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: 52 (WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerShowRepaintCounter): 53 1 54 2012-10-08 Huang Dongsung <luxtella@company100.net> 2 55 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r130185 r130676 81 81 , m_maintainsPixelAlignment(false) 82 82 , m_appliesPageScale(false) 83 , m_usingTileCache(false)84 83 , m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip) 85 84 , m_contentsOrientation(CompositingCoordinatesTopDown) … … 340 339 } 341 340 341 void GraphicsLayer::getDebugBorderInfo(Color& color, float& width) const 342 { 343 if (drawsContent()) { 344 if (m_usingTiledLayer) { 345 color = Color(255, 128, 0, 128); // tiled layer: orange 346 width = 2; 347 return; 348 } 349 350 color = Color(0, 128, 32, 128); // normal layer: green 351 width = 2; 352 return; 353 } 354 355 if (masksToBounds()) { 356 color = Color(128, 255, 255, 48); // masking layer: pale blue 357 width = 20; 358 return; 359 } 360 361 color = Color(255, 255, 0, 192); // container: yellow 362 width = 2; 363 } 364 342 365 void GraphicsLayer::updateDebugIndicators() 343 366 { 344 if (GraphicsLayer::showDebugBorders()) { 345 if (drawsContent()) { 346 if (m_usingTileCache) // tile cache layer: dark blue 347 setDebugBorder(Color(0, 0, 128, 128), 0.5); 348 else if (m_usingTiledLayer) 349 setDebugBorder(Color(255, 128, 0, 128), 2); // tiled layer: orange 350 else 351 setDebugBorder(Color(0, 128, 32, 128), 2); // normal layer: green 352 } else if (masksToBounds()) { 353 setDebugBorder(Color(128, 255, 255, 48), 20); // masking layer: pale blue 354 } else 355 setDebugBorder(Color(255, 255, 0, 192), 2); // container: yellow 356 } 367 if (!GraphicsLayer::showDebugBorders()) 368 return; 369 370 Color borderColor; 371 float width = 0; 372 getDebugBorderInfo(borderColor, width); 373 setDebugBorder(borderColor, width); 357 374 } 358 375 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r130439 r130676 437 437 438 438 void dumpProperties(TextStream&, int indent, LayerTreeAsTextBehavior) const; 439 virtual void getDebugBorderInfo(Color&, float& width) const; 439 440 440 441 GraphicsLayerClient* m_client; … … 472 473 bool m_maintainsPixelAlignment : 1; 473 474 bool m_appliesPageScale : 1; // Set for the layer which has the page scale applied to it. 474 bool m_usingTileCache : 1;475 475 476 476 GraphicsLayerPaintingPhase m_paintingPhase; -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r130439 r130676 59 59 60 60 virtual bool shouldUseTileCache(const GraphicsLayer*) const { return false; } 61 virtual bool usingTileCache(const GraphicsLayer*) const { return false; }62 61 63 62 // Callback for when hardware-accelerated animation started. -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r130612 r130676 275 275 , m_contentsLayerHasBackgroundColor(false) 276 276 , m_allowTiledLayer(true) 277 , m_isPageTileCacheLayer(false) 277 278 , m_uncommittedChanges(0) 278 279 { … … 280 281 if (client && client->shouldUseTileCache(this)) { 281 282 layerType = PlatformCALayer::LayerTypeTileCacheLayer; 282 m_ usingTileCache= true;283 m_isPageTileCacheLayer = true; 283 284 } 284 285 … … 993 994 } 994 995 996 bool GraphicsLayerCA::platformCALayerShowRepaintCounter(PlatformCALayer* platformLayer) const 997 { 998 // The repaint counters are painted into the TileCache tiles (which have no corresponding platform layer), 999 // so we don't want to overpaint the repaint counter when called with the TileCache's own layer. 1000 if (m_isPageTileCacheLayer && platformLayer) 1001 return false; 1002 1003 return showRepaintCounter(); 1004 } 1005 995 1006 void GraphicsLayerCA::platformCALayerPaintContents(GraphicsContext& context, const IntRect& clip) 996 1007 { … … 1498 1509 void GraphicsLayerCA::updateLayerBackgroundColor() 1499 1510 { 1500 if (m_ layer->layerType() == PlatformCALayer::LayerTypeTileCacheLayer) {1511 if (m_isPageTileCacheLayer) { 1501 1512 m_layer->setBackgroundColor(m_backgroundColor); 1502 1513 return; … … 2392 2403 } 2393 2404 2405 void GraphicsLayerCA::getDebugBorderInfo(Color& color, float& width) const 2406 { 2407 if (m_isPageTileCacheLayer) { 2408 color = Color(0, 0, 128, 128); // tile cache layer: dark blue 2409 width = 0.5; 2410 return; 2411 } 2412 2413 GraphicsLayer::getDebugBorderInfo(color, width); 2414 } 2415 2394 2416 void GraphicsLayerCA::setDebugBorder(const Color& color, float borderWidth) 2395 2417 { … … 2429 2451 bool GraphicsLayerCA::requiresTiledLayer(float pageScaleFactor) const 2430 2452 { 2431 if (!m_drawsContent || !m_allowTiledLayer || m_ layer->layerType() == PlatformCALayer::LayerTypeTileCacheLayer)2453 if (!m_drawsContent || !m_allowTiledLayer || m_isPageTileCacheLayer) 2432 2454 return false; 2433 2455 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r130439 r130676 154 154 virtual void platformCALayerPaintContents(GraphicsContext&, const IntRect& clip); 155 155 virtual bool platformCALayerShowDebugBorders() const { return showDebugBorders(); } 156 virtual bool platformCALayerShowRepaintCounter( ) const { return showRepaintCounter(); }156 virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const; 157 157 virtual int platformCALayerIncrementRepaintCount() { return incrementRepaintCount(); } 158 158 … … 228 228 229 229 virtual void setReplicatedByLayer(GraphicsLayer*); 230 231 virtual void getDebugBorderInfo(Color&, float& width) const; 230 232 231 233 void computePixelAlignment(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase, … … 404 406 bool m_contentsLayerHasBackgroundColor : 1; 405 407 bool m_allowTiledLayer : 1; 408 bool m_isPageTileCacheLayer : 1; 406 409 407 410 RetainPtr<CGImageRef> m_uncorrectedContentsImage; -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h
r127757 r130676 53 53 virtual void platformCALayerPaintContents(GraphicsContext&, const IntRect& inClip) = 0; 54 54 virtual bool platformCALayerShowDebugBorders() const = 0; 55 virtual bool platformCALayerShowRepaintCounter( ) const = 0;55 virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const = 0; 56 56 virtual int platformCALayerIncrementRepaintCount() = 0; 57 57 -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
r130612 r130676 481 481 return false; 482 482 483 return layerContents->platformCALayerShowRepaintCounter( );483 return layerContents->platformCALayerShowRepaintCounter(0); 484 484 } 485 485 -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp
r95901 r130676 97 97 #endif 98 98 99 if (owner()->owner()->platformCALayerShowRepaintCounter( )) {99 if (owner()->owner()->platformCALayerShowRepaintCounter(owner())) { 100 100 FontCachePurgePreventer fontCachePurgePreventer; 101 101 … … 166 166 CACFLayerSetNeedsDisplay(tileAtIndex(i), dirtyRect ? &rect : 0); 167 167 168 if (m_owner->owner() && m_owner->owner()->platformCALayerShowRepaintCounter( )) {168 if (m_owner->owner() && m_owner->owner()->platformCALayerShowRepaintCounter(m_owner)) { 169 169 CGRect layerBounds = m_owner->bounds(); 170 170 CGRect indicatorRect = CGRectMake(layerBounds.origin.x, layerBounds.origin.y, 80, 25); … … 173 173 } else if (owner()->layerType() == PlatformCALayer::LayerTypeWebLayer) { 174 174 if (owner() && owner()->owner()) { 175 if (owner()->owner()->platformCALayerShowRepaintCounter( )) {175 if (owner()->owner()->platformCALayerShowRepaintCounter(owner())) { 176 176 FloatRect layerBounds = owner()->bounds(); 177 177 FloatRect repaintCounterRect = layerBounds; -
trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm
r122670 r130676 110 110 layerContents = platformLayer->owner(); 111 111 ASSERT(layerContents); 112 if ( platformLayer->layerType() != PlatformCALayer::LayerTypeTileCacheLayer && layerContents && layerContents->platformCALayerShowRepaintCounter()) {112 if (layerContents && layerContents->platformCALayerShowRepaintCounter(platformLayer)) { 113 113 bool isTiledLayer = [layer isKindOfClass:[CATiledLayer class]]; 114 114 … … 179 179 [super setNeedsDisplayInRect:dirtyRect]; 180 180 181 if (layerOwner->platformCALayerShowRepaintCounter( )) {181 if (layerOwner->platformCALayerShowRepaintCounter(platformLayer)) { 182 182 CGRect bounds = [self bounds]; 183 183 CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 52, 27); -
trunk/Source/WebCore/platform/graphics/mac/WebTiledLayer.mm
r122145 r130676 85 85 [super setNeedsDisplayInRect:dirtyRect]; 86 86 87 if (layerOwner->platformCALayerShowRepaintCounter( )) {87 if (layerOwner->platformCALayerShowRepaintCounter(platformLayer)) { 88 88 CGRect bounds = [self bounds]; 89 89 CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 52, 27); -
trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
r121053 r130676 102 102 virtual void platformCALayerPaintContents(GraphicsContext&, const IntRect& inClip) { } 103 103 virtual bool platformCALayerShowDebugBorders() const { return false; } 104 virtual bool platformCALayerShowRepaintCounter( ) const { return false; }104 virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; } 105 105 virtual int platformCALayerIncrementRepaintCount() { return 0; } 106 106 -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r130439 r130676 134 134 void positionOverflowControlsLayers(const IntSize& offsetFromRoot); 135 135 136 bool usingTileCache() const { return m_usingTiledCacheLayer; } 137 136 138 // GraphicsLayerClient interface 137 139 virtual bool shouldUseTileCache(const GraphicsLayer*) const; 138 virtual bool usingTileCache(const GraphicsLayer*) const { return m_usingTiledCacheLayer; }139 140 virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime); 140 141 virtual void notifyFlushRequired(const GraphicsLayer*); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r130439 r130676 1936 1936 { 1937 1937 RenderLayerBacking* backing = rootRenderLayer()->backing(); 1938 if (!backing )1938 if (!backing || !backing->usingTileCache()) 1939 1939 return; 1940 1940 1941 1941 GraphicsLayer* graphicsLayer = backing->graphicsLayer(); 1942 if (!graphicsLayer->client()->usingTileCache(graphicsLayer))1943 return;1944 1945 1942 Color backgroundColor = m_renderView->frameView()->documentBackgroundColor(); 1946 1943 if (!backgroundColor.isValid() || backgroundColor.hasAlpha()) -
trunk/Source/WebKit/win/ChangeLog
r130612 r130676 1 2012-10-08 Simon Fraser <simon.fraser@apple.com> 2 3 Some GraphicsLayer cleanup to separate the concepts of using a tile cache, and being the main tile cache layer 4 https://bugs.webkit.org/show_bug.cgi?id=98574 5 6 Reviewed by Dean Jackson. 7 8 GraphicsLayerCA assumed that using a TileCache equated to being the main page tile 9 cache layer, which has some special considerations. Make these two concepts separate 10 to get closer to being able to use TileCaches in place of CATiledLayer. 11 12 * FullscreenVideoController.cpp: 13 (FullscreenVideoController::LayerClient::platformCALayerShowRepaintCounter): 14 1 15 2012-10-07 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 16 -
trunk/Source/WebKit/win/FullscreenVideoController.cpp
r124719 r130676 190 190 virtual void platformCALayerPaintContents(GraphicsContext&, const IntRect& inClip) { } 191 191 virtual bool platformCALayerShowDebugBorders() const { return false; } 192 virtual bool platformCALayerShowRepaintCounter( ) const { return false; }192 virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; } 193 193 virtual int platformCALayerIncrementRepaintCount() { return 0; } 194 194
Note:
See TracChangeset
for help on using the changeset viewer.