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

Side by Side Diff: Source/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 208313004: Cache the absolute bounding box rect on RenderLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add fixme Created 6 years, 9 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) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 157
158 RenderGeometryMap& geometryMap() { return m_geometryMap; } 158 RenderGeometryMap& geometryMap() { return m_geometryMap; }
159 159
160 private: 160 private:
161 Vector<OverlapMapContainer> m_overlapStack; 161 Vector<OverlapMapContainer> m_overlapStack;
162 RenderGeometryMap m_geometryMap; 162 RenderGeometryMap m_geometryMap;
163 }; 163 };
164 164
165 struct CompositingRecursionData { 165 struct CompositingRecursionData {
166 CompositingRecursionData(RenderLayer* compAncestor, RenderLayer* mostRecentC ompositedLayer, bool testOverlap) 166 CompositingRecursionData(RenderLayer* compAncestor, RenderLayer* mostRecentC ompositedLayer, RenderLayerCompositor::BoundsUpdateType boundsUpdateType, bool t estOverlap)
167 : m_compositingAncestor(compAncestor) 167 : m_compositingAncestor(compAncestor)
168 , m_mostRecentCompositedLayer(mostRecentCompositedLayer) 168 , m_mostRecentCompositedLayer(mostRecentCompositedLayer)
169 , m_recomputeLayerBoundsUpdateType(boundsUpdateType)
169 , m_subtreeIsCompositing(false) 170 , m_subtreeIsCompositing(false)
170 , m_hasUnisolatedCompositedBlendingDescendant(false) 171 , m_hasUnisolatedCompositedBlendingDescendant(false)
171 , m_testingOverlap(testOverlap) 172 , m_testingOverlap(testOverlap)
172 #ifndef NDEBUG 173 #ifndef NDEBUG
173 , m_depth(0) 174 , m_depth(0)
174 #endif 175 #endif
175 { 176 {
176 } 177 }
177 178
178 CompositingRecursionData(const CompositingRecursionData& other) 179 CompositingRecursionData(const CompositingRecursionData& other)
179 : m_compositingAncestor(other.m_compositingAncestor) 180 : m_compositingAncestor(other.m_compositingAncestor)
180 , m_mostRecentCompositedLayer(other.m_mostRecentCompositedLayer) 181 , m_mostRecentCompositedLayer(other.m_mostRecentCompositedLayer)
182 , m_recomputeLayerBoundsUpdateType(other.m_recomputeLayerBoundsUpdateTyp e)
181 , m_subtreeIsCompositing(other.m_subtreeIsCompositing) 183 , m_subtreeIsCompositing(other.m_subtreeIsCompositing)
182 , m_hasUnisolatedCompositedBlendingDescendant(other.m_hasUnisolatedCompo sitedBlendingDescendant) 184 , m_hasUnisolatedCompositedBlendingDescendant(other.m_hasUnisolatedCompo sitedBlendingDescendant)
183 , m_testingOverlap(other.m_testingOverlap) 185 , m_testingOverlap(other.m_testingOverlap)
184 #ifndef NDEBUG 186 #ifndef NDEBUG
185 , m_depth(other.m_depth + 1) 187 , m_depth(other.m_depth + 1)
186 #endif 188 #endif
187 { 189 {
188 } 190 }
189 191
190 RenderLayer* m_compositingAncestor; 192 RenderLayer* m_compositingAncestor;
191 RenderLayer* m_mostRecentCompositedLayer; // in paint order regardless of hi erarchy. 193 RenderLayer* m_mostRecentCompositedLayer; // in paint order regardless of hi erarchy.
194 RenderLayerCompositor::BoundsUpdateType m_recomputeLayerBoundsUpdateType;
192 bool m_subtreeIsCompositing; 195 bool m_subtreeIsCompositing;
193 bool m_hasUnisolatedCompositedBlendingDescendant; 196 bool m_hasUnisolatedCompositedBlendingDescendant;
194 bool m_testingOverlap; 197 bool m_testingOverlap;
195 #ifndef NDEBUG 198 #ifndef NDEBUG
196 int m_depth; 199 int m_depth;
197 #endif 200 #endif
198 }; 201 };
199 202
200 RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView) 203 RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView)
201 : m_renderView(renderView) 204 : m_renderView(renderView)
202 , m_compositingReasonFinder(renderView) 205 , m_compositingReasonFinder(renderView)
203 , m_hasAcceleratedCompositing(true) 206 , m_hasAcceleratedCompositing(true)
204 , m_showRepaintCounter(false) 207 , m_showRepaintCounter(false)
205 , m_needsToRecomputeCompositingRequirements(false) 208 , m_needsToRecomputeCompositingRequirements(false)
206 , m_needsToUpdateLayerTreeGeometry(false) 209 , m_needsToUpdateLayerTreeGeometry(false)
207 , m_pendingUpdateType(GraphicsLayerUpdater::DoNotForceUpdate) 210 , m_pendingUpdateType(GraphicsLayerUpdater::DoNotForceUpdate)
211 , m_recomputeLayerBoundsUpdateType(RenderLayerCompositor::DoNotForceUpdate)
208 , m_compositing(false) 212 , m_compositing(false)
209 , m_compositingLayersNeedRebuild(false) 213 , m_compositingLayersNeedRebuild(false)
210 , m_forceCompositingMode(false) 214 , m_forceCompositingMode(false)
211 , m_needsUpdateCompositingRequirementsState(false) 215 , m_needsUpdateCompositingRequirementsState(false)
212 , m_isTrackingRepaints(false) 216 , m_isTrackingRepaints(false)
213 , m_rootLayerAttachment(RootLayerUnattached) 217 , m_rootLayerAttachment(RootLayerUnattached)
214 { 218 {
215 } 219 }
216 220
217 RenderLayerCompositor::~RenderLayerCompositor() 221 RenderLayerCompositor::~RenderLayerCompositor()
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 return; 365 return;
362 366
363 switch (updateType) { 367 switch (updateType) {
364 case CompositingUpdateAfterStyleChange: 368 case CompositingUpdateAfterStyleChange:
365 m_needsToRecomputeCompositingRequirements = true; 369 m_needsToRecomputeCompositingRequirements = true;
366 break; 370 break;
367 case CompositingUpdateAfterLayout: 371 case CompositingUpdateAfterLayout:
368 m_needsToRecomputeCompositingRequirements = true; 372 m_needsToRecomputeCompositingRequirements = true;
369 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here. 373 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
370 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate; 374 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
375 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
376 m_recomputeLayerBoundsUpdateType = RenderLayerCompositor::ForceUpdate;
esprehn 2014/03/21 23:28:01 This is the RLC, you don't need the RenderLayerCom
ojan 2014/03/22 00:25:43 Done.
371 break; 377 break;
372 case CompositingUpdateOnScroll: 378 case CompositingUpdateOnScroll:
373 m_needsToRecomputeCompositingRequirements = true; // Overlap can change with scrolling, so need to check for hierarchy updates. 379 m_needsToRecomputeCompositingRequirements = true; // Overlap can change with scrolling, so need to check for hierarchy updates.
374 m_needsToUpdateLayerTreeGeometry = true; 380 m_needsToUpdateLayerTreeGeometry = true;
375 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here. 381 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
376 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate; 382 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
383 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
384 m_recomputeLayerBoundsUpdateType = RenderLayerCompositor::ForceUpdate;
377 break; 385 break;
378 case CompositingUpdateOnCompositedScroll: 386 case CompositingUpdateOnCompositedScroll:
379 m_needsToUpdateLayerTreeGeometry = true; 387 m_needsToUpdateLayerTreeGeometry = true;
380 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here. 388 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
381 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate; 389 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
390 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
391 m_recomputeLayerBoundsUpdateType = RenderLayerCompositor::ForceUpdate;
382 break; 392 break;
383 case CompositingUpdateAfterCanvasContextChange: 393 case CompositingUpdateAfterCanvasContextChange:
384 m_needsToUpdateLayerTreeGeometry = true; 394 m_needsToUpdateLayerTreeGeometry = true;
385 break; 395 break;
386 } 396 }
387 397
388 m_renderView.frameView()->scheduleAnimation(); 398 m_renderView.frameView()->scheduleAnimation();
389 } 399 }
390 400
391 void RenderLayerCompositor::updateCompositingLayers() 401 void RenderLayerCompositor::updateCompositingLayers()
(...skipping 12 matching lines...) Expand all
404 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate); 414 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate);
405 415
406 updateCompositingLayersInternal(); 416 updateCompositingLayersInternal();
407 417
408 lifecycle().advanceTo(DocumentLifecycle::CompositingClean); 418 lifecycle().advanceTo(DocumentLifecycle::CompositingClean);
409 419
410 DocumentAnimations::startPendingAnimations(m_renderView.document()); 420 DocumentAnimations::startPendingAnimations(m_renderView.document());
411 ASSERT(m_renderView.document().lifecycle().state() == DocumentLifecycle::Com positingClean); 421 ASSERT(m_renderView.document().lifecycle().state() == DocumentLifecycle::Com positingClean);
412 } 422 }
413 423
424 static void assertNeedsRecomputeBoundsBitsCleared(RenderLayer* updateRoot)
425 {
426 ASSERT(!updateRoot->needsToRecomputeBounds());
427 for (RenderLayer* child = updateRoot->firstChild(); child; child = child->ne xtSibling())
428 assertNeedsRecomputeBoundsBitsCleared(child);
429 }
430
414 void RenderLayerCompositor::updateCompositingLayersInternal() 431 void RenderLayerCompositor::updateCompositingLayersInternal()
415 { 432 {
416 if (isMainFrame() && m_renderView.frameView()) 433 if (isMainFrame() && m_renderView.frameView())
417 finishCompositingUpdateForFrameTree(&m_renderView.frameView()->frame()); 434 finishCompositingUpdateForFrameTree(&m_renderView.frameView()->frame());
418 435
419 if (m_forceCompositingMode && !m_compositing) 436 if (m_forceCompositingMode && !m_compositing)
420 enableCompositingMode(true); 437 enableCompositingMode(true);
421 438
422 if (!m_needsToRecomputeCompositingRequirements && !m_compositing) 439 if (!m_needsToRecomputeCompositingRequirements && !m_compositing)
423 return; 440 return;
(...skipping 12 matching lines...) Expand all
436 m_compositingLayersNeedRebuild = false; 453 m_compositingLayersNeedRebuild = false;
437 m_needsToUpdateLayerTreeGeometry = false; 454 m_needsToUpdateLayerTreeGeometry = false;
438 m_needsToRecomputeCompositingRequirements = false; 455 m_needsToRecomputeCompositingRequirements = false;
439 m_pendingUpdateType = GraphicsLayerUpdater::DoNotForceUpdate; 456 m_pendingUpdateType = GraphicsLayerUpdater::DoNotForceUpdate;
440 457
441 RenderLayer* updateRoot = rootRenderLayer(); 458 RenderLayer* updateRoot = rootRenderLayer();
442 459
443 if (needCompositingRequirementsUpdate) { 460 if (needCompositingRequirementsUpdate) {
444 // Go through the layers in presentation order, so that we can compute w hich RenderLayers need compositing layers. 461 // Go through the layers in presentation order, so that we can compute w hich RenderLayers need compositing layers.
445 // FIXME: we could maybe do this and the hierarchy udpate in one pass, b ut the parenting logic would be more complex. 462 // FIXME: we could maybe do this and the hierarchy udpate in one pass, b ut the parenting logic would be more complex.
446 CompositingRecursionData recursionData(updateRoot, 0, true); 463 CompositingRecursionData recursionData(updateRoot, 0, m_recomputeLayerBo undsUpdateType, true);
464 m_recomputeLayerBoundsUpdateType = RenderLayerCompositor::DoNotForceUpda te;
447 bool layersChanged = false; 465 bool layersChanged = false;
448 bool saw3DTransform = false; 466 bool saw3DTransform = false;
449 { 467 {
450 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::computeCompo sitingRequirements"); 468 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::computeCompo sitingRequirements");
451 OverlapMap overlapTestRequestMap; 469 OverlapMap overlapTestRequestMap;
452 470
453 // FIXME: Passing these unclippedDescendants down and keeping track 471 // FIXME: Passing these unclippedDescendants down and keeping track
454 // of them dynamically, we are requiring a full tree walk. This 472 // of them dynamically, we are requiring a full tree walk. This
455 // should be removed as soon as proper overlap testing based on 473 // should be removed as soon as proper overlap testing based on
456 // scrolling and animation bounds is implemented (crbug.com/252472). 474 // scrolling and animation bounds is implemented (crbug.com/252472).
457 Vector<RenderLayer*> unclippedDescendants; 475 Vector<RenderLayer*> unclippedDescendants;
458 IntRect absoluteDecendantBoundingBox; 476 IntRect absoluteDecendantBoundingBox;
459 computeCompositingRequirements(0, updateRoot, &overlapTestRequestMap , recursionData, saw3DTransform, unclippedDescendants, absoluteDecendantBounding Box); 477 computeCompositingRequirements(0, updateRoot, &overlapTestRequestMap , recursionData, saw3DTransform, unclippedDescendants, absoluteDecendantBounding Box);
478 #if !ASSERT_DISABLED
479 assertNeedsRecomputeBoundsBitsCleared(updateRoot);
480 #endif
460 } 481 }
461 482
462 { 483 {
463 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::assignLayers ToBackings"); 484 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::assignLayers ToBackings");
464 assignLayersToBackings(updateRoot, layersChanged); 485 assignLayersToBackings(updateRoot, layersChanged);
465 } 486 }
466 487
467 { 488 {
468 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateHasVis ibleNonLayerContentLoop"); 489 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateHasVis ibleNonLayerContentLoop");
469 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView.f rameView()->scrollableAreas(); 490 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView.f rameView()->scrollableAreas();
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 // FIXME: This is called from within RenderLayer::removeChild, which is called from RenderObject::RemoveChild. 876 // FIXME: This is called from within RenderLayer::removeChild, which is called from RenderObject::RemoveChild.
856 // There's no guarantee that compositor state is up to date. 877 // There's no guarantee that compositor state is up to date.
857 DisableCompositingQueryAsserts disabler; 878 DisableCompositingQueryAsserts disabler;
858 repaintInCompositedAncestor(child, child->compositedLayerMapping()->comp ositedBounds()); 879 repaintInCompositedAncestor(child, child->compositedLayerMapping()->comp ositedBounds());
859 } 880 }
860 881
861 setCompositingParent(child, 0); 882 setCompositingParent(child, 0);
862 setCompositingLayersNeedRebuild(); 883 setCompositingLayersNeedRebuild();
863 } 884 }
864 885
865 void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer* layer, IntRect& layerBounds) 886 void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer* layer, const IntRect& layerBounds)
866 { 887 {
867 if (layer->isRootLayer()) 888 if (layer->isRootLayer())
868 return; 889 return;
869 890
870 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C lipRectsContext(rootRenderLayer(), AbsoluteClipRects)).rect()); 891 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C lipRectsContext(rootRenderLayer(), AbsoluteClipRects)).rect());
871 clipRect.intersect(layerBounds); 892 clipRect.intersect(layerBounds);
872 overlapMap.add(clipRect); 893 overlapMap.add(clipRect);
873 } 894 }
874 895
875 // Recurse through the layers in z-index and overflow order (which is equivalen t to painting order) 896 // Recurse through the layers in z-index and overflow order (which is equivalen t to painting order)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 // indices remain valid. 954 // indices remain valid.
934 for (size_t i = 0; i < unclippedDescendantsToRemove.size(); i++) 955 for (size_t i = 0; i < unclippedDescendantsToRemove.size(); i++)
935 unclippedDescendants.remove(unclippedDescendantsToRemove.at(unclippe dDescendantsToRemove.size() - i - 1)); 956 unclippedDescendants.remove(unclippedDescendantsToRemove.at(unclippe dDescendantsToRemove.size() - i - 1));
936 957
937 if (reasonsToComposite & CompositingReasonOutOfFlowClipping) 958 if (reasonsToComposite & CompositingReasonOutOfFlowClipping)
938 unclippedDescendants.append(layer); 959 unclippedDescendants.append(layer);
939 } 960 }
940 961
941 IntRect absBounds; 962 IntRect absBounds;
942 if (overlapMap && !layer->isRootLayer()) { 963 if (overlapMap && !layer->isRootLayer()) {
943 absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect(laye r->overlapBounds())); 964 if (currentRecursionData.m_recomputeLayerBoundsUpdateType == RenderLayer Compositor::ForceUpdate || layer->needsToRecomputeBounds()) {
965 // FIXME: If the absolute bounds didn't change, then we don't need t o ForceUpdate descendant RenderLayers.
966 currentRecursionData.m_recomputeLayerBoundsUpdateType = RenderLayerC ompositor::ForceUpdate;
967 absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect( layer->overlapBounds()));
968 layer->setAbsoluteBoundingBoxForOverlap(absBounds);
969 } else {
970 absBounds = layer->cachedAbsoluteBoundingBox();
971 }
944 // Setting the absBounds to 1x1 instead of 0x0 makes very little sense, 972 // Setting the absBounds to 1x1 instead of 0x0 makes very little sense,
945 // but removing this code will make JSGameBench sad. 973 // but removing this code will make JSGameBench sad.
946 // See https://codereview.chromium.org/13912020/ 974 // See https://codereview.chromium.org/13912020/
947 if (absBounds.isEmpty()) 975 if (absBounds.isEmpty())
948 absBounds.setSize(IntSize(1, 1)); 976 absBounds.setSize(IntSize(1, 1));
977 } else {
978 layer->clearNeedsToRecomputeBounds();
esprehn 2014/03/21 23:28:01 Can we just unconditionally call this?
ojan 2014/03/22 00:25:43 I changed assertNeedsRecomputeBoundsBitsCleared to
949 } 979 }
980
950 absoluteDecendantBoundingBox = absBounds; 981 absoluteDecendantBoundingBox = absBounds;
951 982
952 if (overlapMap && currentRecursionData.m_testingOverlap && !requiresComposit ingOrSquashing(directReasons)) 983 if (overlapMap && currentRecursionData.m_testingOverlap && !requiresComposit ingOrSquashing(directReasons))
953 overlapCompositingReason = overlapMap->overlapsLayers(absBounds) ? Compo sitingReasonOverlap : CompositingReasonNone; 984 overlapCompositingReason = overlapMap->overlapsLayers(absBounds) ? Compo sitingReasonOverlap : CompositingReasonNone;
954 985
955 reasonsToComposite |= overlapCompositingReason; 986 reasonsToComposite |= overlapCompositingReason;
956 987
957 // The children of this layer don't need to composite, unless there is 988 // The children of this layer don't need to composite, unless there is
958 // a compositing layer among them, so start by inheriting the compositing 989 // a compositing layer among them, so start by inheriting the compositing
959 // ancestor with m_subtreeIsCompositing set to false. 990 // ancestor with m_subtreeIsCompositing set to false.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 if (overlapMap) 1033 if (overlapMap)
1003 overlapMap->beginNewOverlapTestingContext(); 1034 overlapMap->beginNewOverlapTestingContext();
1004 willBeCompositedOrSquashed = true; 1035 willBeCompositedOrSquashed = true;
1005 willHaveForegroundLayer = true; 1036 willHaveForegroundLayer = true;
1006 1037
1007 // FIXME: temporary solution for the first negative z-index composited child: 1038 // FIXME: temporary solution for the first negative z-index composited child:
1008 // re-compute the absBounds for the child so that we can add the 1039 // re-compute the absBounds for the child so that we can add the
1009 // negative z-index child's bounds to the new overlap context. 1040 // negative z-index child's bounds to the new overlap context.
1010 if (overlapMap) { 1041 if (overlapMap) {
1011 overlapMap->geometryMap().pushMappingsToAncestor(curNode ->layer(), layer); 1042 overlapMap->geometryMap().pushMappingsToAncestor(curNode ->layer(), layer);
1012 IntRect childAbsBounds = enclosingIntRect(overlapMap->ge ometryMap().absoluteRect(curNode->layer()->overlapBounds())); 1043 // The above call to computeCompositinRequirements will have already updated this layer's absolute bounding box.
1013 overlapMap->beginNewOverlapTestingContext(); 1044 overlapMap->beginNewOverlapTestingContext();
1014 addToOverlapMap(*overlapMap, curNode->layer(), childAbsB ounds); 1045 ASSERT(!curNode->layer()->needsToRecomputeBounds());
1046 addToOverlapMap(*overlapMap, curNode->layer(), curNode-> layer()->cachedAbsoluteBoundingBox());
1015 overlapMap->finishCurrentOverlapTestingContext(); 1047 overlapMap->finishCurrentOverlapTestingContext();
1016 overlapMap->geometryMap().popMappingsToAncestor(layer); 1048 overlapMap->geometryMap().popMappingsToAncestor(layer);
1017 } 1049 }
1018 } 1050 }
1019 } 1051 }
1020 } 1052 }
1021 } 1053 }
1022 1054
1023 if (overlapMap && willHaveForegroundLayer) { 1055 if (overlapMap && willHaveForegroundLayer) {
1024 ASSERT(willBeCompositedOrSquashed); 1056 ASSERT(willBeCompositedOrSquashed);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 // second-from-top context of the stack. 1111 // second-from-top context of the stack.
1080 overlapMap->beginNewOverlapTestingContext(); 1112 overlapMap->beginNewOverlapTestingContext();
1081 addToOverlapMap(*overlapMap, layer, absoluteDecendantBoundingBox); 1113 addToOverlapMap(*overlapMap, layer, absoluteDecendantBoundingBox);
1082 } 1114 }
1083 willBeCompositedOrSquashed = true; 1115 willBeCompositedOrSquashed = true;
1084 } 1116 }
1085 1117
1086 // If the original layer is composited, the reflection needs to be, too. 1118 // If the original layer is composited, the reflection needs to be, too.
1087 if (layer->reflectionInfo()) { 1119 if (layer->reflectionInfo()) {
1088 // FIXME: Shouldn't we call computeCompositingRequirements to handle a r eflection overlapping with another renderer? 1120 // FIXME: Shouldn't we call computeCompositingRequirements to handle a r eflection overlapping with another renderer?
1121 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflectionLayer( );
1122 reflectionLayer->clearNeedsToRecomputeBounds();
1089 CompositingReasons reflectionCompositingReason = willBeCompositedOrSquas hed ? CompositingReasonReflectionOfCompositedParent : CompositingReasonNone; 1123 CompositingReasons reflectionCompositingReason = willBeCompositedOrSquas hed ? CompositingReasonReflectionOfCompositedParent : CompositingReasonNone;
1090 layer->reflectionInfo()->reflectionLayer()->setCompositingReasons(layer- >reflectionInfo()->reflectionLayer()->compositingReasons() | reflectionCompositi ngReason); 1124 reflectionLayer->setCompositingReasons(reflectionLayer->compositingReaso ns() | reflectionCompositingReason);
1091 } 1125 }
1092 1126
1093 // Subsequent layers in the parent's stacking context may also need to compo site. 1127 // Subsequent layers in the parent's stacking context may also need to compo site.
1094 if (childRecursionData.m_subtreeIsCompositing) 1128 if (childRecursionData.m_subtreeIsCompositing)
1095 currentRecursionData.m_subtreeIsCompositing = true; 1129 currentRecursionData.m_subtreeIsCompositing = true;
1096 1130
1097 if (willBeCompositedOrSquashed && layer->blendInfo().hasBlendMode()) 1131 if (willBeCompositedOrSquashed && layer->blendInfo().hasBlendMode())
1098 currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = true; 1132 currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = true;
1099 1133
1100 // Set the flag to say that this SC has compositing children. 1134 // Set the flag to say that this SC has compositing children.
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 } else if (graphicsLayer == m_scrollLayer.get()) { 2274 } else if (graphicsLayer == m_scrollLayer.get()) {
2241 name = "LocalFrame Scrolling Layer"; 2275 name = "LocalFrame Scrolling Layer";
2242 } else { 2276 } else {
2243 ASSERT_NOT_REACHED(); 2277 ASSERT_NOT_REACHED();
2244 } 2278 }
2245 2279
2246 return name; 2280 return name;
2247 } 2281 }
2248 2282
2249 } // namespace WebCore 2283 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698