summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h')
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
index 569d69fa3..e438db0c4 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
@@ -25,11 +25,13 @@
#ifndef CCLayerTreeHostImpl_h
#define CCLayerTreeHostImpl_h
+#include "cc/CCAnimationEvents.h"
#include "cc/CCInputHandler.h"
#include "cc/CCLayerSorter.h"
#include "cc/CCLayerTreeHost.h"
#include "cc/CCLayerTreeHostCommon.h"
#include "cc/CCRenderPass.h"
+#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
@@ -48,6 +50,7 @@ public:
virtual void onSwapBuffersCompleteOnImplThread() = 0;
virtual void setNeedsRedrawOnImplThread() = 0;
virtual void setNeedsCommitOnImplThread() = 0;
+ virtual void postAnimationEventsToMainThreadOnImplThread(PassOwnPtr<CCAnimationEventsVector>) = 0;
};
// CCLayerTreeHostImpl owns the CCLayerImpl tree as well as associated rendering state
@@ -59,16 +62,15 @@ public:
// CCInputHandlerClient implementation
virtual void setNeedsRedraw();
- virtual CCInputHandlerClient::ScrollStatus scrollBegin(const IntPoint&);
+ virtual CCInputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, CCInputHandlerClient::ScrollInputType);
virtual void scrollBy(const IntSize&);
virtual void scrollEnd();
- virtual bool haveWheelEventHandlers();
virtual void pinchGestureBegin();
virtual void pinchGestureUpdate(float, const IntPoint&);
virtual void pinchGestureEnd();
virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anchorPoint, float pageScale, double startTimeMs, double durationMs);
- // Virtual for testing
+ // Virtual for testing.
virtual void beginCommit();
virtual void commitComplete();
virtual void animate(double frameDisplayTimeMs);
@@ -98,7 +100,6 @@ public:
bool visible() const { return m_visible; }
void setVisible(bool);
- void setHaveWheelEventHandlers(bool haveWheelEventHandlers) { m_haveWheelEventHandlers = haveWheelEventHandlers; }
int sourceFrameNumber() const { return m_sourceFrameNumber; }
void setSourceFrameNumber(int frameNumber) { m_sourceFrameNumber = frameNumber; }
@@ -113,8 +114,23 @@ public:
PassOwnPtr<CCScrollAndScaleSet> processScrollDeltas();
+ // Where possible, redraws are scissored to a damage region calculated from changes to
+ // layer properties. This function overrides the damage region for the next draw cycle.
+ void setFullRootLayerDamage();
+
+ void startPageScaleAnimation(const IntSize& tragetPosition, bool useAnchor, float scale, double durationSec);
+
+ bool needsAnimateLayers() const { return m_needsAnimateLayers; }
+ void setNeedsAnimateLayers() { m_needsAnimateLayers = true; }
+
protected:
CCLayerTreeHostImpl(const CCSettings&, CCLayerTreeHostImplClient*);
+
+ void animatePageScale(double frameBeginTimeMs);
+
+ // Virtual for testing.
+ virtual void animateLayers(double frameBeginTimeMs);
+
CCLayerTreeHostImplClient* m_client;
int m_sourceFrameNumber;
int m_frameNumber;
@@ -122,13 +138,18 @@ protected:
private:
typedef Vector<RefPtr<CCLayerImpl> > CCLayerList;
+ void computeDoubleTapZoomDeltas(CCScrollAndScaleSet* scrollInfo);
+ void computePinchZoomDeltas(CCScrollAndScaleSet* scrollInfo);
+ void makeScrollAndScaleSet(CCScrollAndScaleSet* scrollInfo, const IntSize& scrollOffset, float pageScale);
+
void setPageScaleDelta(float);
void applyPageScaleDeltaToScrollLayer();
void adjustScrollsForPageScaleChange(float);
void updateMaxScrollPosition();
void trackDamageForAllSurfaces(CCLayerImpl* rootDrawLayer, const CCLayerList& renderSurfaceLayerList);
- void calculateRenderPasses(CCRenderPassList&);
+ void calculateRenderPasses(CCRenderPassList&, CCLayerList& renderSurfaceLayerList);
void optimizeRenderPasses(CCRenderPassList&);
+ void animateLayersRecursive(CCLayerImpl*, double frameBeginTimeSecs, CCAnimationEventsVector&, bool& didAnimate, bool& needsAnimateLayers);
IntSize contentSize() const;
OwnPtr<LayerRendererChromium> m_layerRenderer;
@@ -137,14 +158,16 @@ private:
CCSettings m_settings;
IntSize m_viewportSize;
bool m_visible;
- bool m_haveWheelEventHandlers;
float m_pageScale;
float m_pageScaleDelta;
float m_sentPageScaleDelta;
float m_minPageScale, m_maxPageScale;
+ // If this is true, it is necessary to traverse the layer tree ticking the animators.
+ bool m_needsAnimateLayers;
bool m_pinchGestureActive;
+ IntPoint m_previousPinchAnchor;
OwnPtr<CCPageScaleAnimation> m_pageScaleAnimation;