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

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: fix DocumentLifecycle error 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 paintInvalidationReason(const LayoutBoxModel Object& paintInvalidationContainer,
179 const LayoutRect& oldBounds, const LayoutPoint& oldLocation,
180 const LayoutRect& newBounds, const LayoutPoint& newLocation) const overr ide;
181 virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationSta te&, const LayoutBoxModelObject& newPaintInvalidationContainer) override;
182
176 private: 183 private:
184 struct BackgroundPositioning {
185 TransformationMatrix transform;
186 LayoutSize borderBoxSize;
187 LayoutRect paddingBoxRect;
188 LayoutRect contentBoxRect;
189 };
190
177 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = 0, const PaintInvalidationState* = 0) const override; 191 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; 192 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const override;
179 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst override; 193 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst override;
180 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const override; 194 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const override;
181 195
182 void layoutContent(); 196 void layoutContent();
183 #if ENABLE(ASSERT) 197 #if ENABLE(ASSERT)
184 void checkLayoutState(); 198 void checkLayoutState();
185 #endif 199 #endif
186 200
187 friend class ForceHorriblySlowRectMapping; 201 friend class ForceHorriblySlowRectMapping;
188 202
189 bool shouldUsePrintingLayout() const; 203 bool shouldUsePrintingLayout() const;
190 204
191 LayoutObject* backgroundLayoutObject() const;
192
193 int viewLogicalWidthForBoxSizing() const; 205 int viewLogicalWidthForBoxSizing() const;
194 int viewLogicalHeightForBoxSizing() const; 206 int viewLogicalHeightForBoxSizing() const;
195 207
208 void getBackgroundPositioningFromDocumentElement(BackgroundPositioning&) con st;
209
196 FrameView* m_frameView; 210 FrameView* m_frameView;
197 211
198 LayoutObject* m_selectionStart; 212 LayoutObject* m_selectionStart;
199 LayoutObject* m_selectionEnd; 213 LayoutObject* m_selectionEnd;
200 214
201 int m_selectionStartPos; 215 int m_selectionStartPos;
202 int m_selectionEndPos; 216 int m_selectionEndPos;
203 217
204 LayoutUnit m_pageLogicalHeight; 218 LayoutUnit m_pageLogicalHeight;
205 bool m_pageLogicalHeightChanged; 219 bool m_pageLogicalHeightChanged;
206 LayoutState* m_layoutState; 220 LayoutState* m_layoutState;
207 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor; 221 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor;
208 RefPtr<IntervalArena> m_intervalArena; 222 RefPtr<IntervalArena> m_intervalArena;
209 223
210 LayoutQuote* m_layoutQuoteHead; 224 LayoutQuote* m_layoutQuoteHead;
211 unsigned m_layoutCounterCount; 225 unsigned m_layoutCounterCount;
212 226
213 unsigned m_hitTestCount; 227 unsigned m_hitTestCount;
214 228
229 BackgroundPositioning m_previousRootBackgroundPositioning;
230
215 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection; 231 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection;
216 }; 232 };
217 233
218 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView()); 234 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView());
219 235
220 // Suspends the LayoutState cached offset and clipRect optimization. Used under transforms 236 // 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 237 // 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 238 // 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 239 // moves its list marker around). Note that even when disabled, LayoutState is s till used to
224 // store layoutDelta. 240 // store layoutDelta.
(...skipping 14 matching lines...) Expand all
239 m_paintInvalidationState->m_cachedOffsetsEnabled = true; 255 m_paintInvalidationState->m_cachedOffsetsEnabled = true;
240 } 256 }
241 private: 257 private:
242 const PaintInvalidationState* m_paintInvalidationState; 258 const PaintInvalidationState* m_paintInvalidationState;
243 bool m_didDisable; 259 bool m_didDisable;
244 }; 260 };
245 261
246 } // namespace blink 262 } // namespace blink
247 263
248 #endif // LayoutView_h 264 #endif // LayoutView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698