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

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

Issue 840403003: First pass at deleting paint invalidation code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. 7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 if (layer()) { 115 if (layer()) {
116 // FIXME: Ideally we shouldn't need this setter but we can't easily infe r an overflow-only layer 116 // FIXME: Ideally we shouldn't need this setter but we can't easily infe r an overflow-only layer
117 // from the style. 117 // from the style.
118 layer()->setLayerType(type); 118 layer()->setLayerType(type);
119 layer()->styleChanged(diff, oldStyle); 119 layer()->styleChanged(diff, oldStyle);
120 } 120 }
121 } 121 }
122 122
123 InvalidationReason RenderLayerModelObject::invalidatePaintIfNeeded(const PaintIn validationState& paintInvalidationState, const RenderLayerModelObject& newPaintI nvalidationContainer)
124 {
125 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
126 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer();
127 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState));
128 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState));
129
130 // If we are set to do a full paint invalidation that means the RenderView w ill issue
131 // paint invalidations. We can then skip issuing of paint invalidations for the child
132 // renderers as they'll be covered by the RenderView.
133 if (view()->doingFullPaintInvalidation())
134 return InvalidationNone;
135
136 return RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvali dationState);
137 }
138
139 void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState & paintInvalidationState) 123 void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState & paintInvalidationState)
140 { 124 {
141 // FIXME: SVG should probably also go through this unified paint invalidatio n system. 125 // FIXME: SVG should probably also go through this unified paint invalidatio n system.
142 ASSERT(!needsLayout()); 126 ASSERT(!needsLayout());
143 127
144 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) 128 if (!shouldCheckForPaintInvalidation(paintInvalidationState))
145 return; 129 return;
146 130
147 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi tedContainerForSpecialAncestors(&paintInvalidationState.paintInvalidationContain er()); 131 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi tedContainerForSpecialAncestors(&paintInvalidationState.paintInvalidationContain er());
148 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); 132 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation());
149 133
150 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
151
152 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer); 134 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer);
153 if (reason == InvalidationLocationChange || reason == InvalidationFull)
154 childTreeWalkState.setForceCheckForPaintInvalidation();
155 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); 135 RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
156 } 136 }
157 137
158 } // namespace blink 138 } // namespace blink
159 139
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderLayerModelObject.h ('k') | sky/engine/core/rendering/RenderLayerRepainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698