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

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

Issue 250193002: Offset rects by origin when projecting from composited to graphics layer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update test expectations Created 6 years, 8 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
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 // Find the appropriate GraphicsLayer for the composited RenderLayer. 441 // Find the appropriate GraphicsLayer for the composited RenderLayer.
442 GraphicsLayer* graphicsLayer; 442 GraphicsLayer* graphicsLayer;
443 LayoutSize extraOffset; 443 LayoutSize extraOffset;
444 if (compositedLayer->compositingState() == PaintsIntoGroupedBacking) { 444 if (compositedLayer->compositingState() == PaintsIntoGroupedBacking) {
445 graphicsLayer = compositedLayer->groupedMapping()->squashingLayer(); 445 graphicsLayer = compositedLayer->groupedMapping()->squashingLayer();
446 extraOffset = -compositedLayer->offsetFromSquashingLayerOrigin(); 446 extraOffset = -compositedLayer->offsetFromSquashingLayerOrigin();
447 } else { 447 } else {
448 ASSERT(compositedLayer->hasCompositedLayerMapping()); 448 ASSERT(compositedLayer->hasCompositedLayerMapping());
449 CompositedLayerMappingPtr compositedLayerMapping = compositedLayer-> compositedLayerMapping(); 449 CompositedLayerMappingPtr compositedLayerMapping = compositedLayer-> compositedLayerMapping();
450 // The origin for the graphics layer does not have to be the same
451 // as the composited layer (e.g. when a child layer has negative
452 // offset and paints into this layer), so when projecting rects to
453 // graphics layer space they have to be offset by the origin for
454 // the composited layer.
455 extraOffset = compositedLayerMapping->contentOffsetInCompositingLaye r();
450 // If the layer is using composited scrolling, then it's the content s that these 456 // If the layer is using composited scrolling, then it's the content s that these
451 // rects apply to. 457 // rects apply to.
452 graphicsLayer = compositedLayerMapping->scrollingContentsLayer(); 458 graphicsLayer = compositedLayerMapping->scrollingContentsLayer();
453 if (!graphicsLayer) 459 if (!graphicsLayer)
454 graphicsLayer = compositedLayerMapping->mainGraphicsLayer(); 460 graphicsLayer = compositedLayerMapping->mainGraphicsLayer();
455 } 461 }
456 462
457 GraphicsLayerHitTestRects::iterator glIter = graphicsRects.find(graphics Layer); 463 GraphicsLayerHitTestRects::iterator glIter = graphicsRects.find(graphics Layer);
458 Vector<LayoutRect>* glRects; 464 Vector<LayoutRect>* glRects;
459 if (glIter == graphicsRects.end()) 465 if (glIter == graphicsRects.end())
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 bool frameIsScrollable = frameView && frameView->isScrollable(); 971 bool frameIsScrollable = frameView && frameView->isScrollable();
966 if (frameIsScrollable != m_wasFrameScrollable) 972 if (frameIsScrollable != m_wasFrameScrollable)
967 return true; 973 return true;
968 974
969 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) 975 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0)
970 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); 976 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( );
971 return false; 977 return false;
972 } 978 }
973 979
974 } // namespace WebCore 980 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698