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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1730653002: Move squash preventing reasons out of compositing reasons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug and test fixes. Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 updateChildTransformLayer(false); 202 updateChildTransformLayer(false);
203 updateForegroundLayer(false); 203 updateForegroundLayer(false);
204 updateBackgroundLayer(false); 204 updateBackgroundLayer(false);
205 updateMaskLayer(false); 205 updateMaskLayer(false);
206 updateChildClippingMaskLayer(false); 206 updateChildClippingMaskLayer(false);
207 updateScrollingLayers(false); 207 updateScrollingLayers(false);
208 updateSquashingLayers(false); 208 updateSquashingLayers(false);
209 destroyGraphicsLayers(); 209 destroyGraphicsLayers();
210 } 210 }
211 211
212 PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(Compositin gReasons reasons) 212 PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(Compositin gReasons reasons, SquashingDisallowedReasons squashingDisallowedReasons)
213 { 213 {
214 GraphicsLayerFactory* graphicsLayerFactory = nullptr; 214 GraphicsLayerFactory* graphicsLayerFactory = nullptr;
215 if (Page* page = layoutObject()->frame()->page()) 215 if (Page* page = layoutObject()->frame()->page())
216 graphicsLayerFactory = page->chromeClient().graphicsLayerFactory(); 216 graphicsLayerFactory = page->chromeClient().graphicsLayerFactory();
217 217
218 OwnPtr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFac tory, this); 218 OwnPtr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFac tory, this);
219 219
220 graphicsLayer->setCompositingReasons(reasons); 220 graphicsLayer->setCompositingReasons(reasons);
221 graphicsLayer->setSquashingDisallowedReasons(squashingDisallowedReasons);
221 if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode()) 222 if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode())
222 graphicsLayer->setOwnerNodeId(DOMNodeIds::idForNode(owningNode)); 223 graphicsLayer->setOwnerNodeId(DOMNodeIds::idForNode(owningNode));
223 224
224 return graphicsLayer.release(); 225 return graphicsLayer.release();
225 } 226 }
226 227
227 void CompositedLayerMapping::createPrimaryGraphicsLayer() 228 void CompositedLayerMapping::createPrimaryGraphicsLayer()
228 { 229 {
229 m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons()); 230 m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons(), m_ owningLayer.squashingDisallowedReasons());
230 231
231 updateOpacity(layoutObject()->styleRef()); 232 updateOpacity(layoutObject()->styleRef());
232 updateTransform(layoutObject()->styleRef()); 233 updateTransform(layoutObject()->styleRef());
233 updateFilters(layoutObject()->styleRef()); 234 updateFilters(layoutObject()->styleRef());
234 updateBackdropFilters(layoutObject()->styleRef()); 235 updateBackdropFilters(layoutObject()->styleRef());
235 236
236 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { 237 if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
237 updateLayerBlendMode(layoutObject()->styleRef()); 238 updateLayerBlendMode(layoutObject()->styleRef());
238 updateIsRootForIsolatedGroup(); 239 updateIsRootForIsolatedGroup();
239 } 240 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 innerCompositor->frameViewDidChangeLocation(flooredIntPoint(contents Box().location())); 340 innerCompositor->frameViewDidChangeLocation(flooredIntPoint(contents Box().location()));
340 } 341 }
341 } 342 }
342 } 343 }
343 344
344 void CompositedLayerMapping::updateCompositingReasons() 345 void CompositedLayerMapping::updateCompositingReasons()
345 { 346 {
346 // All other layers owned by this mapping will have the same compositing rea son 347 // All other layers owned by this mapping will have the same compositing rea son
347 // for their lifetime, so they are initialized only when created. 348 // for their lifetime, so they are initialized only when created.
348 m_graphicsLayer->setCompositingReasons(m_owningLayer.compositingReasons()); 349 m_graphicsLayer->setCompositingReasons(m_owningLayer.compositingReasons());
350 m_graphicsLayer->setSquashingDisallowedReasons(m_owningLayer.squashingDisall owedReasons());
349 } 351 }
350 352
351 bool CompositedLayerMapping::owningLayerClippedByLayerNotAboveCompositedAncestor (const PaintLayer* scrollParent) 353 bool CompositedLayerMapping::owningLayerClippedByLayerNotAboveCompositedAncestor (const PaintLayer* scrollParent)
352 { 354 {
353 if (!m_owningLayer.parent()) 355 if (!m_owningLayer.parent())
354 return false; 356 return false;
355 357
356 const PaintLayer* compositingAncestor = m_owningLayer.enclosingLayerWithComp ositedLayerMapping(ExcludeSelf); 358 const PaintLayer* compositingAncestor = m_owningLayer.enclosingLayerWithComp ositedLayerMapping(ExcludeSelf);
357 if (!compositingAncestor) 359 if (!compositingAncestor)
358 return false; 360 return false;
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2539 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2541 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2540 name = "Scrolling Contents Layer"; 2542 name = "Scrolling Contents Layer";
2541 } else { 2543 } else {
2542 ASSERT_NOT_REACHED(); 2544 ASSERT_NOT_REACHED();
2543 } 2545 }
2544 2546
2545 return name; 2547 return name;
2546 } 2548 }
2547 2549
2548 } // namespace blink 2550 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698