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

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

Issue 758843004: Delete most of rendering/compositing. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 #include "sky/engine/core/rendering/LayerFragment.h" 48 #include "sky/engine/core/rendering/LayerFragment.h"
49 #include "sky/engine/core/rendering/LayerPaintingInfo.h" 49 #include "sky/engine/core/rendering/LayerPaintingInfo.h"
50 #include "sky/engine/core/rendering/RenderBox.h" 50 #include "sky/engine/core/rendering/RenderBox.h"
51 #include "sky/engine/core/rendering/RenderLayerClipper.h" 51 #include "sky/engine/core/rendering/RenderLayerClipper.h"
52 #include "sky/engine/core/rendering/RenderLayerFilterInfo.h" 52 #include "sky/engine/core/rendering/RenderLayerFilterInfo.h"
53 #include "sky/engine/core/rendering/RenderLayerRepainter.h" 53 #include "sky/engine/core/rendering/RenderLayerRepainter.h"
54 #include "sky/engine/core/rendering/RenderLayerScrollableArea.h" 54 #include "sky/engine/core/rendering/RenderLayerScrollableArea.h"
55 #include "sky/engine/core/rendering/RenderLayerStackingNode.h" 55 #include "sky/engine/core/rendering/RenderLayerStackingNode.h"
56 #include "sky/engine/core/rendering/RenderLayerStackingNodeIterator.h" 56 #include "sky/engine/core/rendering/RenderLayerStackingNodeIterator.h"
57 #include "sky/engine/core/rendering/compositing/CompositingState.h"
57 #include "sky/engine/platform/graphics/CompositingReasons.h" 58 #include "sky/engine/platform/graphics/CompositingReasons.h"
58 #include "sky/engine/public/platform/WebBlendMode.h" 59 #include "sky/engine/public/platform/WebBlendMode.h"
59 #include "sky/engine/wtf/OwnPtr.h" 60 #include "sky/engine/wtf/OwnPtr.h"
60 61
61 namespace blink { 62 namespace blink {
62 63
63 class FilterEffectRenderer; 64 class FilterEffectRenderer;
64 class FilterOperations; 65 class FilterOperations;
65 class HitTestRequest; 66 class HitTestRequest;
66 class HitTestResult; 67 class HitTestResult;
67 class HitTestingTransformState; 68 class HitTestingTransformState;
68 class RenderLayerCompositor;
69 class RenderStyle; 69 class RenderStyle;
70 class TransformationMatrix; 70 class TransformationMatrix;
71 71
72 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelfForB orderRadius }; 72 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelfForB orderRadius };
73 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf }; 73 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf };
74 74
75 enum CompositingQueryMode { 75 enum CompositingQueryMode {
76 CompositingQueriesAreAllowed, 76 CompositingQueriesAreAllowed,
77 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases 77 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases
78 }; 78 };
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return curr; 129 return curr;
130 } 130 }
131 131
132 LayoutPoint location() const; 132 LayoutPoint location() const;
133 IntSize size() const; 133 IntSize size() const;
134 134
135 LayoutRect rect() const { return LayoutRect(location(), size()); } 135 LayoutRect rect() const { return LayoutRect(location(), size()); }
136 136
137 bool isRootLayer() const { return m_isRootLayer; } 137 bool isRootLayer() const { return m_isRootLayer; }
138 138
139 RenderLayerCompositor* compositor() const;
140
141 // Notification from the renderer that its content changed (e.g. current fra me of image changed). 139 // Notification from the renderer that its content changed (e.g. current fra me of image changed).
142 // Allows updates of layer content without invalidating paint. 140 // Allows updates of layer content without invalidating paint.
143 void contentChanged(ContentChangeType); 141 void contentChanged(ContentChangeType);
144 142
145 void updateLayerPositionsAfterLayout(); 143 void updateLayerPositionsAfterLayout();
146 144
147 void updateTransformationMatrix(); 145 void updateTransformationMatrix();
148 RenderLayer* renderingContextRoot(); 146 RenderLayer* renderingContextRoot();
149 147
150 // Our current relative position offset. 148 // Our current relative position offset.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959 254 // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959
257 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D () == TransformStyle3DPreserve3D; } 255 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D () == TransformStyle3DPreserve3D; }
258 256
259 void filterNeedsPaintInvalidation(); 257 void filterNeedsPaintInvalidation();
260 bool hasFilter() const { return renderer()->hasFilter(); } 258 bool hasFilter() const { return renderer()->hasFilter(); }
261 259
262 void* operator new(size_t); 260 void* operator new(size_t);
263 // Only safe to call from RenderLayerModelObject::destroyLayer() 261 // Only safe to call from RenderLayerModelObject::destroyLayer()
264 void operator delete(void*); 262 void operator delete(void*);
265 263
266 CompositingState compositingState() const; 264 // FIXME(sky): Remove
267 265 CompositingState compositingState() const { return NotComposited; }
268 // This returns true if our document is in a phase of its lifestyle during w hich
269 // compositing state may legally be read.
270 bool isAllowedToQueryCompositingState() const;
271 266
272 GraphicsLayer* graphicsLayerBacking() const; 267 GraphicsLayer* graphicsLayerBacking() const;
273 268
274 bool hasCompositedMask() const; 269 bool hasCompositedMask() const;
275 bool hasCompositedClippingMask() const; 270 bool hasCompositedClippingMask() const;
276 bool needsCompositedScrolling() const { return m_scrollableArea && m_scrolla bleArea->needsCompositedScrolling(); } 271 bool needsCompositedScrolling() const { return m_scrollableArea && m_scrolla bleArea->needsCompositedScrolling(); }
277 272
278 bool clipsCompositingDescendantsWithBorderRadius() const; 273 bool clipsCompositingDescendantsWithBorderRadius() const;
279 274
280 // Computes the position of the given render object in the space of |paintIn validationContainer|. 275 // Computes the position of the given render object in the space of |paintIn validationContainer|.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 bool needsCompositingInputsUpdate() const 415 bool needsCompositingInputsUpdate() const
421 { 416 {
422 // While we're updating the compositing inputs, these values may differ. 417 // While we're updating the compositing inputs, these values may differ.
423 // We should never be asking for this value when that is the case. 418 // We should never be asking for this value when that is the case.
424 ASSERT(m_needsDescendantDependentCompositingInputsUpdate == m_needsAnces torDependentCompositingInputsUpdate); 419 ASSERT(m_needsDescendantDependentCompositingInputsUpdate == m_needsAnces torDependentCompositingInputsUpdate);
425 return m_needsDescendantDependentCompositingInputsUpdate; 420 return m_needsDescendantDependentCompositingInputsUpdate;
426 } 421 }
427 422
428 void updateAncestorDependentCompositingInputs(const AncestorDependentComposi tingInputs&); 423 void updateAncestorDependentCompositingInputs(const AncestorDependentComposi tingInputs&);
429 void updateDescendantDependentCompositingInputs(const DescendantDependentCom positingInputs&); 424 void updateDescendantDependentCompositingInputs(const DescendantDependentCom positingInputs&);
430 void didUpdateCompositingInputs();
431 425
432 const AncestorDependentCompositingInputs& ancestorDependentCompositingInputs () const { ASSERT(!m_needsAncestorDependentCompositingInputsUpdate); return m_an cestorDependentCompositingInputs; } 426 const AncestorDependentCompositingInputs& ancestorDependentCompositingInputs () const { ASSERT(!m_needsAncestorDependentCompositingInputsUpdate); return m_an cestorDependentCompositingInputs; }
433 const DescendantDependentCompositingInputs& descendantDependentCompositingIn puts() const { ASSERT(!m_needsDescendantDependentCompositingInputsUpdate); retur n m_descendantDependentCompositingInputs; } 427 const DescendantDependentCompositingInputs& descendantDependentCompositingIn puts() const { ASSERT(!m_needsDescendantDependentCompositingInputsUpdate); retur n m_descendantDependentCompositingInputs; }
434 428
435 IntRect clippedAbsoluteBoundingBox() const { return ancestorDependentComposi tingInputs().clippedAbsoluteBoundingBox; } 429 IntRect clippedAbsoluteBoundingBox() const { return ancestorDependentComposi tingInputs().clippedAbsoluteBoundingBox; }
436 const RenderLayer* opacityAncestor() const { return ancestorDependentComposi tingInputs().opacityAncestor; } 430 const RenderLayer* opacityAncestor() const { return ancestorDependentComposi tingInputs().opacityAncestor; }
437 const RenderLayer* transformAncestor() const { return ancestorDependentCompo sitingInputs().transformAncestor; } 431 const RenderLayer* transformAncestor() const { return ancestorDependentCompo sitingInputs().transformAncestor; }
438 const RenderLayer* filterAncestor() const { return ancestorDependentComposit ingInputs().filterAncestor; } 432 const RenderLayer* filterAncestor() const { return ancestorDependentComposit ingInputs().filterAncestor; }
439 const RenderObject* clippingContainer() const { return ancestorDependentComp ositingInputs().clippingContainer; } 433 const RenderObject* clippingContainer() const { return ancestorDependentComp ositingInputs().clippingContainer; }
440 const RenderLayer* ancestorScrollingLayer() const { return ancestorDependent CompositingInputs().ancestorScrollingLayer; } 434 const RenderLayer* ancestorScrollingLayer() const { return ancestorDependent CompositingInputs().ancestorScrollingLayer; }
441 RenderLayer* scrollParent() const { return const_cast<RenderLayer*>(ancestor DependentCompositingInputs().scrollParent); } 435 RenderLayer* scrollParent() const { return const_cast<RenderLayer*>(ancestor DependentCompositingInputs().scrollParent); }
442 RenderLayer* clipParent() const { return const_cast<RenderLayer*>(ancestorDe pendentCompositingInputs().clipParent); } 436 RenderLayer* clipParent() const { return const_cast<RenderLayer*>(ancestorDe pendentCompositingInputs().clipParent); }
443 bool isUnclippedDescendant() const { return ancestorDependentCompositingInpu ts().isUnclippedDescendant; } 437 bool isUnclippedDescendant() const { return ancestorDependentCompositingInpu ts().isUnclippedDescendant; }
444 bool hasAncestorWithClipPath() const { return ancestorDependentCompositingIn puts().hasAncestorWithClipPath; } 438 bool hasAncestorWithClipPath() const { return ancestorDependentCompositingIn puts().hasAncestorWithClipPath; }
445 bool hasDescendantWithClipPath() const { return descendantDependentCompositi ngInputs().hasDescendantWithClipPath; } 439 bool hasDescendantWithClipPath() const { return descendantDependentCompositi ngInputs().hasDescendantWithClipPath; }
446 440
447 bool lostGroupedMapping() const { ASSERT(isAllowedToQueryCompositingState()) ; return m_lostGroupedMapping; } 441 bool lostGroupedMapping() const { return m_lostGroupedMapping; }
448 void setLostGroupedMapping(bool b) { m_lostGroupedMapping = b; } 442 void setLostGroupedMapping(bool b) { m_lostGroupedMapping = b; }
449 443
450 CompositingReasons compositingReasons() const { ASSERT(isAllowedToQueryCompo sitingState()); return m_compositingReasons; } 444 CompositingReasons compositingReasons() const { return m_compositingReasons; }
451 void setCompositingReasons(CompositingReasons, CompositingReasons mask = Com positingReasonAll); 445 void setCompositingReasons(CompositingReasons, CompositingReasons mask = Com positingReasonAll);
452 446
453 bool hasCompositingDescendant() const { ASSERT(isAllowedToQueryCompositingSt ate()); return m_hasCompositingDescendant; } 447 bool hasCompositingDescendant() const { return m_hasCompositingDescendant; }
454 void setHasCompositingDescendant(bool); 448 void setHasCompositingDescendant(bool);
455 449
456 void updateOrRemoveFilterEffectRenderer(); 450 void updateOrRemoveFilterEffectRenderer();
457 451
458 void updateSelfPaintingLayer(); 452 void updateSelfPaintingLayer();
459 453
460 // paintLayerContents() assumes that the caller will clip to the bounds of t he painting dirty rect if necessary. 454 // paintLayerContents() assumes that the caller will clip to the bounds of t he painting dirty rect if necessary.
461 void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLay erFlags); 455 void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLay erFlags);
462 456
463 RenderLayer* enclosingTransformedAncestor() const; 457 RenderLayer* enclosingTransformedAncestor() const;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 539
546 // FIXME: We should only create the stacking node if needed. 540 // FIXME: We should only create the stacking node if needed.
547 bool requiresStackingNode() const { return true; } 541 bool requiresStackingNode() const { return true; }
548 void updateStackingNode(); 542 void updateStackingNode();
549 543
550 // FIXME: We could lazily allocate our ScrollableArea based on style propert ies ('overflow', ...) 544 // FIXME: We could lazily allocate our ScrollableArea based on style propert ies ('overflow', ...)
551 // but for now, we are always allocating it for RenderBox as it's safer. 545 // but for now, we are always allocating it for RenderBox as it's safer.
552 bool requiresScrollableArea() const { return renderBox(); } 546 bool requiresScrollableArea() const { return renderBox(); }
553 void updateScrollableArea(); 547 void updateScrollableArea();
554 548
555 bool attemptDirectCompositingUpdate(StyleDifference, const RenderStyle* oldS tyle);
556 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); 549 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle);
557 550
558 void dirty3DTransformedDescendantStatus(); 551 void dirty3DTransformedDescendantStatus();
559 // Both updates the status, and returns true if descendants of this have 3d. 552 // Both updates the status, and returns true if descendants of this have 3d.
560 bool update3DTransformedDescendantStatus(); 553 bool update3DTransformedDescendantStatus();
561 554
562 void updateOrRemoveFilterClients(); 555 void updateOrRemoveFilterClients();
563 556
564 LayoutRect paintingExtent(const RenderLayer* rootLayer, const LayoutRect& pa intDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior); 557 LayoutRect paintingExtent(const RenderLayer* rootLayer, const LayoutRect& pa intDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior);
565 558
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 630
638 } // namespace blink 631 } // namespace blink
639 632
640 #ifndef NDEBUG 633 #ifndef NDEBUG
641 // Outside the WebCore namespace for ease of invocation from gdb. 634 // Outside the WebCore namespace for ease of invocation from gdb.
642 void showLayerTree(const blink::RenderLayer*); 635 void showLayerTree(const blink::RenderLayer*);
643 void showLayerTree(const blink::RenderObject*); 636 void showLayerTree(const blink::RenderObject*);
644 #endif 637 #endif
645 638
646 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ 639 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698