Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1341)

Unified Diff: Source/core/testing/Internals.cpp

Issue 58543002: Use a boolean hasCompositedLayerMapping() accessor instead of the pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Uses a wrapper around the pointer that can't be coerced to a boolean. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.cpp ('k') | Source/web/LinkHighlight.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index bad025393980c4db3519338174a074dce763b326..b454f70a7c5479b00895c0c2ea08949f088e5df0 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -1270,7 +1270,9 @@ unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& e
static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, GraphicsLayer* graphicsLayer, String* layerType)
{
- if (searchRoot->compositedLayerMapping() && graphicsLayer == searchRoot->compositedLayerMapping()->mainGraphicsLayer())
+ // Note, we only want to return the RenderLayer that _truly_ owns the GraphicsLayer, not just the
+ // first RenderLayer we encounter that paints into it.
+ if (searchRoot->compositingState() == PaintsIntoOwnBacking && graphicsLayer == searchRoot->compositedLayerMapping()->mainGraphicsLayer())
shawnsingh 2013/11/12 21:12:50 Option 1: maybe we should keep this as hasComposit
return searchRoot;
GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot->scrollableArea()->layerForScrolling() : 0;
@@ -1753,7 +1755,7 @@ String Internals::elementLayerTreeAsText(Element* element, unsigned flags, Excep
RenderLayer* layer = toRenderBox(renderer)->layer();
if (!layer
- || !layer->compositedLayerMapping()
+ || !layer->hasCompositedLayerMapping()
|| !layer->compositedLayerMapping()->mainGraphicsLayer()) {
// Don't raise exception in these cases which may be normally used in tests.
return String();
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.cpp ('k') | Source/web/LinkHighlight.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698