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

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

Issue 27030009: Revert "Make compositingState explicit (re-land #2 with bogus ASSERT removed)" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix build error 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 156a1d5988d489a9e89636fe6fd0a19c754c3c90..546b7c60aeb2ee0e549b93a9d04da71605eb7765 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1406,7 +1406,7 @@ void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintCo
RenderView* v = view();
if (repaintContainer->isRenderView()) {
ASSERT(repaintContainer == v);
- bool viewHasCompositedLayer = v->hasLayer() && v->layer()->compositingState() == PaintsIntoOwnBacking;
+ bool viewHasCompositedLayer = v->hasLayer() && v->layer()->isComposited();
if (!viewHasCompositedLayer) {
IntRect repaintRectangle = r;
if (viewHasCompositedLayer && v->layer()->transform())
@@ -1417,7 +1417,7 @@ void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintCo
}
if (v->usesCompositing()) {
- ASSERT(repaintContainer->hasLayer() && repaintContainer->layer()->compositingState() == PaintsIntoOwnBacking);
+ ASSERT(repaintContainer->hasLayer() && repaintContainer->layer()->isComposited());
repaintContainer->layer()->setBackingNeedsRepaintInRect(r);
}
}
@@ -1782,15 +1782,12 @@ void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style)
StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsigned contextSensitiveProperties) const
{
- // 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 transform changed, and we are not composited, need to do a layout.
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()->compositingState() != PaintsIntoOwnBacking)) {
+ if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer()->isComposited())) {
// We need to set at least SimplifiedLayout, but if PositionedMovementOnly is already set
// then we actually need SimplifiedLayoutAndPositionedMovement.
if (!hasLayer())
@@ -1803,17 +1800,18 @@ StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign
diff = StyleDifferenceRecompositeLayer;
}
- // If opacity or filters changed, and the layer does not paint into its own separate backing, then we need to repaint (also
+ // If opacity changed, and we are not composited, need to repaint (also
// ignoring text nodes)
if (contextSensitiveProperties & ContextSensitivePropertyOpacity) {
- if (!isText() && (!hasLayer() || toRenderLayerModelObject(this)->layer()->compositingState() != PaintsIntoOwnBacking))
+ if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer()->isComposited()))
diff = StyleDifferenceRepaintLayer;
else if (diff < StyleDifferenceRecompositeLayer)
diff = StyleDifferenceRecompositeLayer;
}
+
if ((contextSensitiveProperties & ContextSensitivePropertyFilter) && hasLayer()) {
RenderLayer* layer = toRenderLayerModelObject(this)->layer();
- if (layer->compositingState() != PaintsIntoOwnBacking || layer->paintsWithFilters())
+ if (!layer->isComposited() || layer->paintsWithFilters())
diff = StyleDifferenceRepaintLayer;
else if (diff < StyleDifferenceRecompositeLayer)
diff = StyleDifferenceRecompositeLayer;
@@ -2775,9 +2773,9 @@ void RenderObject::updateDragState(bool dragOn)
curr->updateDragState(dragOn);
}
-CompositingState RenderObject::compositingState() const
+bool RenderObject::isComposited() const
{
- return hasLayer() ? toRenderLayerModelObject(this)->layer()->compositingState() : NotComposited;
+ return hasLayer() && toRenderLayerModelObject(this)->layer()->isComposited();
}
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