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

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: remove extre line break 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
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | no next file » | 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) 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(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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 return; 366 return;
363 367
364 switch (updateType) { 368 switch (updateType) {
365 case CompositingUpdateAfterStyleChange: 369 case CompositingUpdateAfterStyleChange:
366 m_needsToRecomputeCompositingRequirements = true; 370 m_needsToRecomputeCompositingRequirements = true;
367 break; 371 break;
368 case CompositingUpdateAfterLayout: 372 case CompositingUpdateAfterLayout:
369 m_needsToRecomputeCompositingRequirements = true; 373 m_needsToRecomputeCompositingRequirements = true;
370 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here. 374 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
371 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate; 375 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
376 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
377 m_recomputeLayerBoundsUpdateType = ForceUpdate;
372 break; 378 break;
373 case CompositingUpdateOnScroll: 379 case CompositingUpdateOnScroll:
374 m_needsToRecomputeCompositingRequirements = true; // Overlap can change with scrolling, so need to check for hierarchy updates. 380 m_needsToRecomputeCompositingRequirements = true; // Overlap can change with scrolling, so need to check for hierarchy updates.
375 m_needsToUpdateLayerTreeGeometry = true; 381 m_needsToUpdateLayerTreeGeometry = true;
376 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here. 382 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
377 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate; 383 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
384 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
385 m_recomputeLayerBoundsUpdateType = ForceUpdate;
378 break; 386 break;
379 case CompositingUpdateOnCompositedScroll: 387 case CompositingUpdateOnCompositedScroll:
380 m_needsToUpdateLayerTreeGeometry = true; 388 m_needsToUpdateLayerTreeGeometry = true;
381 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here. 389 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
382 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate; 390 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
391 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
392 m_recomputeLayerBoundsUpdateType = ForceUpdate;
383 break; 393 break;
384 case CompositingUpdateAfterCanvasContextChange: 394 case CompositingUpdateAfterCanvasContextChange:
385 m_needsToUpdateLayerTreeGeometry = true; 395 m_needsToUpdateLayerTreeGeometry = true;
386 break; 396 break;
387 } 397 }
388 398
389 page()->animator().scheduleVisualUpdate(); 399 page()->animator().scheduleVisualUpdate();
390 } 400 }
391 401
392 static void clearAncestorDependentPropertyCacheRecursive(RenderLayer* layer) 402 static void clearAncestorDependentPropertyCacheRecursive(RenderLayer* layer)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 445 }
436 } 446 }
437 } 447 }
438 } 448 }
439 449
440 bool RenderLayerCompositor::hasUnresolvedDirtyBits() 450 bool RenderLayerCompositor::hasUnresolvedDirtyBits()
441 { 451 {
442 return m_needsToRecomputeCompositingRequirements || m_compositingLayersNeedR ebuild || m_needsToUpdateLayerTreeGeometry || m_needsUpdateCompositingRequiremen tsState || m_pendingUpdateType != GraphicsLayerUpdater::DoNotForceUpdate; 452 return m_needsToRecomputeCompositingRequirements || m_compositingLayersNeedR ebuild || m_needsToUpdateLayerTreeGeometry || m_needsUpdateCompositingRequiremen tsState || m_pendingUpdateType != GraphicsLayerUpdater::DoNotForceUpdate;
443 } 453 }
444 454
455 static void assertNeedsRecomputeBoundsBitsCleared(RenderLayer* updateRoot)
456 {
457 // We don't do overlap testing on the root layer, so we never compute its ab solute bounding box.
458 ASSERT(updateRoot->isRootLayer() || !updateRoot->needsToRecomputeBounds());
459 for (RenderLayer* child = updateRoot->firstChild(); child; child = child->ne xtSibling())
460 assertNeedsRecomputeBoundsBitsCleared(child);
461 }
462
445 void RenderLayerCompositor::updateCompositingLayersInternal() 463 void RenderLayerCompositor::updateCompositingLayersInternal()
446 { 464 {
447 if (isMainFrame() && m_renderView.frameView()) 465 if (isMainFrame() && m_renderView.frameView())
448 finishCompositingUpdateForFrameTree(&m_renderView.frameView()->frame()); 466 finishCompositingUpdateForFrameTree(&m_renderView.frameView()->frame());
449 467
450 if (m_forceCompositingMode && !m_compositing) 468 if (m_forceCompositingMode && !m_compositing)
451 enableCompositingMode(true); 469 enableCompositingMode(true);
452 470
453 if (!m_needsToRecomputeCompositingRequirements && !m_compositing) 471 if (!m_needsToRecomputeCompositingRequirements && !m_compositing)
454 return; 472 return;
(...skipping 12 matching lines...) Expand all
467 m_compositingLayersNeedRebuild = false; 485 m_compositingLayersNeedRebuild = false;
468 m_needsToUpdateLayerTreeGeometry = false; 486 m_needsToUpdateLayerTreeGeometry = false;
469 m_needsToRecomputeCompositingRequirements = false; 487 m_needsToRecomputeCompositingRequirements = false;
470 m_pendingUpdateType = GraphicsLayerUpdater::DoNotForceUpdate; 488 m_pendingUpdateType = GraphicsLayerUpdater::DoNotForceUpdate;
471 489
472 RenderLayer* updateRoot = rootRenderLayer(); 490 RenderLayer* updateRoot = rootRenderLayer();
473 491
474 if (needCompositingRequirementsUpdate) { 492 if (needCompositingRequirementsUpdate) {
475 // Go through the layers in presentation order, so that we can compute w hich RenderLayers need compositing layers. 493 // Go through the layers in presentation order, so that we can compute w hich RenderLayers need compositing layers.
476 // FIXME: we could maybe do this and the hierarchy udpate in one pass, b ut the parenting logic would be more complex. 494 // FIXME: we could maybe do this and the hierarchy udpate in one pass, b ut the parenting logic would be more complex.
477 CompositingRecursionData recursionData(updateRoot, 0, true); 495 CompositingRecursionData recursionData(updateRoot, 0, m_recomputeLayerBo undsUpdateType, true);
496 m_recomputeLayerBoundsUpdateType = DoNotForceUpdate;
478 bool layersChanged = false; 497 bool layersChanged = false;
479 bool saw3DTransform = false; 498 bool saw3DTransform = false;
480 { 499 {
481 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::computeCompo sitingRequirements"); 500 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::computeCompo sitingRequirements");
482 OverlapMap overlapTestRequestMap; 501 OverlapMap overlapTestRequestMap;
483 502
484 // FIXME: Passing these unclippedDescendants down and keeping track 503 // FIXME: Passing these unclippedDescendants down and keeping track
485 // of them dynamically, we are requiring a full tree walk. This 504 // of them dynamically, we are requiring a full tree walk. This
486 // should be removed as soon as proper overlap testing based on 505 // should be removed as soon as proper overlap testing based on
487 // scrolling and animation bounds is implemented (crbug.com/252472). 506 // scrolling and animation bounds is implemented (crbug.com/252472).
488 Vector<RenderLayer*> unclippedDescendants; 507 Vector<RenderLayer*> unclippedDescendants;
489 IntRect absoluteDecendantBoundingBox; 508 IntRect absoluteDecendantBoundingBox;
490 computeCompositingRequirements(0, updateRoot, &overlapTestRequestMap , recursionData, saw3DTransform, unclippedDescendants, absoluteDecendantBounding Box); 509 computeCompositingRequirements(0, updateRoot, &overlapTestRequestMap , recursionData, saw3DTransform, unclippedDescendants, absoluteDecendantBounding Box);
510 #if !ASSERT_DISABLED
511 assertNeedsRecomputeBoundsBitsCleared(updateRoot);
512 #endif
491 } 513 }
492 514
493 { 515 {
494 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::assignLayers ToBackings"); 516 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::assignLayers ToBackings");
495 assignLayersToBackings(updateRoot, layersChanged); 517 assignLayersToBackings(updateRoot, layersChanged);
496 } 518 }
497 519
498 { 520 {
499 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateHasVis ibleNonLayerContentLoop"); 521 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateHasVis ibleNonLayerContentLoop");
500 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView.f rameView()->scrollableAreas(); 522 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView.f rameView()->scrollableAreas();
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 // FIXME: This is called from within RenderLayer::removeChild, which is called from RenderObject::RemoveChild. 908 // FIXME: This is called from within RenderLayer::removeChild, which is called from RenderObject::RemoveChild.
887 // There's no guarantee that compositor state is up to date. 909 // There's no guarantee that compositor state is up to date.
888 DisableCompositingQueryAsserts disabler; 910 DisableCompositingQueryAsserts disabler;
889 repaintInCompositedAncestor(child, child->compositedLayerMapping()->comp ositedBounds()); 911 repaintInCompositedAncestor(child, child->compositedLayerMapping()->comp ositedBounds());
890 } 912 }
891 913
892 setCompositingParent(child, 0); 914 setCompositingParent(child, 0);
893 setCompositingLayersNeedRebuild(); 915 setCompositingLayersNeedRebuild();
894 } 916 }
895 917
896 void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer* layer, IntRect& layerBounds) 918 void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer* layer, const IntRect& layerBounds)
897 { 919 {
898 if (layer->isRootLayer()) 920 if (layer->isRootLayer())
899 return; 921 return;
900 922
901 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C lipRectsContext(rootRenderLayer(), AbsoluteClipRects)).rect()); 923 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C lipRectsContext(rootRenderLayer(), AbsoluteClipRects)).rect());
902 clipRect.intersect(layerBounds); 924 clipRect.intersect(layerBounds);
903 overlapMap.add(clipRect); 925 overlapMap.add(clipRect);
904 } 926 }
905 927
906 // Recurse through the layers in z-index and overflow order (which is equivalen t to painting order) 928 // 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
964 // indices remain valid. 986 // indices remain valid.
965 for (size_t i = 0; i < unclippedDescendantsToRemove.size(); i++) 987 for (size_t i = 0; i < unclippedDescendantsToRemove.size(); i++)
966 unclippedDescendants.remove(unclippedDescendantsToRemove.at(unclippe dDescendantsToRemove.size() - i - 1)); 988 unclippedDescendants.remove(unclippedDescendantsToRemove.at(unclippe dDescendantsToRemove.size() - i - 1));
967 989
968 if (reasonsToComposite & CompositingReasonOutOfFlowClipping) 990 if (reasonsToComposite & CompositingReasonOutOfFlowClipping)
969 unclippedDescendants.append(layer); 991 unclippedDescendants.append(layer);
970 } 992 }
971 993
972 IntRect absBounds; 994 IntRect absBounds;
973 if (overlapMap && !layer->isRootLayer()) { 995 if (overlapMap && !layer->isRootLayer()) {
974 absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect(laye r->overlapBounds())); 996 if (currentRecursionData.m_recomputeLayerBoundsUpdateType == ForceUpdate || layer->needsToRecomputeBounds()) {
997 // FIXME: If the absolute bounds didn't change, then we don't need t o ForceUpdate descendant RenderLayers.
998 currentRecursionData.m_recomputeLayerBoundsUpdateType = ForceUpdate;
999 absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect( layer->overlapBounds()));
1000 layer->setAbsoluteBoundingBox(absBounds);
1001 } else {
1002 absBounds = layer->absoluteBoundingBox();
1003 }
975 // Setting the absBounds to 1x1 instead of 0x0 makes very little sense, 1004 // Setting the absBounds to 1x1 instead of 0x0 makes very little sense,
976 // but removing this code will make JSGameBench sad. 1005 // but removing this code will make JSGameBench sad.
977 // See https://codereview.chromium.org/13912020/ 1006 // See https://codereview.chromium.org/13912020/
978 if (absBounds.isEmpty()) 1007 if (absBounds.isEmpty())
979 absBounds.setSize(IntSize(1, 1)); 1008 absBounds.setSize(IntSize(1, 1));
980 } 1009 }
1010
981 absoluteDecendantBoundingBox = absBounds; 1011 absoluteDecendantBoundingBox = absBounds;
982 1012
983 if (overlapMap && currentRecursionData.m_testingOverlap && !requiresComposit ingOrSquashing(directReasons)) 1013 if (overlapMap && currentRecursionData.m_testingOverlap && !requiresComposit ingOrSquashing(directReasons))
984 overlapCompositingReason = overlapMap->overlapsLayers(absBounds) ? Compo sitingReasonOverlap : CompositingReasonNone; 1014 overlapCompositingReason = overlapMap->overlapsLayers(absBounds) ? Compo sitingReasonOverlap : CompositingReasonNone;
985 1015
986 reasonsToComposite |= overlapCompositingReason; 1016 reasonsToComposite |= overlapCompositingReason;
987 1017
988 // The children of this layer don't need to composite, unless there is 1018 // The children of this layer don't need to composite, unless there is
989 // a compositing layer among them, so start by inheriting the compositing 1019 // a compositing layer among them, so start by inheriting the compositing
990 // ancestor with m_subtreeIsCompositing set to false. 1020 // ancestor with m_subtreeIsCompositing set to false.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 if (overlapMap) 1063 if (overlapMap)
1034 overlapMap->beginNewOverlapTestingContext(); 1064 overlapMap->beginNewOverlapTestingContext();
1035 willBeCompositedOrSquashed = true; 1065 willBeCompositedOrSquashed = true;
1036 willHaveForegroundLayer = true; 1066 willHaveForegroundLayer = true;
1037 1067
1038 // FIXME: temporary solution for the first negative z-index composited child: 1068 // FIXME: temporary solution for the first negative z-index composited child:
1039 // re-compute the absBounds for the child so that we can add the 1069 // re-compute the absBounds for the child so that we can add the
1040 // negative z-index child's bounds to the new overlap context. 1070 // negative z-index child's bounds to the new overlap context.
1041 if (overlapMap) { 1071 if (overlapMap) {
1042 overlapMap->geometryMap().pushMappingsToAncestor(curNode ->layer(), layer); 1072 overlapMap->geometryMap().pushMappingsToAncestor(curNode ->layer(), layer);
1043 IntRect childAbsBounds = enclosingIntRect(overlapMap->ge ometryMap().absoluteRect(curNode->layer()->overlapBounds())); 1073 // The above call to computeCompositinRequirements will have already updated this layer's absolute bounding box.
1044 overlapMap->beginNewOverlapTestingContext(); 1074 overlapMap->beginNewOverlapTestingContext();
1045 addToOverlapMap(*overlapMap, curNode->layer(), childAbsB ounds); 1075 ASSERT(!curNode->layer()->needsToRecomputeBounds());
1076 addToOverlapMap(*overlapMap, curNode->layer(), curNode-> layer()->absoluteBoundingBox());
1046 overlapMap->finishCurrentOverlapTestingContext(); 1077 overlapMap->finishCurrentOverlapTestingContext();
1047 overlapMap->geometryMap().popMappingsToAncestor(layer); 1078 overlapMap->geometryMap().popMappingsToAncestor(layer);
1048 } 1079 }
1049 } 1080 }
1050 } 1081 }
1051 } 1082 }
1052 } 1083 }
1053 1084
1054 if (overlapMap && willHaveForegroundLayer) { 1085 if (overlapMap && willHaveForegroundLayer) {
1055 ASSERT(willBeCompositedOrSquashed); 1086 ASSERT(willBeCompositedOrSquashed);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 // second-from-top context of the stack. 1141 // second-from-top context of the stack.
1111 overlapMap->beginNewOverlapTestingContext(); 1142 overlapMap->beginNewOverlapTestingContext();
1112 addToOverlapMap(*overlapMap, layer, absoluteDecendantBoundingBox); 1143 addToOverlapMap(*overlapMap, layer, absoluteDecendantBoundingBox);
1113 } 1144 }
1114 willBeCompositedOrSquashed = true; 1145 willBeCompositedOrSquashed = true;
1115 } 1146 }
1116 1147
1117 // If the original layer is composited, the reflection needs to be, too. 1148 // If the original layer is composited, the reflection needs to be, too.
1118 if (layer->reflectionInfo()) { 1149 if (layer->reflectionInfo()) {
1119 // FIXME: Shouldn't we call computeCompositingRequirements to handle a r eflection overlapping with another renderer? 1150 // FIXME: Shouldn't we call computeCompositingRequirements to handle a r eflection overlapping with another renderer?
1151 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflectionLayer( );
1152 reflectionLayer->clearNeedsToRecomputeBounds();
1120 CompositingReasons reflectionCompositingReason = willBeCompositedOrSquas hed ? CompositingReasonReflectionOfCompositedParent : CompositingReasonNone; 1153 CompositingReasons reflectionCompositingReason = willBeCompositedOrSquas hed ? CompositingReasonReflectionOfCompositedParent : CompositingReasonNone;
1121 layer->reflectionInfo()->reflectionLayer()->setCompositingReasons(layer- >reflectionInfo()->reflectionLayer()->compositingReasons() | reflectionCompositi ngReason); 1154 reflectionLayer->setCompositingReasons(reflectionLayer->compositingReaso ns() | reflectionCompositingReason);
1122 } 1155 }
1123 1156
1124 // Subsequent layers in the parent's stacking context may also need to compo site. 1157 // Subsequent layers in the parent's stacking context may also need to compo site.
1125 if (childRecursionData.m_subtreeIsCompositing) 1158 if (childRecursionData.m_subtreeIsCompositing)
1126 currentRecursionData.m_subtreeIsCompositing = true; 1159 currentRecursionData.m_subtreeIsCompositing = true;
1127 1160
1128 if (willBeCompositedOrSquashed && layer->blendInfo().hasBlendMode()) 1161 if (willBeCompositedOrSquashed && layer->blendInfo().hasBlendMode())
1129 currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = true; 1162 currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = true;
1130 1163
1131 // Set the flag to say that this SC has compositing children. 1164 // Set the flag to say that this SC has compositing children.
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
2274 } else if (graphicsLayer == m_scrollLayer.get()) { 2307 } else if (graphicsLayer == m_scrollLayer.get()) {
2275 name = "LocalFrame Scrolling Layer"; 2308 name = "LocalFrame Scrolling Layer";
2276 } else { 2309 } else {
2277 ASSERT_NOT_REACHED(); 2310 ASSERT_NOT_REACHED();
2278 } 2311 }
2279 2312
2280 return name; 2313 return name;
2281 } 2314 }
2282 2315
2283 } // namespace WebCore 2316 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698