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

Side by Side Diff: Source/core/rendering/RenderLayer.h

Issue 58543002: Use a boolean hasCompositedLayerMapping() accessor instead of the pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update comment for hasCompositedLayerMapping Created 7 years, 1 month 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) 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 27 matching lines...) Expand all
38 * version of this file under the LGPL, indicate your decision by 38 * version of this file under the LGPL, indicate your decision by
39 * deletingthe provisions above and replace them with the notice and 39 * deletingthe provisions above and replace them with the notice and
40 * other provisions required by the MPL or the GPL, as the case may be. 40 * other provisions required by the MPL or the GPL, as the case may be.
41 * If you do not delete the provisions above, a recipient may use your 41 * If you do not delete the provisions above, a recipient may use your
42 * version of this file under any of the LGPL, the MPL or the GPL. 42 * version of this file under any of the LGPL, the MPL or the GPL.
43 */ 43 */
44 44
45 #ifndef RenderLayer_h 45 #ifndef RenderLayer_h
46 #define RenderLayer_h 46 #define RenderLayer_h
47 47
48 #include "core/rendering/CompositedLayerMappingPtr.h"
48 #include "core/rendering/CompositingReasons.h" 49 #include "core/rendering/CompositingReasons.h"
49 #include "core/rendering/LayerPaintingInfo.h" 50 #include "core/rendering/LayerPaintingInfo.h"
50 #include "core/rendering/PaintInfo.h" 51 #include "core/rendering/PaintInfo.h"
51 #include "core/rendering/RenderBox.h" 52 #include "core/rendering/RenderBox.h"
52 #include "core/rendering/RenderLayerClipper.h" 53 #include "core/rendering/RenderLayerClipper.h"
53 #include "core/rendering/RenderLayerReflectionInfo.h" 54 #include "core/rendering/RenderLayerReflectionInfo.h"
54 #include "core/rendering/RenderLayerRepainter.h" 55 #include "core/rendering/RenderLayerRepainter.h"
55 #include "core/rendering/RenderLayerScrollableArea.h" 56 #include "core/rendering/RenderLayerScrollableArea.h"
56 #include "core/rendering/RenderLayerStackingNode.h" 57 #include "core/rendering/RenderLayerStackingNode.h"
57 58
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 339
339 bool hasBlendMode() const; 340 bool hasBlendMode() const;
340 bool paintsWithBlendMode() const { return hasBlendMode() && compositingState () != PaintsIntoOwnBacking; } 341 bool paintsWithBlendMode() const { return hasBlendMode() && compositingState () != PaintsIntoOwnBacking; }
341 342
342 void* operator new(size_t); 343 void* operator new(size_t);
343 // Only safe to call from RenderLayerModelObject::destroyLayer() 344 // Only safe to call from RenderLayerModelObject::destroyLayer()
344 void operator delete(void*); 345 void operator delete(void*);
345 346
346 CompositingState compositingState() const; 347 CompositingState compositingState() const;
347 348
348 // NOTE: If you are accessing the CompositedLayerMapping as a boolean condit ion to determine the state of compositing for this layer, 349 CompositedLayerMappingPtr compositedLayerMapping() const { return m_composit edLayerMapping.get(); }
350 CompositedLayerMappingPtr ensureCompositedLayerMapping();
351
352 // NOTE: If you are using hasCompositedLayerMapping to determine the state o f compositing for this layer,
353 // (and not just to do bookkeeping related to the mapping like, say, allocat ing or deallocating a mapping),
349 // then you may have incorrect logic. Use compositingState() instead. 354 // then you may have incorrect logic. Use compositingState() instead.
350 CompositedLayerMapping* compositedLayerMapping() const { return m_composited LayerMapping.get(); } 355 bool hasCompositedLayerMapping() const { return m_compositedLayerMapping.get (); }
351 CompositedLayerMapping* ensureCompositedLayerMapping();
352 void clearCompositedLayerMapping(bool layerBeingDestroyed = false); 356 void clearCompositedLayerMapping(bool layerBeingDestroyed = false);
353 357
354 bool hasCompositedMask() const; 358 bool hasCompositedMask() const;
355 bool hasCompositedClippingMask() const; 359 bool hasCompositedClippingMask() const;
356 bool needsCompositedScrolling() const { return m_scrollableArea && m_scrolla bleArea->needsCompositedScrolling(); } 360 bool needsCompositedScrolling() const { return m_scrollableArea && m_scrolla bleArea->needsCompositedScrolling(); }
357 361
358 RenderLayer* scrollParent() const; 362 RenderLayer* scrollParent() const;
359 RenderLayer* clipParent() const; 363 RenderLayer* clipParent() const;
360 364
361 bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const; 365 bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const;
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 735
732 } // namespace WebCore 736 } // namespace WebCore
733 737
734 #ifndef NDEBUG 738 #ifndef NDEBUG
735 // Outside the WebCore namespace for ease of invocation from gdb. 739 // Outside the WebCore namespace for ease of invocation from gdb.
736 void showLayerTree(const WebCore::RenderLayer*); 740 void showLayerTree(const WebCore::RenderLayer*);
737 void showLayerTree(const WebCore::RenderObject*); 741 void showLayerTree(const WebCore::RenderObject*);
738 #endif 742 #endif
739 743
740 #endif // RenderLayer_h 744 #endif // RenderLayer_h
OLDNEW
« no previous file with comments | « Source/core/rendering/CompositedLayerMappingPtr.h ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698