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

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

Issue 768493002: Get rid of CompositingState. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix incorrect case. 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"
58 #include "sky/engine/platform/graphics/CompositingReasons.h" 57 #include "sky/engine/platform/graphics/CompositingReasons.h"
59 #include "sky/engine/public/platform/WebBlendMode.h" 58 #include "sky/engine/public/platform/WebBlendMode.h"
60 #include "sky/engine/wtf/OwnPtr.h" 59 #include "sky/engine/wtf/OwnPtr.h"
61 60
62 namespace blink { 61 namespace blink {
63 62
64 class FilterEffectRenderer; 63 class FilterEffectRenderer;
65 class FilterOperations; 64 class FilterOperations;
66 class HitTestRequest; 65 class HitTestRequest;
67 class HitTestResult; 66 class HitTestResult;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959 253 // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959
255 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D () == TransformStyle3DPreserve3D; } 254 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D () == TransformStyle3DPreserve3D; }
256 255
257 void filterNeedsPaintInvalidation(); 256 void filterNeedsPaintInvalidation();
258 bool hasFilter() const { return renderer()->hasFilter(); } 257 bool hasFilter() const { return renderer()->hasFilter(); }
259 258
260 void* operator new(size_t); 259 void* operator new(size_t);
261 // Only safe to call from RenderLayerModelObject::destroyLayer() 260 // Only safe to call from RenderLayerModelObject::destroyLayer()
262 void operator delete(void*); 261 void operator delete(void*);
263 262
264 // FIXME(sky): Remove
265 CompositingState compositingState() const { return NotComposited; }
266
267 GraphicsLayer* graphicsLayerBacking() const; 263 GraphicsLayer* graphicsLayerBacking() const;
268 264
269 bool hasCompositedMask() const; 265 bool hasCompositedMask() const;
270 bool hasCompositedClippingMask() const; 266 bool hasCompositedClippingMask() const;
271 bool needsCompositedScrolling() const { return m_scrollableArea && m_scrolla bleArea->needsCompositedScrolling(); } 267 bool needsCompositedScrolling() const { return m_scrollableArea && m_scrolla bleArea->needsCompositedScrolling(); }
272 268
273 bool clipsCompositingDescendantsWithBorderRadius() const; 269 bool clipsCompositingDescendantsWithBorderRadius() const;
274 270
275 // Computes the position of the given render object in the space of |paintIn validationContainer|. 271 // Computes the position of the given render object in the space of |paintIn validationContainer|.
276 // FIXME: invert the logic to have paint invalidation containers take care o f painting objects into them, rather than the reverse. 272 // FIXME: invert the logic to have paint invalidation containers take care o f painting objects into them, rather than the reverse.
277 // This will allow us to clean up this static method messiness. 273 // This will allow us to clean up this static method messiness.
278 static LayoutPoint positionFromPaintInvalidationContainer(const RenderObject *, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalida tionState* = 0); 274 static LayoutPoint positionFromPaintInvalidationContainer(const RenderObject *, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalida tionState* = 0);
279 275
280 static void mapRectToPaintBackingCoordinates(const RenderLayerModelObject* p aintInvalidationContainer, LayoutRect&); 276 static void mapRectToPaintBackingCoordinates(const RenderLayerModelObject* p aintInvalidationContainer, LayoutRect&);
281 277
282 // Adjusts the given rect (in the coordinate space of the RenderObject) to t he coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing. 278 // Adjusts the given rect (in the coordinate space of the RenderObject) to t he coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing.
283 static void mapRectToPaintInvalidationBacking(const RenderObject*, const Ren derLayerModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalid ationState* = 0); 279 static void mapRectToPaintInvalidationBacking(const RenderObject*, const Ren derLayerModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalid ationState* = 0);
284 280
285 // Computes the bounding paint invalidation rect for |renderObject|, in the coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing. 281 // Computes the bounding paint invalidation rect for |renderObject|, in the coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing.
286 static LayoutRect computePaintInvalidationRect(const RenderObject*, const Re nderLayer* paintInvalidationContainer, const PaintInvalidationState* = 0); 282 static LayoutRect computePaintInvalidationRect(const RenderObject*, const Re nderLayer* paintInvalidationContainer, const PaintInvalidationState* = 0);
287 283
288 bool paintsWithTransparency(PaintBehavior paintBehavior) const 284 bool paintsWithTransparency(PaintBehavior paintBehavior) const
289 { 285 {
290 return isTransparent() && ((paintBehavior & PaintBehaviorFlattenComposit ingLayers) || compositingState() != PaintsIntoOwnBacking); 286 // FIXME(sky): Remove
287 return isTransparent();
291 } 288 }
292 289
293 bool paintsWithTransform(PaintBehavior) const; 290 bool paintsWithTransform(PaintBehavior) const;
294 291
295 // Returns true if background phase is painted opaque in the given rect. 292 // Returns true if background phase is painted opaque in the given rect.
296 // The query rect is given in local coordinates. 293 // The query rect is given in local coordinates.
297 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; 294 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const;
298 295
299 bool containsDirtyOverlayScrollbars() const { return m_containsDirtyOverlayS crollbars; } 296 bool containsDirtyOverlayScrollbars() const { return m_containsDirtyOverlayS crollbars; }
300 void setContainsDirtyOverlayScrollbars(bool dirtyScrollbars) { m_containsDir tyOverlayScrollbars = dirtyScrollbars; } 297 void setContainsDirtyOverlayScrollbars(bool dirtyScrollbars) { m_containsDir tyOverlayScrollbars = dirtyScrollbars; }
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 updateHasSelfPaintingLayerDescendant(); 483 updateHasSelfPaintingLayerDescendant();
487 ASSERT(!m_hasSelfPaintingLayerDescendantDirty); 484 ASSERT(!m_hasSelfPaintingLayerDescendantDirty);
488 return m_hasSelfPaintingLayerDescendant; 485 return m_hasSelfPaintingLayerDescendant;
489 } 486 }
490 487
491 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } 488 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); }
492 489
493 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn fo&, PaintLayerFlags); 490 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn fo&, PaintLayerFlags);
494 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo &, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint()); 491 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo &, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint());
495 492
496 // Returns whether this layer should be painted during sofware painting (i.e ., not via calls from CompositedLayerMapping to draw into composited
497 // layers).
498 bool shouldPaintLayerInSoftwareMode(const LayerPaintingInfo&, PaintLayerFlag s paintFlags);
499
500 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa intingInfo&, PaintLayerFlags); 493 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa intingInfo&, PaintLayerFlags);
501 494
502 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, const L ayoutRect& dirtyRect, 495 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, const L ayoutRect& dirtyRect,
503 ClipRectsCacheSlot, ShouldRespectOverflowClip = RespectOverflowClip, con st LayoutPoint* offsetFromRoot = 0, 496 ClipRectsCacheSlot, ShouldRespectOverflowClip = RespectOverflowClip, con st LayoutPoint* offsetFromRoot = 0,
504 const LayoutSize& subPixelAccumulation = LayoutSize(), const LayoutRect* layerBoundingBox = 0); 497 const LayoutSize& subPixelAccumulation = LayoutSize(), const LayoutRect* layerBoundingBox = 0);
505 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo &, PaintLayerFlags, bool shouldPaintContent, const LayoutPoint* offsetFromRoot); 498 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo &, PaintLayerFlags, bool shouldPaintContent, const LayoutPoint* offsetFromRoot);
506 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, Gr aphicsContext* transparencyLayerContext, 499 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, Gr aphicsContext* transparencyLayerContext,
507 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, Pai ntLayerFlags); 500 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, Pai ntLayerFlags);
508 void paintForegroundForFragments(const LayerFragments&, GraphicsContext*, Gr aphicsContext* transparencyLayerContext, 501 void paintForegroundForFragments(const LayerFragments&, GraphicsContext*, Gr aphicsContext* transparencyLayerContext,
509 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, 502 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 623
631 } // namespace blink 624 } // namespace blink
632 625
633 #ifndef NDEBUG 626 #ifndef NDEBUG
634 // Outside the WebCore namespace for ease of invocation from gdb. 627 // Outside the WebCore namespace for ease of invocation from gdb.
635 void showLayerTree(const blink::RenderLayer*); 628 void showLayerTree(const blink::RenderLayer*);
636 void showLayerTree(const blink::RenderObject*); 629 void showLayerTree(const blink::RenderObject*);
637 #endif 630 #endif
638 631
639 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ 632 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698