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

Side by Side Diff: sky/engine/core/rendering/compositing/CompositingReasonFinder.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/rendering/compositing/CompositingReasonFinder.h" 6 #include "core/rendering/compositing/CompositingReasonFinder.h"
7 7
8 #include "core/CSSPropertyNames.h" 8 #include "core/CSSPropertyNames.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 if (style->hasInlineTransform()) 73 if (style->hasInlineTransform())
74 reasons |= CompositingReasonInlineTransform; 74 reasons |= CompositingReasonInlineTransform;
75 75
76 if (style->transformStyle3D() == TransformStyle3DPreserve3D) 76 if (style->transformStyle3D() == TransformStyle3DPreserve3D)
77 reasons |= CompositingReasonPreserve3DWith3DDescendants; 77 reasons |= CompositingReasonPreserve3DWith3DDescendants;
78 78
79 if (style->hasPerspective()) 79 if (style->hasPerspective())
80 reasons |= CompositingReasonPerspectiveWith3DDescendants; 80 reasons |= CompositingReasonPerspectiveWith3DDescendants;
81 81
82 // If the implementation of createsGroup changes, we need to be aware of tha t in this part of code. 82 // If the implementation of createsGroup changes, we need to be aware of tha t in this part of code.
83 ASSERT((renderer->isTransparent() || renderer->hasMask() || renderer->hasFil ter() || renderer->hasBlendMode()) == renderer->createsGroup()); 83 ASSERT((renderer->isTransparent() || renderer->hasMask() || renderer->hasFil ter()) == renderer->createsGroup());
84 84
85 if (style->hasMask()) 85 if (style->hasMask())
86 reasons |= CompositingReasonMaskWithCompositedDescendants; 86 reasons |= CompositingReasonMaskWithCompositedDescendants;
87 87
88 if (style->hasFilter()) 88 if (style->hasFilter())
89 reasons |= CompositingReasonFilterWithCompositedDescendants; 89 reasons |= CompositingReasonFilterWithCompositedDescendants;
90 90
91 // See RenderLayer::updateTransform for an explanation of why we check both. 91 // See RenderLayer::updateTransform for an explanation of why we check both.
92 if (renderer->hasTransform() && style->hasTransform()) 92 if (renderer->hasTransform() && style->hasTransform())
93 reasons |= CompositingReasonTransformWithCompositedDescendants; 93 reasons |= CompositingReasonTransformWithCompositedDescendants;
94 94
95 if (renderer->isTransparent()) 95 if (renderer->isTransparent())
96 reasons |= CompositingReasonOpacityWithCompositedDescendants; 96 reasons |= CompositingReasonOpacityWithCompositedDescendants;
97 97
98 if (renderer->hasBlendMode())
99 reasons |= CompositingReasonBlendingWithCompositedDescendants;
100
101 ASSERT(!(reasons & ~CompositingReasonComboAllStyleDeterminedReasons)); 98 ASSERT(!(reasons & ~CompositingReasonComboAllStyleDeterminedReasons));
102 return reasons; 99 return reasons;
103 } 100 }
104 101
105 bool CompositingReasonFinder::requiresCompositingForTransform(RenderObject* rend erer) const 102 bool CompositingReasonFinder::requiresCompositingForTransform(RenderObject* rend erer) const
106 { 103 {
107 // Note that we ask the renderer if it has a transform, because the style ma y have transforms, 104 // Note that we ask the renderer if it has a transform, because the style ma y have transforms,
108 // but the renderer may be an inline that doesn't suppport them. 105 // but the renderer may be an inline that doesn't suppport them.
109 return renderer->hasTransform() && renderer->style()->transform().has3DOpera tion(); 106 return renderer->hasTransform() && renderer->style()->transform().has3DOpera tion();
110 } 107 }
(...skipping 24 matching lines...) Expand all
135 132
136 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderStyle* style ) const 133 bool CompositingReasonFinder::requiresCompositingForAnimation(RenderStyle* style ) const
137 { 134 {
138 if (style->subtreeWillChangeContents()) 135 if (style->subtreeWillChangeContents())
139 return style->isRunningAnimationOnCompositor(); 136 return style->isRunningAnimationOnCompositor();
140 137
141 return style->shouldCompositeForCurrentAnimations(); 138 return style->shouldCompositeForCurrentAnimations();
142 } 139 }
143 140
144 } 141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698