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

Side by Side Diff: sky/engine/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 731863003: Remove CSSCompositing (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: preland Created 6 years, 1 month 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 return graphicsLayer.release(); 172 return graphicsLayer.release();
173 } 173 }
174 174
175 void CompositedLayerMapping::createPrimaryGraphicsLayer() 175 void CompositedLayerMapping::createPrimaryGraphicsLayer()
176 { 176 {
177 m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons()); 177 m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons());
178 178
179 updateOpacity(renderer()->style()); 179 updateOpacity(renderer()->style());
180 updateTransform(renderer()->style()); 180 updateTransform(renderer()->style());
181 updateFilters(renderer()->style()); 181 updateFilters(renderer()->style());
182
183 if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
184 updateLayerBlendMode(renderer()->style());
185 updateIsRootForIsolatedGroup();
186 }
187 } 182 }
188 183
189 void CompositedLayerMapping::destroyGraphicsLayers() 184 void CompositedLayerMapping::destroyGraphicsLayers()
190 { 185 {
191 if (m_graphicsLayer) 186 if (m_graphicsLayer)
192 m_graphicsLayer->removeFromParent(); 187 m_graphicsLayer->removeFromParent();
193 188
194 m_ancestorClippingLayer = nullptr; 189 m_ancestorClippingLayer = nullptr;
195 m_graphicsLayer = nullptr; 190 m_graphicsLayer = nullptr;
196 m_foregroundLayer = nullptr; 191 m_foregroundLayer = nullptr;
(...skipping 20 matching lines...) Expand all
217 } 212 }
218 213
219 m_graphicsLayer->setTransform(t); 214 m_graphicsLayer->setTransform(t);
220 } 215 }
221 216
222 void CompositedLayerMapping::updateFilters(const RenderStyle* style) 217 void CompositedLayerMapping::updateFilters(const RenderStyle* style)
223 { 218 {
224 m_graphicsLayer->setFilters(owningLayer().computeFilterOperations(style)); 219 m_graphicsLayer->setFilters(owningLayer().computeFilterOperations(style));
225 } 220 }
226 221
227 void CompositedLayerMapping::updateLayerBlendMode(const RenderStyle* style)
228 {
229 setBlendMode(style->blendMode());
230 }
231
232 void CompositedLayerMapping::updateIsRootForIsolatedGroup()
233 {
234 bool isolate = m_owningLayer.shouldIsolateCompositedDescendants();
235
236 // non stacking context layers should never isolate
237 ASSERT(m_owningLayer.stackingNode()->isStackingContext() || !isolate);
238
239 m_graphicsLayer->setIsRootForIsolatedGroup(isolate);
240 }
241
242 void CompositedLayerMapping::updateContentsOpaque() 222 void CompositedLayerMapping::updateContentsOpaque()
243 { 223 {
244 // For non-root layers, background is always painted by the primary graphics layer. 224 // For non-root layers, background is always painted by the primary graphics layer.
245 ASSERT(!m_backgroundLayer); 225 ASSERT(!m_backgroundLayer);
246 if (m_backgroundLayer) { 226 if (m_backgroundLayer) {
247 m_graphicsLayer->setContentsOpaque(false); 227 m_graphicsLayer->setContentsOpaque(false);
248 m_backgroundLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBe OpaqueInRect(compositedBounds())); 228 m_backgroundLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBe OpaqueInRect(compositedBounds()));
249 } else { 229 } else {
250 m_graphicsLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBeOp aqueInRect(compositedBounds())); 230 m_graphicsLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBeOp aqueInRect(compositedBounds()));
251 } 231 }
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 552
573 updateMaskLayerGeometry(); 553 updateMaskLayerGeometry();
574 updateTransformGeometry(snappedOffsetFromCompositedAncestor, relativeComposi tingBounds); 554 updateTransformGeometry(snappedOffsetFromCompositedAncestor, relativeComposi tingBounds);
575 updateForegroundLayerGeometry(contentsSize, clippingBox); 555 updateForegroundLayerGeometry(contentsSize, clippingBox);
576 updateBackgroundLayerGeometry(contentsSize); 556 updateBackgroundLayerGeometry(contentsSize);
577 updateChildClippingMaskLayerGeometry(); 557 updateChildClippingMaskLayerGeometry();
578 558
579 if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scroll sOverflow()) 559 if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scroll sOverflow())
580 m_owningLayer.scrollableArea()->positionOverflowControls(IntSize()); 560 m_owningLayer.scrollableArea()->positionOverflowControls(IntSize());
581 561
582 if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
583 updateLayerBlendMode(renderer()->style());
584 updateIsRootForIsolatedGroup();
585 }
586
587 updateContentsRect(); 562 updateContentsRect();
588 updateBackgroundColor(); 563 updateBackgroundColor();
589 updateDrawsContent(); 564 updateDrawsContent();
590 updateContentsOpaque(); 565 updateContentsOpaque();
591 updateRenderingContext(); 566 updateRenderingContext();
592 updateShouldFlattenTransform(); 567 updateShouldFlattenTransform();
593 updateChildrenTransform(); 568 updateChildrenTransform();
594 569
595 updateCompositingReasons(); 570 updateCompositingReasons();
596 } 571 }
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 } else if (graphicsLayer == m_overflowControlsClippingLayer.get()) { 1794 } else if (graphicsLayer == m_overflowControlsClippingLayer.get()) {
1820 name = "Overflow Controls ClipLayer Layer"; 1795 name = "Overflow Controls ClipLayer Layer";
1821 } else { 1796 } else {
1822 ASSERT_NOT_REACHED(); 1797 ASSERT_NOT_REACHED();
1823 } 1798 }
1824 1799
1825 return name; 1800 return name;
1826 } 1801 }
1827 1802
1828 } // namespace blink 1803 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698