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

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 24921002: Make compositingState explicit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: path for re-landing try #2 with removed unnecessary comment Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderTreeAsText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index a6df2caec37d4f08d9c73a00f56d20f0db39bc8a..ff85e413b4df4c068907dd33525f5abdc684a32c 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1367,7 +1367,7 @@ void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintCo
RenderView* v = view();
if (repaintContainer->isRenderView()) {
ASSERT(repaintContainer == v);
- bool viewHasCompositedLayer = v->hasLayer() && v->layer()->isComposited();
+ bool viewHasCompositedLayer = v->hasLayer() && v->layer()->compositingState() == PaintsIntoOwnBacking;
if (!viewHasCompositedLayer) {
IntRect repaintRectangle = r;
if (viewHasCompositedLayer && v->layer()->transform())
@@ -1378,7 +1378,7 @@ void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintCo
}
if (v->usesCompositing()) {
- ASSERT(repaintContainer->hasLayer() && repaintContainer->layer()->isComposited());
+ ASSERT(repaintContainer->hasLayer() && repaintContainer->layer()->compositingState() == PaintsIntoOwnBacking);
repaintContainer->layer()->setBackingNeedsRepaintInRect(r);
}
}
@@ -1743,12 +1743,15 @@ void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style)
StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsigned contextSensitiveProperties) const
{
- // If transform changed, and we are not composited, need to do a layout.
+ // If transform changed, and the layer does not paint into its own separate backing, then we need to do a layout.
+ // FIXME: The comment above is what the code does, but it is technically not following spec. This means we will
+ // not to layout for 3d transforms, but we should be invoking a simplified relayout. Is it possible we are avoiding
+ // doing this for some performance reason at this time?
if (contextSensitiveProperties & ContextSensitivePropertyTransform) {
// Text nodes share style with their parents but transforms don't apply to them,
// hence the !isText() check.
// FIXME: when transforms are taken into account for overflow, we will need to do a layout.
- if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer()->isComposited())) {
+ if (!isText() && (!hasLayer() || toRenderLayerModelObject(this)->layer()->compositingState() != PaintsIntoOwnBacking)) {
// We need to set at least SimplifiedLayout, but if PositionedMovementOnly is already set
// then we actually need SimplifiedLayoutAndPositionedMovement.
if (!hasLayer())
@@ -1761,18 +1764,17 @@ StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign
diff = StyleDifferenceRecompositeLayer;
}
- // If opacity changed, and we are not composited, need to repaint (also
+ // If opacity or filters changed, and the layer does not paint into its own separate backing, then we need to repaint (also
// ignoring text nodes)
if (contextSensitiveProperties & ContextSensitivePropertyOpacity) {
- if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer()->isComposited()))
+ if (!isText() && (!hasLayer() || toRenderLayerModelObject(this)->layer()->compositingState() != PaintsIntoOwnBacking))
diff = StyleDifferenceRepaintLayer;
else if (diff < StyleDifferenceRecompositeLayer)
diff = StyleDifferenceRecompositeLayer;
}
-
if ((contextSensitiveProperties & ContextSensitivePropertyFilter) && hasLayer()) {
RenderLayer* layer = toRenderLayerModelObject(this)->layer();
- if (!layer->isComposited() || layer->paintsWithFilters())
+ if (layer->compositingState() != PaintsIntoOwnBacking || layer->paintsWithFilters())
diff = StyleDifferenceRepaintLayer;
else if (diff < StyleDifferenceRecompositeLayer)
diff = StyleDifferenceRecompositeLayer;
@@ -2733,9 +2735,9 @@ void RenderObject::updateDragState(bool dragOn)
curr->updateDragState(dragOn);
}
-bool RenderObject::isComposited() const
+CompositingState RenderObject::compositingState() const
{
- return hasLayer() && toRenderLayerModelObject(this)->layer()->isComposited();
+ return hasLayer() ? toRenderLayerModelObject(this)->layer()->compositingState() : NotComposited;
}
bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter hitTestFilter)
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698