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

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 354223002: Add methods to RenderLayer to get at the painting or scrolling graphics layers, if present. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Edited comments. Created 6 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 { 449 {
450 // Project any rects for the current layer 450 // Project any rects for the current layer
451 LayerHitTestRects::const_iterator layerIter = layerRects.find(curLayer); 451 LayerHitTestRects::const_iterator layerIter = layerRects.find(curLayer);
452 if (layerIter != layerRects.end()) { 452 if (layerIter != layerRects.end()) {
453 // Find the enclosing composited layer when it's in another document (fo r non-composited iframes). 453 // Find the enclosing composited layer when it's in another document (fo r non-composited iframes).
454 const RenderLayer* compositedLayer = enclosingCompositedLayer(layerIter- >key); 454 const RenderLayer* compositedLayer = enclosingCompositedLayer(layerIter- >key);
455 if (!compositedLayer) 455 if (!compositedLayer)
456 return; 456 return;
457 457
458 // Find the appropriate GraphicsLayer for the composited RenderLayer. 458 // Find the appropriate GraphicsLayer for the composited RenderLayer.
459 GraphicsLayer* graphicsLayer; 459 GraphicsLayer* graphicsLayer = compositedLayer->graphicsLayerBackingForS crolling();
460 if (compositedLayer->compositingState() == PaintsIntoGroupedBacking) {
461 graphicsLayer = compositedLayer->groupedMapping()->squashingLayer();
462 } else {
463 ASSERT(compositedLayer->hasCompositedLayerMapping());
464 CompositedLayerMappingPtr compositedLayerMapping = compositedLayer-> compositedLayerMapping();
465 graphicsLayer = compositedLayerMapping->scrollingContentsLayer();
466 if (!graphicsLayer)
467 graphicsLayer = compositedLayerMapping->mainGraphicsLayer();
468 }
469 460
470 GraphicsLayerHitTestRects::iterator glIter = graphicsRects.find(graphics Layer); 461 GraphicsLayerHitTestRects::iterator glIter = graphicsRects.find(graphics Layer);
471 Vector<LayoutRect>* glRects; 462 Vector<LayoutRect>* glRects;
472 if (glIter == graphicsRects.end()) 463 if (glIter == graphicsRects.end())
473 glRects = &graphicsRects.add(graphicsLayer, Vector<LayoutRect>()).st oredValue->value; 464 glRects = &graphicsRects.add(graphicsLayer, Vector<LayoutRect>()).st oredValue->value;
474 else 465 else
475 glRects = &glIter->value; 466 glRects = &glIter->value;
476 467
477 // Transform each rect to the co-ordinate space of the graphicsLayer. 468 // Transform each rect to the co-ordinate space of the graphicsLayer.
478 for (size_t i = 0; i < layerIter->value.size(); ++i) { 469 for (size_t i = 0; i < layerIter->value.size(); ++i) {
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 bool frameIsScrollable = frameView && frameView->isScrollable(); 982 bool frameIsScrollable = frameView && frameView->isScrollable();
992 if (frameIsScrollable != m_wasFrameScrollable) 983 if (frameIsScrollable != m_wasFrameScrollable)
993 return true; 984 return true;
994 985
995 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) 986 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0)
996 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); 987 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( );
997 return false; 988 return false;
998 } 989 }
999 990
1000 } // namespace WebCore 991 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698