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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2476813002: Move LayoutObject::m_previousPosition... into a global map in ObjectPaintInvalidator (Closed)
Patch Set: doc Created 4 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) 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. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 struct SameSizeAsLayoutObject : DisplayItemClient { 120 struct SameSizeAsLayoutObject : DisplayItemClient {
121 virtual ~SameSizeAsLayoutObject() {} // Allocate vtable pointer. 121 virtual ~SameSizeAsLayoutObject() {} // Allocate vtable pointer.
122 void* pointers[5]; 122 void* pointers[5];
123 Member<void*> members[1]; 123 Member<void*> members[1];
124 #if ENABLE(ASSERT) 124 #if ENABLE(ASSERT)
125 unsigned m_debugBitfields : 2; 125 unsigned m_debugBitfields : 2;
126 #endif 126 #endif
127 unsigned m_bitfields; 127 unsigned m_bitfields;
128 unsigned m_bitfields2; 128 unsigned m_bitfields2;
129 LayoutRect m_previousVisualRect; 129 LayoutRect m_previousVisualRect;
130 LayoutPoint m_previousPosition;
131 }; 130 };
132 131
133 static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject), 132 static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject),
134 "LayoutObject should stay small"); 133 "LayoutObject should stay small");
135 134
136 bool LayoutObject::s_affectsParentBlock = false; 135 bool LayoutObject::s_affectsParentBlock = false;
137 136
138 // The pointer to paint properties is implemented as a global hash map 137 // The pointer to paint properties is implemented as a global hash map
139 // temporarily, to avoid memory regression during the transition towards SPv2. 138 // temporarily, to avoid memory regression during the transition towards SPv2.
140 typedef HashMap<const LayoutObject*, std::unique_ptr<ObjectPaintProperties>> 139 typedef HashMap<const LayoutObject*, std::unique_ptr<ObjectPaintProperties>>
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 LayoutView* v = view(); 1196 LayoutView* v = view();
1198 if (v->document().printing()) 1197 if (v->document().printing())
1199 return PaintInvalidationNone; // Don't invalidate paints if we're printing. 1198 return PaintInvalidationNone; // Don't invalidate paints if we're printing.
1200 1199
1201 PaintInvalidatorContextAdapter context(paintInvalidationState); 1200 PaintInvalidatorContextAdapter context(paintInvalidationState);
1202 1201
1203 const LayoutBoxModelObject& paintInvalidationContainer = 1202 const LayoutBoxModelObject& paintInvalidationContainer =
1204 paintInvalidationState.paintInvalidationContainer(); 1203 paintInvalidationState.paintInvalidationContainer();
1205 DCHECK(paintInvalidationContainer == containerForPaintInvalidation()); 1204 DCHECK(paintInvalidationContainer == containerForPaintInvalidation());
1206 1205
1206 ObjectPaintInvalidator paintInvalidator(*this);
1207 context.oldVisualRect = previousVisualRect(); 1207 context.oldVisualRect = previousVisualRect();
1208 context.oldLocation = previousPositionFromPaintInvalidationBacking(); 1208 context.oldLocation = paintInvalidator.previousLocationInBacking();
1209 context.newVisualRect = paintInvalidationState.computeVisualRectInBacking(); 1209 context.newVisualRect = paintInvalidationState.computeVisualRectInBacking();
1210 context.newLocation = 1210 context.newLocation = paintInvalidationState.computeLocationInBacking(
1211 paintInvalidationState.computePositionFromPaintInvalidationBacking(); 1211 context.newVisualRect.location());
1212 1212
1213 IntSize adjustment = 1213 IntSize adjustment =
1214 scrollAdjustmentForPaintInvalidation(paintInvalidationContainer); 1214 scrollAdjustmentForPaintInvalidation(paintInvalidationContainer);
1215 context.newLocation.move(adjustment); 1215 context.newLocation.move(adjustment);
1216 context.newVisualRect.move(adjustment); 1216 context.newVisualRect.move(adjustment);
1217 1217
1218 adjustVisualRectForRasterEffects(context.newVisualRect); 1218 adjustVisualRectForRasterEffects(context.newVisualRect);
1219 1219
1220 setPreviousVisualRect(context.newVisualRect); 1220 setPreviousVisualRect(context.newVisualRect);
1221 setPreviousPositionFromPaintInvalidationBacking(context.newLocation); 1221 paintInvalidator.setPreviousLocationInBacking(context.newLocation);
1222 1222
1223 if (!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() && 1223 if (!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() &&
1224 paintInvalidationState 1224 paintInvalidationState
1225 .forcedSubtreeInvalidationRectUpdateWithinContainerOnly()) { 1225 .forcedSubtreeInvalidationRectUpdateWithinContainerOnly()) {
1226 // We are done updating the visual rect. No other paint invalidation work 1226 // We are done updating the visual rect. No other paint invalidation work
1227 // to do for this object. 1227 // to do for this object.
1228 return PaintInvalidationNone; 1228 return PaintInvalidationNone;
1229 } 1229 }
1230 1230
1231 return invalidatePaintIfNeeded(context); 1231 return invalidatePaintIfNeeded(context);
(...skipping 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after
3546 const blink::LayoutObject* root = object1; 3546 const blink::LayoutObject* root = object1;
3547 while (root->parent()) 3547 while (root->parent())
3548 root = root->parent(); 3548 root = root->parent();
3549 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3549 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3550 } else { 3550 } else {
3551 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3551 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3552 } 3552 }
3553 } 3553 }
3554 3554
3555 #endif 3555 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/PaintInvalidationState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698