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

Side by Side Diff: Source/core/layout/LayoutView.h

Issue 1145993002: Refactor root element background painting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: make invalidation more robust. also improve incremental invalidation for some common cases Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const override; 167 virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const override;
168 168
169 double layoutViewportWidth() const; 169 double layoutViewportWidth() const;
170 double layoutViewportHeight() const; 170 double layoutViewportHeight() const;
171 171
172 void pushLayoutState(LayoutState& layoutState) { m_layoutState = &layoutStat e; } 172 void pushLayoutState(LayoutState& layoutState) { m_layoutState = &layoutStat e; }
173 void popLayoutState() { ASSERT(m_layoutState); m_layoutState = m_layoutState ->next(); } 173 void popLayoutState() { ASSERT(m_layoutState); m_layoutState = m_layoutState ->next(); }
174 virtual void invalidateTreeIfNeeded(PaintInvalidationState&) override final; 174 virtual void invalidateTreeIfNeeded(PaintInvalidationState&) override final;
175 175
176 protected:
177 virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override;
178 virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationSta te&, const LayoutBoxModelObject& newPaintInvalidationContainer) override;
179
176 private: 180 private:
177 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = 0, const PaintInvalidationState* = 0) const override; 181 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = 0, const PaintInvalidationState* = 0) const override;
178 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const override; 182 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const override;
179 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst override; 183 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst override;
180 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const override; 184 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const override;
181 185
182 void layoutContent(); 186 void layoutContent();
183 #if ENABLE(ASSERT) 187 #if ENABLE(ASSERT)
184 void checkLayoutState(); 188 void checkLayoutState();
185 #endif 189 #endif
186 190
187 friend class ForceHorriblySlowRectMapping; 191 friend class ForceHorriblySlowRectMapping;
188 192
189 bool shouldUsePrintingLayout() const; 193 bool shouldUsePrintingLayout() const;
190 194
191 LayoutObject* backgroundLayoutObject() const;
192
193 int viewLogicalWidthForBoxSizing() const; 195 int viewLogicalWidthForBoxSizing() const;
194 int viewLogicalHeightForBoxSizing() const; 196 int viewLogicalHeightForBoxSizing() const;
195 197
196 FrameView* m_frameView; 198 FrameView* m_frameView;
197 199
198 LayoutObject* m_selectionStart; 200 LayoutObject* m_selectionStart;
199 LayoutObject* m_selectionEnd; 201 LayoutObject* m_selectionEnd;
200 202
201 int m_selectionStartPos; 203 int m_selectionStartPos;
202 int m_selectionEndPos; 204 int m_selectionEndPos;
203 205
204 LayoutUnit m_pageLogicalHeight; 206 LayoutUnit m_pageLogicalHeight;
205 bool m_pageLogicalHeightChanged; 207 bool m_pageLogicalHeightChanged;
206 LayoutState* m_layoutState; 208 LayoutState* m_layoutState;
207 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor; 209 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor;
208 RefPtr<IntervalArena> m_intervalArena; 210 RefPtr<IntervalArena> m_intervalArena;
209 211
210 LayoutQuote* m_layoutQuoteHead; 212 LayoutQuote* m_layoutQuoteHead;
211 unsigned m_layoutCounterCount; 213 unsigned m_layoutCounterCount;
212 214
213 unsigned m_hitTestCount; 215 unsigned m_hitTestCount;
214 216
217 struct BackgroundPositioning {
218 TransformationMatrix transform;
219 LayoutSize borderBoxSize;
220 LayoutRect paddingBoxRect;
221 LayoutRect contentBoxRect;
222 } m_previousRootBackgroundPositioning;
223
215 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection; 224 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection;
216 }; 225 };
217 226
218 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView()); 227 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView());
219 228
220 // Suspends the LayoutState cached offset and clipRect optimization. Used under transforms 229 // Suspends the LayoutState cached offset and clipRect optimization. Used under transforms
221 // that cannot be represented by LayoutState (common in SVG) and when manipulati ng the layout 230 // that cannot be represented by LayoutState (common in SVG) and when manipulati ng the layout
222 // tree during layout in ways that can trigger paint invalidation of a non-child (e.g. when a list item 231 // tree during layout in ways that can trigger paint invalidation of a non-child (e.g. when a list item
223 // moves its list marker around). Note that even when disabled, LayoutState is s till used to 232 // moves its list marker around). Note that even when disabled, LayoutState is s till used to
224 // store layoutDelta. 233 // store layoutDelta.
(...skipping 14 matching lines...) Expand all
239 m_paintInvalidationState->m_cachedOffsetsEnabled = true; 248 m_paintInvalidationState->m_cachedOffsetsEnabled = true;
240 } 249 }
241 private: 250 private:
242 const PaintInvalidationState* m_paintInvalidationState; 251 const PaintInvalidationState* m_paintInvalidationState;
243 bool m_didDisable; 252 bool m_didDisable;
244 }; 253 };
245 254
246 } // namespace blink 255 } // namespace blink
247 256
248 #endif // LayoutView_h 257 #endif // LayoutView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698