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

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

Issue 953673002: Delete RenderLayerModelObject. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 | « sky/engine/core/rendering/RenderInline.cpp ('k') | 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 class HitTestingTransformState; 63 class HitTestingTransformState;
64 class RenderStyle; 64 class RenderStyle;
65 class TransformationMatrix; 65 class TransformationMatrix;
66 66
67 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelfForB orderRadius }; 67 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelfForB orderRadius };
68 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf }; 68 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf };
69 69
70 class RenderLayer { 70 class RenderLayer {
71 WTF_MAKE_NONCOPYABLE(RenderLayer); 71 WTF_MAKE_NONCOPYABLE(RenderLayer);
72 public: 72 public:
73 RenderLayer(RenderLayerModelObject*, LayerType); 73 RenderLayer(RenderBox*, LayerType);
74 ~RenderLayer(); 74 ~RenderLayer();
75 75
76 String debugName() const; 76 String debugName() const;
77 77
78 RenderLayerModelObject* renderer() const { return m_renderer; } 78 RenderBox* renderer() const { return m_renderer; }
79 RenderBox* renderBox() const { return m_renderer && m_renderer->isBox() ? to RenderBox(m_renderer) : 0; } 79 // FIXME(sky): Remove
80 RenderBox* renderBox() const { return m_renderer; }
80 RenderLayer* parent() const { return m_parent; } 81 RenderLayer* parent() const { return m_parent; }
81 RenderLayer* previousSibling() const { return m_previous; } 82 RenderLayer* previousSibling() const { return m_previous; }
82 RenderLayer* nextSibling() const { return m_next; } 83 RenderLayer* nextSibling() const { return m_next; }
83 RenderLayer* firstChild() const { return m_first; } 84 RenderLayer* firstChild() const { return m_first; }
84 RenderLayer* lastChild() const { return m_last; } 85 RenderLayer* lastChild() const { return m_last; }
85 86
86 void addChild(RenderLayer* newChild, RenderLayer* beforeChild = 0); 87 void addChild(RenderLayer* newChild, RenderLayer* beforeChild = 0);
87 RenderLayer* removeChild(RenderLayer*); 88 RenderLayer* removeChild(RenderLayer*);
88 89
89 void removeOnlyThisLayer(); 90 void removeOnlyThisLayer();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 bool has3DTransformedDescendant() const { return m_has3DTransformedDescendan t; } 183 bool has3DTransformedDescendant() const { return m_has3DTransformedDescendan t; }
183 // Both updates the status, and returns true if descendants of this have 3d. 184 // Both updates the status, and returns true if descendants of this have 3d.
184 bool update3DTransformedDescendantStatus(); 185 bool update3DTransformedDescendantStatus();
185 186
186 // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959 187 // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959
187 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D () == TransformStyle3DPreserve3D; } 188 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D () == TransformStyle3DPreserve3D; }
188 189
189 bool hasFilter() const { return renderer()->hasFilter(); } 190 bool hasFilter() const { return renderer()->hasFilter(); }
190 191
191 void* operator new(size_t); 192 void* operator new(size_t);
192 // Only safe to call from RenderLayerModelObject::destroyLayer() 193 // Only safe to call from RenderBox::destroyLayer()
193 void operator delete(void*); 194 void operator delete(void*);
194 195
195 bool paintsWithTransform() const; 196 bool paintsWithTransform() const;
196 197
197 FilterOperations computeFilterOperations(const RenderStyle*); 198 FilterOperations computeFilterOperations(const RenderStyle*);
198 bool paintsWithFilters() const; 199 bool paintsWithFilters() const;
199 bool requiresFullLayerImageForFilters() const; 200 bool requiresFullLayerImageForFilters() const;
200 FilterEffectRenderer* filterRenderer() const 201 FilterEffectRenderer* filterRenderer() const
201 { 202 {
202 RenderLayerFilterInfo* filterInfo = this->filterInfo(); 203 RenderLayerFilterInfo* filterInfo = this->filterInfo();
(...skipping 12 matching lines...) Expand all
215 void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo; } 216 void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo; }
216 217
217 void updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle) ; 218 void updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle) ;
218 219
219 RenderLayerClipper& clipper() { return m_clipper; } 220 RenderLayerClipper& clipper() { return m_clipper; }
220 const RenderLayerClipper& clipper() const { return m_clipper; } 221 const RenderLayerClipper& clipper() const { return m_clipper; }
221 222
222 inline bool isPositionedContainer() const 223 inline bool isPositionedContainer() const
223 { 224 {
224 // FIXME: This is not in sync with containingBlock. 225 // FIXME: This is not in sync with containingBlock.
225 RenderLayerModelObject* layerRenderer = renderer(); 226 RenderBox* layerRenderer = renderer();
226 return isRootLayer() || layerRenderer->isPositioned() || hasTransform(); 227 return isRootLayer() || layerRenderer->isPositioned() || hasTransform();
227 } 228 }
228 229
229 void updateOrRemoveFilterEffectRenderer(); 230 void updateOrRemoveFilterEffectRenderer();
230 void updateSelfPaintingLayer(); 231 void updateSelfPaintingLayer();
231 232
232 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&, BorderRadiusClippingRule = IncludeSelfForBorderRadius); 233 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&, BorderRadiusClippingRule = IncludeSelfForBorderRadius);
233 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); 234 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&);
234 235
235 private: 236 private:
(...skipping 16 matching lines...) Expand all
252 void updateHasSelfPaintingLayerDescendant() const; 253 void updateHasSelfPaintingLayerDescendant() const;
253 254
254 bool hasSelfPaintingLayerDescendant() const 255 bool hasSelfPaintingLayerDescendant() const
255 { 256 {
256 if (m_hasSelfPaintingLayerDescendantDirty) 257 if (m_hasSelfPaintingLayerDescendantDirty)
257 updateHasSelfPaintingLayerDescendant(); 258 updateHasSelfPaintingLayerDescendant();
258 ASSERT(!m_hasSelfPaintingLayerDescendantDirty); 259 ASSERT(!m_hasSelfPaintingLayerDescendantDirty);
259 return m_hasSelfPaintingLayerDescendant; 260 return m_hasSelfPaintingLayerDescendant;
260 } 261 }
261 262
262 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } 263 LayoutPoint renderBoxLocation() const { return renderer()->location(); }
263 264
264 bool shouldBeSelfPaintingLayer() const; 265 bool shouldBeSelfPaintingLayer() const;
265 266
266 // FIXME: We should only create the stacking node if needed. 267 // FIXME: We should only create the stacking node if needed.
267 bool requiresStackingNode() const { return true; } 268 bool requiresStackingNode() const { return true; }
268 void updateStackingNode(); 269 void updateStackingNode();
269 270
270 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); 271 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle);
271 272
272 void dirty3DTransformedDescendantStatus(); 273 void dirty3DTransformedDescendantStatus();
(...skipping 20 matching lines...) Expand all
293 // we ended up painting this layer or any desce ndants (and therefore need to 294 // we ended up painting this layer or any desce ndants (and therefore need to
294 // blend). 295 // blend).
295 296
296 unsigned m_3DTransformedDescendantStatusDirty : 1; 297 unsigned m_3DTransformedDescendantStatusDirty : 1;
297 // Set on a stacking context layer that has 3D descendants anywhere 298 // Set on a stacking context layer that has 3D descendants anywhere
298 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. 299 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing.
299 unsigned m_has3DTransformedDescendant : 1; 300 unsigned m_has3DTransformedDescendant : 1;
300 301
301 unsigned m_hasFilterInfo : 1; 302 unsigned m_hasFilterInfo : 1;
302 303
303 RenderLayerModelObject* m_renderer; 304 RenderBox* m_renderer;
304 305
305 RenderLayer* m_parent; 306 RenderLayer* m_parent;
306 RenderLayer* m_previous; 307 RenderLayer* m_previous;
307 RenderLayer* m_next; 308 RenderLayer* m_next;
308 RenderLayer* m_first; 309 RenderLayer* m_first;
309 RenderLayer* m_last; 310 RenderLayer* m_last;
310 311
311 OwnPtr<TransformationMatrix> m_transform; 312 OwnPtr<TransformationMatrix> m_transform;
312 313
313 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? 314 RenderLayerClipper m_clipper; // FIXME: Lazily allocate?
314 OwnPtr<RenderLayerStackingNode> m_stackingNode; 315 OwnPtr<RenderLayerStackingNode> m_stackingNode;
315 316
316 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of a c omposited layer's composited bounds compared to absolute coordinates. 317 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of a c omposited layer's composited bounds compared to absolute coordinates.
317 }; 318 };
318 319
319 } // namespace blink 320 } // namespace blink
320 321
321 #ifndef NDEBUG 322 #ifndef NDEBUG
322 // Outside the WebCore namespace for ease of invocation from gdb. 323 // Outside the WebCore namespace for ease of invocation from gdb.
323 void showLayerTree(const blink::RenderLayer*); 324 void showLayerTree(const blink::RenderLayer*);
324 void showLayerTree(const blink::RenderObject*); 325 void showLayerTree(const blink::RenderObject*);
325 #endif 326 #endif
326 327
327 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ 328 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderInline.cpp ('k') | sky/engine/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698