Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / compositing / RenderLayerCompositor.h
index 4fc1a04..05cef85 100644 (file)
 #ifndef RenderLayerCompositor_h
 #define RenderLayerCompositor_h
 
-#include "core/page/ChromeClient.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/compositing/CompositingReasonFinder.h"
 #include "platform/graphics/GraphicsLayerClient.h"
 #include "wtf/HashMap.h"
 
-namespace WebCore {
+namespace blink {
 
+class DocumentLifecycle;
 class GraphicsLayer;
+class GraphicsLayerFactory;
+class Page;
 class RenderPart;
 class ScrollingCoordinator;
 
@@ -93,16 +95,6 @@ public:
 
     void didLayout();
 
-    enum UpdateLayerCompositingStateOptions {
-        Normal,
-        UseChickenEggHacks, // Use this to trigger temporary chicken-egg hacks. See crbug.com/339892.
-    };
-
-    // Update the compositing dirty bits, based on the compositing-impacting properties of the layer.
-    void updateLayerCompositingState(RenderLayer*, UpdateLayerCompositingStateOptions = Normal);
-
-    // Returns whether this layer is clipped by another layer that is not an ancestor of the given layer in the stacking context hierarchy.
-    bool clippedByNonAncestorInStackingTree(const RenderLayer*) const;
     // Whether layer's compositedLayerMapping needs a GraphicsLayer to clip z-order children of the given RenderLayer.
     bool clipsCompositingDescendants(const RenderLayer*) const;
 
@@ -114,11 +106,10 @@ public:
     GraphicsLayer* fixedRootBackgroundLayer() const;
     void setNeedsUpdateFixedBackground() { m_needsUpdateFixedBackground = true; }
 
-    // Repaint the appropriate layers when the given RenderLayer starts or stops being composited.
-    void repaintOnCompositingChange(RenderLayer*);
+    // Issue paint invalidations of the appropriate layers when the given RenderLayer starts or stops being composited.
+    void paintInvalidationOnCompositingChange(RenderLayer*);
 
-    void repaintInCompositedAncestor(RenderLayer*, const LayoutRect&);
-    void repaintCompositedLayers();
+    void fullyInvalidatePaint();
 
     RenderLayer* rootRenderLayer() const;
     GraphicsLayer* rootGraphicsLayer() const;
@@ -160,12 +151,13 @@ public:
     GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
     GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
 
-    void resetTrackedRepaintRects();
-    void setTracksRepaints(bool);
+    void resetTrackedPaintInvalidationRects();
+    void setTracksPaintInvalidations(bool);
 
     virtual String debugName(const GraphicsLayer*) OVERRIDE;
+    DocumentLifecycle& lifecycle() const;
 
-    void updateStyleDeterminedCompositingReasons(RenderLayer*);
+    void updatePotentialCompositingReasonsFromStyle(RenderLayer*);
 
     // Whether the layer could ever be composited.
     bool canBeComposited(const RenderLayer*) const;
@@ -183,27 +175,22 @@ public:
 private:
     class OverlapMap;
 
-#if ASSERT_ENABLED
+#if ENABLE(ASSERT)
     void assertNoUnresolvedDirtyBits();
 #endif
 
-    // Make updates to the layer based on viewport-constrained properties such as position:fixed. This can in turn affect
-    // compositing.
-    bool updateLayerIfViewportConstrained(RenderLayer*);
-
     // GraphicsLayerClient implementation
     virtual void notifyAnimationStarted(const GraphicsLayer*, double) OVERRIDE { }
     virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect&) OVERRIDE;
 
-    virtual bool isTrackingRepaints() const OVERRIDE;
+    virtual bool isTrackingPaintInvalidations() const OVERRIDE;
 
     // Whether the given RL needs to paint into its own separate backing (and hence would need its own CompositedLayerMapping).
     bool needsOwnBacking(const RenderLayer*) const;
 
+    void updateWithoutAcceleratedCompositing(CompositingUpdateType);
     void updateIfNeeded();
 
-    void recursiveRepaintLayer(RenderLayer*);
-
     void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*, OverlapMap&, struct CompositingRecursionData&, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclippedDescendants, IntRect& absoluteDecendantBoundingBox);
 
     bool hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const;
@@ -227,10 +214,6 @@ private:
     bool requiresVerticalScrollbarLayer() const;
     bool requiresScrollCornerLayer() const;
 
-    void applyUpdateLayerCompositingStateChickenEggHacks(RenderLayer*, CompositingStateTransitionType compositedLayerUpdate);
-
-    DocumentLifecycle& lifecycle() const;
-
     void applyOverlayFullscreenVideoAdjustment();
 
     RenderView& m_renderView;
@@ -253,7 +236,7 @@ private:
     // m_compositingDirty.
     bool m_rootShouldAlwaysCompositeDirty;
     bool m_needsUpdateFixedBackground;
-    bool m_isTrackingRepaints; // Used for testing.
+    bool m_isTrackingPaintInvalidations; // Used for testing.
 
     RootLayerAttachment m_rootLayerAttachment;
 
@@ -275,6 +258,6 @@ private:
     bool m_inOverlayFullscreenVideo;
 };
 
-} // namespace WebCore
+} // namespace blink
 
 #endif // RenderLayerCompositor_h