Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 | 467 |
| 468 void filterNeedsRepaint(); | 468 void filterNeedsRepaint(); |
| 469 bool hasFilter() const { return renderer()->hasFilter(); } | 469 bool hasFilter() const { return renderer()->hasFilter(); } |
| 470 | 470 |
| 471 bool hasBlendMode() const; | 471 bool hasBlendMode() const; |
| 472 | 472 |
| 473 void* operator new(size_t); | 473 void* operator new(size_t); |
| 474 // Only safe to call from RenderLayerModelObject::destroyLayer() | 474 // Only safe to call from RenderLayerModelObject::destroyLayer() |
| 475 void operator delete(void*); | 475 void operator delete(void*); |
| 476 | 476 |
| 477 bool isComposited() const { return m_backing != 0; } | 477 CompositingState compositingState() const; |
| 478 | |
| 479 RenderLayerBacking* backing() const | |
| 480 { | |
| 481 // NOTE: Checking whether backing exists is equivalent to asking if you are in one of these two compositing states. | |
| 482 // If this is why you are using backing(), please try to use compo sitingState() instead. | |
| 483 ASSERT(compositingState() == HasOwnBackingButPaintsIntoAncestor || compo sitingState() == PaintsIntoOwnBacking); | |
| 484 return m_backing.get(); | |
| 485 } | |
| 486 | |
| 487 RenderLayerBacking* ensureBacking(); | |
| 488 void clearBacking(bool layerBeingDestroyed = false); | |
| 489 | |
| 478 bool hasCompositedMask() const; | 490 bool hasCompositedMask() const; |
| 479 bool hasCompositedClippingMask() const; | 491 bool hasCompositedClippingMask() const; |
| 480 RenderLayerBacking* backing() const { return m_backing.get(); } | |
| 481 RenderLayerBacking* ensureBacking(); | |
| 482 void clearBacking(bool layerBeingDestroyed = false); | |
| 483 bool needsCompositedScrolling() const; | 492 bool needsCompositedScrolling() const; |
| 484 bool needsToBeStackingContainer() const; | 493 bool needsToBeStackingContainer() const; |
| 485 | 494 |
| 486 RenderLayer* scrollParent() const; | 495 RenderLayer* scrollParent() const; |
| 487 RenderLayer* clipParent() const; | 496 RenderLayer* clipParent() const; |
| 488 | 497 |
| 489 bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const; | 498 bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const; |
| 490 bool needsCompositingLayersRebuiltForOverflow(const RenderStyle* oldStyle, c onst RenderStyle* newStyle) const; | 499 bool needsCompositingLayersRebuiltForOverflow(const RenderStyle* oldStyle, c onst RenderStyle* newStyle) const; |
| 491 bool needsCompositingLayersRebuiltForFilters(const RenderStyle* oldStyle, co nst RenderStyle* newStyle, bool didPaintWithFilters) const; | 500 bool needsCompositingLayersRebuiltForFilters(const RenderStyle* oldStyle, co nst RenderStyle* newStyle, bool didPaintWithFilters) const; |
| 492 | 501 |
| 493 bool paintsWithTransparency(PaintBehavior paintBehavior) const | 502 bool paintsWithTransparency(PaintBehavior paintBehavior) const |
| 494 { | 503 { |
| 495 return isTransparent() && ((paintBehavior & PaintBehaviorFlattenComposit ingLayers) || !isComposited()); | 504 // FIXME: shouldn't we return true if this layer has a backing but paint s into its ancestor? |
|
Ian Vollick
2013/10/01 19:46:22
This should return true everywhere opacity won't b
shawnsingh
2013/10/03 03:04:04
done.
| |
| 505 return isTransparent() && ((paintBehavior & PaintBehaviorFlattenComposit ingLayers) || !backing()); | |
| 496 } | 506 } |
| 497 | 507 |
| 498 bool paintsWithTransform(PaintBehavior) const; | 508 bool paintsWithTransform(PaintBehavior) const; |
| 499 | 509 |
| 500 // Returns true if background phase is painted opaque in the given rect. | 510 // Returns true if background phase is painted opaque in the given rect. |
| 501 // The query rect is given in local coordinates. | 511 // The query rect is given in local coordinates. |
| 502 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; | 512 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; |
| 503 | 513 |
| 504 bool containsDirtyOverlayScrollbars() const { return m_containsDirtyOverlayS crollbars; } | 514 bool containsDirtyOverlayScrollbars() const { return m_containsDirtyOverlayS crollbars; } |
| 505 void setContainsDirtyOverlayScrollbars(bool dirtyScrollbars) { m_containsDir tyOverlayScrollbars = dirtyScrollbars; } | 515 void setContainsDirtyOverlayScrollbars(bool dirtyScrollbars) { m_containsDir tyOverlayScrollbars = dirtyScrollbars; } |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1051 | 1061 |
| 1052 } // namespace WebCore | 1062 } // namespace WebCore |
| 1053 | 1063 |
| 1054 #ifndef NDEBUG | 1064 #ifndef NDEBUG |
| 1055 // Outside the WebCore namespace for ease of invocation from gdb. | 1065 // Outside the WebCore namespace for ease of invocation from gdb. |
| 1056 void showLayerTree(const WebCore::RenderLayer*); | 1066 void showLayerTree(const WebCore::RenderLayer*); |
| 1057 void showLayerTree(const WebCore::RenderObject*); | 1067 void showLayerTree(const WebCore::RenderObject*); |
| 1058 #endif | 1068 #endif |
| 1059 | 1069 |
| 1060 #endif // RenderLayer_h | 1070 #endif // RenderLayer_h |
| OLD | NEW |