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

Side by Side Diff: sky/engine/core/rendering/RenderLayer.h

Issue 952343003: Remove some dead RenderLayer code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: remove showLayerTree Created 5 years, 10 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
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 const RenderLayerClipper& clipper() const { return m_clipper; } 207 const RenderLayerClipper& clipper() const { return m_clipper; }
208 208
209 inline bool isPositionedContainer() const 209 inline bool isPositionedContainer() const
210 { 210 {
211 // FIXME: This is not in sync with containingBlock. 211 // FIXME: This is not in sync with containingBlock.
212 RenderBox* layerRenderer = renderer(); 212 RenderBox* layerRenderer = renderer();
213 return isRootLayer() || layerRenderer->isPositioned() || hasTransform(); 213 return isRootLayer() || layerRenderer->isPositioned() || hasTransform();
214 } 214 }
215 215
216 void updateOrRemoveFilterEffectRenderer(); 216 void updateOrRemoveFilterEffectRenderer();
217 void updateSelfPaintingLayer();
218 217
219 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&, BorderRadiusClippingRule = IncludeSelfForBorderRadius); 218 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&, BorderRadiusClippingRule = IncludeSelfForBorderRadius);
220 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); 219 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&);
221 220
222 private: 221 private:
223 // TODO(ojan): Get rid of this. These are basically layer-tree-only paint ph ases.
224 enum PaintLayerFlags {
225 PaintContent,
226 };
227
228 // Bounding box in the coordinates of this layer. 222 // Bounding box in the coordinates of this layer.
229 LayoutRect logicalBoundingBox() const; 223 LayoutRect logicalBoundingBox() const;
230 224
231 void setAncestorChainHasSelfPaintingLayerDescendant();
232 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
233
234 void setNextSibling(RenderLayer* next) { m_next = next; } 225 void setNextSibling(RenderLayer* next) { m_next = next; }
235 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } 226 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; }
236 void setFirstChild(RenderLayer* first) { m_first = first; } 227 void setFirstChild(RenderLayer* first) { m_first = first; }
237 void setLastChild(RenderLayer* last) { m_last = last; } 228 void setLastChild(RenderLayer* last) { m_last = last; }
238 229
239 void updateHasSelfPaintingLayerDescendant() const;
240
241 bool hasSelfPaintingLayerDescendant() const
242 {
243 if (m_hasSelfPaintingLayerDescendantDirty)
244 updateHasSelfPaintingLayerDescendant();
245 ASSERT(!m_hasSelfPaintingLayerDescendantDirty);
246 return m_hasSelfPaintingLayerDescendant;
247 }
248
249 LayoutPoint renderBoxLocation() const { return renderer()->location(); } 230 LayoutPoint renderBoxLocation() const { return renderer()->location(); }
250 231
251 bool shouldBeSelfPaintingLayer() const; 232 bool shouldBeSelfPaintingLayer() const;
252 233
253 // FIXME: We should only create the stacking node if needed. 234 // FIXME: We should only create the stacking node if needed.
254 bool requiresStackingNode() const { return true; } 235 bool requiresStackingNode() const { return true; }
255 void updateStackingNode(); 236 void updateStackingNode();
256 237
257 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); 238 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle);
258 239
259 void dirty3DTransformedDescendantStatus(); 240 void dirty3DTransformedDescendantStatus();
260 241
261 void updateOrRemoveFilterClients(); 242 void updateOrRemoveFilterClients();
262 243
263 LayerType m_layerType; 244 LayerType m_layerType;
264 245
265 // Self-painting layer is an optimization where we avoid the heavy RenderLay er painting 246 // Self-painting layer is an optimization where we avoid the heavy RenderLay er painting
266 // machinery for a RenderLayer allocated only to handle the overflow clip ca se. 247 // machinery for a RenderLayer allocated only to handle the overflow clip ca se.
267 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov erflow-only concept. 248 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov erflow-only concept.
268 unsigned m_isSelfPaintingLayer : 1; 249 unsigned m_isSelfPaintingLayer : 1;
269 250
270 // If have no self-painting descendants, we don't have to walk our children during painting. This can lead to
271 // significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells).
272 mutable unsigned m_hasSelfPaintingLayerDescendant : 1;
273 mutable unsigned m_hasSelfPaintingLayerDescendantDirty : 1;
274
275 const unsigned m_isRootLayer : 1; 251 const unsigned m_isRootLayer : 1;
276 252
277 unsigned m_3DTransformedDescendantStatusDirty : 1; 253 unsigned m_3DTransformedDescendantStatusDirty : 1;
278 // Set on a stacking context layer that has 3D descendants anywhere 254 // Set on a stacking context layer that has 3D descendants anywhere
279 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. 255 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing.
280 unsigned m_has3DTransformedDescendant : 1; 256 unsigned m_has3DTransformedDescendant : 1;
281 257
282 unsigned m_hasFilterInfo : 1; 258 unsigned m_hasFilterInfo : 1;
283 259
284 RenderBox* m_renderer; 260 RenderBox* m_renderer;
285 261
286 RenderLayer* m_parent; 262 RenderLayer* m_parent;
287 RenderLayer* m_previous; 263 RenderLayer* m_previous;
288 RenderLayer* m_next; 264 RenderLayer* m_next;
289 RenderLayer* m_first; 265 RenderLayer* m_first;
290 RenderLayer* m_last; 266 RenderLayer* m_last;
291 267
292 OwnPtr<TransformationMatrix> m_transform; 268 OwnPtr<TransformationMatrix> m_transform;
293 269
294 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? 270 RenderLayerClipper m_clipper; // FIXME: Lazily allocate?
295 OwnPtr<RenderLayerStackingNode> m_stackingNode; 271 OwnPtr<RenderLayerStackingNode> m_stackingNode;
296 272
297 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of a c omposited layer's composited bounds compared to absolute coordinates. 273 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of a c omposited layer's composited bounds compared to absolute coordinates.
298 }; 274 };
299 275
300 } // namespace blink 276 } // namespace blink
301 277
302 #ifndef NDEBUG
303 // Outside the WebCore namespace for ease of invocation from gdb.
304 void showLayerTree(const blink::RenderLayer*);
305 void showLayerTree(const blink::RenderObject*);
306 #endif
307
308 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ 278 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698