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

Side by Side Diff: sky/engine/core/rendering/RenderObject.cpp

Issue 768493002: Get rid of CompositingState. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix incorrect case. Created 6 years 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 { 1209 {
1210 if (!isRooted()) 1210 if (!isRooted())
1211 return 0; 1211 return 0;
1212 1212
1213 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta iner()); 1213 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta iner());
1214 } 1214 }
1215 1215
1216 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const 1216 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const
1217 { 1217 {
1218 RenderLayerModelObject* container = 0; 1218 RenderLayerModelObject* container = 0;
1219 // FIXME: CompositingState is not necessarily up to date for many callers of this function.
1220 DisableCompositingQueryAsserts disabler;
1221
1222 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaint InvalidationCrossingFrameBoundaries()) 1219 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaint InvalidationCrossingFrameBoundaries())
1223 container = compositingLayer->renderer(); 1220 container = compositingLayer->renderer();
1224 return container; 1221 return container;
1225 } 1222 }
1226 1223
1227 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA ncestors(const RenderLayerModelObject* paintInvalidationContainer) const 1224 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA ncestors(const RenderLayerModelObject* paintInvalidationContainer) const
1228 { 1225 {
1229 if (paintInvalidationContainer) 1226 if (paintInvalidationContainer)
1230 return paintInvalidationContainer; 1227 return paintInvalidationContainer;
1231 1228
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun ds, newBounds); 1409 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun ds, newBounds);
1413 return invalidationReason; 1410 return invalidationReason;
1414 } 1411 }
1415 1412
1416 InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod elObject& paintInvalidationContainer, 1413 InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod elObject& paintInvalidationContainer,
1417 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec t& newBounds, const LayoutPoint& newLocation) 1414 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec t& newBounds, const LayoutPoint& newLocation)
1418 { 1415 {
1419 if (shouldDoFullPaintInvalidation()) 1416 if (shouldDoFullPaintInvalidation())
1420 return InvalidationFull; 1417 return InvalidationFull;
1421 1418
1422 if (compositingState() != PaintsIntoOwnBacking && newLocation != oldLocation ) 1419 if (newLocation != oldLocation)
1423 return InvalidationLocationChange; 1420 return InvalidationLocationChange;
1424 1421
1425 // If the bounds are the same then we know that none of the statements below 1422 // If the bounds are the same then we know that none of the statements below
1426 // can match, so we can early out since we will not need to do any 1423 // can match, so we can early out since we will not need to do any
1427 // invalidation. 1424 // invalidation.
1428 if (oldBounds == newBounds) 1425 if (oldBounds == newBounds)
1429 return InvalidationNone; 1426 return InvalidationNone;
1430 1427
1431 // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could 1428 // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could
1432 // be caused by some layout property (left / top) or some in-flow renderer i nserted / removed before us in the tree. 1429 // be caused by some layout property (left / top) or some in-flow renderer i nserted / removed before us in the tree.
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
2231 maskBoxImage->removeClient(this); 2228 maskBoxImage->removeClient(this);
2232 } 2229 }
2233 delete this; 2230 delete this;
2234 } 2231 }
2235 2232
2236 PositionWithAffinity RenderObject::positionForPoint(const LayoutPoint&) 2233 PositionWithAffinity RenderObject::positionForPoint(const LayoutPoint&)
2237 { 2234 {
2238 return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); 2235 return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM);
2239 } 2236 }
2240 2237
2241 CompositingState RenderObject::compositingState() const
2242 {
2243 return hasLayer() ? toRenderLayerModelObject(this)->layer()->compositingStat e() : NotComposited;
2244 }
2245
2246 CompositingReasons RenderObject::additionalCompositingReasons() const 2238 CompositingReasons RenderObject::additionalCompositingReasons() const
2247 { 2239 {
2248 return CompositingReasonNone; 2240 return CompositingReasonNone;
2249 } 2241 }
2250 2242
2251 bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffse t, HitTestFilter hitTestFilter) 2243 bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffse t, HitTestFilter hitTestFilter)
2252 { 2244 {
2253 bool inside = false; 2245 bool inside = false;
2254 if (hitTestFilter != HitTestSelf) { 2246 if (hitTestFilter != HitTestSelf) {
2255 // First test the foreground layer (lines and inlines). 2247 // First test the foreground layer (lines and inlines).
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2597 { 2589 {
2598 if (object1) { 2590 if (object1) {
2599 const blink::RenderObject* root = object1; 2591 const blink::RenderObject* root = object1;
2600 while (root->parent()) 2592 while (root->parent())
2601 root = root->parent(); 2593 root = root->parent();
2602 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 2594 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
2603 } 2595 }
2604 } 2596 }
2605 2597
2606 #endif 2598 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698