Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 LayoutPoint graphicsLayerOffset = compositedLayerMapping->composite dBounds().location(); | |
|
Ian Vollick
2014/04/23 20:18:38
It sounds like you want exactly CompositedLayerMap
Zeeshan Qureshi
2014/04/24 02:32:40
Excellent idea, done.
| |
| 456 extraOffset = LayoutSize(-graphicsLayerOffset.x(), -graphicsLayerOff set.y()); | |
| 450 // If the layer is using composited scrolling, then it's the content s that these | 457 // If the layer is using composited scrolling, then it's the content s that these |
| 451 // rects apply to. | 458 // rects apply to. |
| 452 graphicsLayer = compositedLayerMapping->scrollingContentsLayer(); | 459 graphicsLayer = compositedLayerMapping->scrollingContentsLayer(); |
| 453 if (!graphicsLayer) | 460 if (!graphicsLayer) |
| 454 graphicsLayer = compositedLayerMapping->mainGraphicsLayer(); | 461 graphicsLayer = compositedLayerMapping->mainGraphicsLayer(); |
| 455 } | 462 } |
| 456 | 463 |
| 457 GraphicsLayerHitTestRects::iterator glIter = graphicsRects.find(graphics Layer); | 464 GraphicsLayerHitTestRects::iterator glIter = graphicsRects.find(graphics Layer); |
| 458 Vector<LayoutRect>* glRects; | 465 Vector<LayoutRect>* glRects; |
| 459 if (glIter == graphicsRects.end()) | 466 if (glIter == graphicsRects.end()) |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 965 bool frameIsScrollable = frameView && frameView->isScrollable(); | 972 bool frameIsScrollable = frameView && frameView->isScrollable(); |
| 966 if (frameIsScrollable != m_wasFrameScrollable) | 973 if (frameIsScrollable != m_wasFrameScrollable) |
| 967 return true; | 974 return true; |
| 968 | 975 |
| 969 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) | 976 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) |
| 970 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); | 977 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); |
| 971 return false; | 978 return false; |
| 972 } | 979 } |
| 973 | 980 |
| 974 } // namespace WebCore | 981 } // namespace WebCore |
| OLD | NEW |