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

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

Issue 466193002: Disentangle blend mode from updateDescendantDependentFlags (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/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 30 matching lines...) Expand all
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/LayerFragment.h" 48 #include "core/rendering/LayerFragment.h"
49 #include "core/rendering/LayerPaintingInfo.h" 49 #include "core/rendering/LayerPaintingInfo.h"
50 #include "core/rendering/RenderBox.h" 50 #include "core/rendering/RenderBox.h"
51 #include "core/rendering/RenderLayerBlendInfo.h"
52 #include "core/rendering/RenderLayerClipper.h" 51 #include "core/rendering/RenderLayerClipper.h"
53 #include "core/rendering/RenderLayerFilterInfo.h" 52 #include "core/rendering/RenderLayerFilterInfo.h"
54 #include "core/rendering/RenderLayerReflectionInfo.h" 53 #include "core/rendering/RenderLayerReflectionInfo.h"
55 #include "core/rendering/RenderLayerRepainter.h" 54 #include "core/rendering/RenderLayerRepainter.h"
56 #include "core/rendering/RenderLayerScrollableArea.h" 55 #include "core/rendering/RenderLayerScrollableArea.h"
57 #include "core/rendering/RenderLayerStackingNode.h" 56 #include "core/rendering/RenderLayerStackingNode.h"
58 #include "core/rendering/RenderLayerStackingNodeIterator.h" 57 #include "core/rendering/RenderLayerStackingNodeIterator.h"
59 #include "platform/graphics/CompositingReasons.h" 58 #include "platform/graphics/CompositingReasons.h"
59 #include "public/platform/WebBlendMode.h"
60 #include "wtf/OwnPtr.h" 60 #include "wtf/OwnPtr.h"
61 61
62 namespace blink { 62 namespace blink {
63 63
64 class FilterEffectRenderer; 64 class FilterEffectRenderer;
65 class FilterOperations; 65 class FilterOperations;
66 class HitTestRequest; 66 class HitTestRequest;
67 class HitTestResult; 67 class HitTestResult;
68 class HitTestingTransformState; 68 class HitTestingTransformState;
69 class CompositedLayerMapping; 69 class CompositedLayerMapping;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 // FIXME: This is not in sync with containingBlock. 391 // FIXME: This is not in sync with containingBlock.
392 // RenderObject::canContainFixedPositionedObject() should probably be us ed 392 // RenderObject::canContainFixedPositionedObject() should probably be us ed
393 // instead. 393 // instead.
394 RenderLayerModelObject* layerRenderer = renderer(); 394 RenderLayerModelObject* layerRenderer = renderer();
395 return isRootLayer() || layerRenderer->isPositioned() || hasTransform(); 395 return isRootLayer() || layerRenderer->isPositioned() || hasTransform();
396 } 396 }
397 397
398 // paintLayer() assumes that the caller will clip to the bounds of the paint ing dirty if necessary. 398 // paintLayer() assumes that the caller will clip to the bounds of the paint ing dirty if necessary.
399 void paintLayer(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags) ; 399 void paintLayer(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags) ;
400 400
401 RenderLayerBlendInfo& blendInfo() { return m_blendInfo; }
402
403 bool scrollsOverflow() const; 401 bool scrollsOverflow() const;
404 402
405 CompositingReasons potentialCompositingReasonsFromStyle() const { return m_p otentialCompositingReasonsFromStyle; } 403 CompositingReasons potentialCompositingReasonsFromStyle() const { return m_p otentialCompositingReasonsFromStyle; }
406 void setPotentialCompositingReasonsFromStyle(CompositingReasons reasons) { A SSERT(reasons == (reasons & CompositingReasonComboAllStyleDeterminedReasons)); m _potentialCompositingReasonsFromStyle = reasons; } 404 void setPotentialCompositingReasonsFromStyle(CompositingReasons reasons) { A SSERT(reasons == (reasons & CompositingReasonComboAllStyleDeterminedReasons)); m _potentialCompositingReasonsFromStyle = reasons; }
407 405
408 bool hasStyleDeterminedDirectCompositingReasons() const { return m_potential CompositingReasonsFromStyle & CompositingReasonComboAllDirectStyleDeterminedReas ons; } 406 bool hasStyleDeterminedDirectCompositingReasons() const { return m_potential CompositingReasonsFromStyle & CompositingReasonComboAllDirectStyleDeterminedReas ons; }
409 407
410 class AncestorDependentCompositingInputs { 408 class AncestorDependentCompositingInputs {
411 public: 409 public:
412 AncestorDependentCompositingInputs() 410 AncestorDependentCompositingInputs()
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 // bounds of scrolling content for overlap the same way we're doing for 451 // bounds of scrolling content for overlap the same way we're doing for
454 // animation and only promote what's necessary. Once we're doing that, 452 // animation and only promote what's necessary. Once we're doing that,
455 // we won't need to use the "unclipped" concept for promotion any 453 // we won't need to use the "unclipped" concept for promotion any
456 // longer. 454 // longer.
457 unsigned isUnclippedDescendant : 1; 455 unsigned isUnclippedDescendant : 1;
458 unsigned hasAncestorWithClipPath : 1; 456 unsigned hasAncestorWithClipPath : 1;
459 }; 457 };
460 458
461 class DescendantDependentCompositingInputs { 459 class DescendantDependentCompositingInputs {
462 public: 460 public:
463 DescendantDependentCompositingInputs() : hasDescendantWithClipPath(false ) { } 461 DescendantDependentCompositingInputs()
462 : hasDescendantWithClipPath(false)
463 , hasDescendantWithBlendMode(false)
464 { }
465
464 unsigned hasDescendantWithClipPath : 1; 466 unsigned hasDescendantWithClipPath : 1;
467 unsigned hasDescendantWithBlendMode : 1;
465 }; 468 };
466 469
467 void setNeedsCompositingInputsUpdate(); 470 void setNeedsCompositingInputsUpdate();
468 bool childNeedsCompositingInputsUpdate() const { return m_childNeedsComposit ingInputsUpdate; } 471 bool childNeedsCompositingInputsUpdate() const { return m_childNeedsComposit ingInputsUpdate; }
469 bool needsCompositingInputsUpdate() const 472 bool needsCompositingInputsUpdate() const
470 { 473 {
471 // While we're updating the compositing inputs, these values may differ. 474 // While we're updating the compositing inputs, these values may differ.
472 // We should never be asking for this value when that is the case. 475 // We should never be asking for this value when that is the case.
473 ASSERT(m_needsDescendantDependentCompositingInputsUpdate == m_needsAnces torDependentCompositingInputsUpdate); 476 ASSERT(m_needsDescendantDependentCompositingInputsUpdate == m_needsAnces torDependentCompositingInputsUpdate);
474 return m_needsDescendantDependentCompositingInputsUpdate; 477 return m_needsDescendantDependentCompositingInputsUpdate;
(...skipping 10 matching lines...) Expand all
485 const RenderLayer* opacityAncestor() const { return ancestorDependentComposi tingInputs().opacityAncestor; } 488 const RenderLayer* opacityAncestor() const { return ancestorDependentComposi tingInputs().opacityAncestor; }
486 const RenderLayer* transformAncestor() const { return ancestorDependentCompo sitingInputs().transformAncestor; } 489 const RenderLayer* transformAncestor() const { return ancestorDependentCompo sitingInputs().transformAncestor; }
487 const RenderLayer* filterAncestor() const { return ancestorDependentComposit ingInputs().filterAncestor; } 490 const RenderLayer* filterAncestor() const { return ancestorDependentComposit ingInputs().filterAncestor; }
488 const RenderObject* clippingContainer() const { return ancestorDependentComp ositingInputs().clippingContainer; } 491 const RenderObject* clippingContainer() const { return ancestorDependentComp ositingInputs().clippingContainer; }
489 const RenderLayer* ancestorScrollingLayer() const { return ancestorDependent CompositingInputs().ancestorScrollingLayer; } 492 const RenderLayer* ancestorScrollingLayer() const { return ancestorDependent CompositingInputs().ancestorScrollingLayer; }
490 RenderLayer* scrollParent() const { return const_cast<RenderLayer*>(ancestor DependentCompositingInputs().scrollParent); } 493 RenderLayer* scrollParent() const { return const_cast<RenderLayer*>(ancestor DependentCompositingInputs().scrollParent); }
491 RenderLayer* clipParent() const { return const_cast<RenderLayer*>(ancestorDe pendentCompositingInputs().clipParent); } 494 RenderLayer* clipParent() const { return const_cast<RenderLayer*>(ancestorDe pendentCompositingInputs().clipParent); }
492 bool isUnclippedDescendant() const { return ancestorDependentCompositingInpu ts().isUnclippedDescendant; } 495 bool isUnclippedDescendant() const { return ancestorDependentCompositingInpu ts().isUnclippedDescendant; }
493 bool hasAncestorWithClipPath() const { return ancestorDependentCompositingIn puts().hasAncestorWithClipPath; } 496 bool hasAncestorWithClipPath() const { return ancestorDependentCompositingIn puts().hasAncestorWithClipPath; }
494 bool hasDescendantWithClipPath() const { return descendantDependentCompositi ngInputs().hasDescendantWithClipPath; } 497 bool hasDescendantWithClipPath() const { return descendantDependentCompositi ngInputs().hasDescendantWithClipPath; }
498 bool hasDescendantWithBlendMode() const { return descendantDependentComposit ingInputs().hasDescendantWithBlendMode; }
495 499
496 bool lostGroupedMapping() const { ASSERT(isAllowedToQueryCompositingState()) ; return m_lostGroupedMapping; } 500 bool lostGroupedMapping() const { ASSERT(isAllowedToQueryCompositingState()) ; return m_lostGroupedMapping; }
497 void setLostGroupedMapping(bool b) { m_lostGroupedMapping = b; } 501 void setLostGroupedMapping(bool b) { m_lostGroupedMapping = b; }
498 502
499 CompositingReasons compositingReasons() const { ASSERT(isAllowedToQueryCompo sitingState()); return m_compositingReasons; } 503 CompositingReasons compositingReasons() const { ASSERT(isAllowedToQueryCompo sitingState()); return m_compositingReasons; }
500 void setCompositingReasons(CompositingReasons, CompositingReasons mask = Com positingReasonAll); 504 void setCompositingReasons(CompositingReasons, CompositingReasons mask = Com positingReasonAll);
501 505
502 bool hasCompositingDescendant() const { ASSERT(isAllowedToQueryCompositingSt ate()); return m_hasCompositingDescendant; } 506 bool hasCompositingDescendant() const { ASSERT(isAllowedToQueryCompositingSt ate()); return m_hasCompositingDescendant; }
503 void setHasCompositingDescendant(bool); 507 void setHasCompositingDescendant(bool);
504 508
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 731
728 OwnPtr<CompositedLayerMapping> m_compositedLayerMapping; 732 OwnPtr<CompositedLayerMapping> m_compositedLayerMapping;
729 OwnPtr<RenderLayerScrollableArea> m_scrollableArea; 733 OwnPtr<RenderLayerScrollableArea> m_scrollableArea;
730 734
731 CompositedLayerMapping* m_groupedMapping; 735 CompositedLayerMapping* m_groupedMapping;
732 736
733 RenderLayerRepainter m_repainter; 737 RenderLayerRepainter m_repainter;
734 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? 738 RenderLayerClipper m_clipper; // FIXME: Lazily allocate?
735 OwnPtr<RenderLayerStackingNode> m_stackingNode; 739 OwnPtr<RenderLayerStackingNode> m_stackingNode;
736 OwnPtrWillBePersistent<RenderLayerReflectionInfo> m_reflectionInfo; 740 OwnPtrWillBePersistent<RenderLayerReflectionInfo> m_reflectionInfo;
737 RenderLayerBlendInfo m_blendInfo;
738 741
739 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of a c omposited layer's composited bounds compared to absolute coordinates. 742 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of a c omposited layer's composited bounds compared to absolute coordinates.
740 }; 743 };
741 744
742 } // namespace blink 745 } // namespace blink
743 746
744 #ifndef NDEBUG 747 #ifndef NDEBUG
745 // Outside the WebCore namespace for ease of invocation from gdb. 748 // Outside the WebCore namespace for ease of invocation from gdb.
746 void showLayerTree(const blink::RenderLayer*); 749 void showLayerTree(const blink::RenderLayer*);
747 void showLayerTree(const blink::RenderObject*); 750 void showLayerTree(const blink::RenderObject*);
748 #endif 751 #endif
749 752
750 #endif // RenderLayer_h 753 #endif // RenderLayer_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698