Index: cc/layer_tree_host_impl.h |
diff --git a/cc/layer_tree_host_impl.h b/cc/layer_tree_host_impl.h |
index 2ec01bee699e0741ba55b4119a8d742e54d89605..0e39f8fb8be265479148cf00c8a8aeb1daa75b85 100644 |
--- a/cc/layer_tree_host_impl.h |
+++ b/cc/layer_tree_host_impl.h |
@@ -19,20 +19,20 @@ |
namespace cc { |
-class CCCompletionEvent; |
-class CCDebugRectHistory; |
-class CCFrameRateCounter; |
-class CCHeadsUpDisplayLayerImpl; |
-class CCLayerImpl; |
-class CCLayerTreeHostImplTimeSourceAdapter; |
-class CCPageScaleAnimation; |
-class CCRenderPassDrawQuad; |
-class CCResourceProvider; |
+class CompletionEvent; |
+class DebugRectHistory; |
+class FrameRateCounter; |
+class HeadsUpDisplayLayerImpl; |
+class LayerImpl; |
+class LayerTreeHostImplTimeSourceAdapter; |
+class PageScaleAnimation; |
+class RenderPassDrawQuad; |
+class ResourceProvider; |
struct RendererCapabilities; |
-struct CCRenderingStats; |
+struct RenderingStats; |
-// CCLayerTreeHost->CCProxy callback interface. |
-class CCLayerTreeHostImplClient { |
+// LayerTreeHost->Proxy callback interface. |
+class LayerTreeHostImplClient { |
public: |
virtual void didLoseContextOnImplThread() = 0; |
virtual void onSwapBuffersCompleteOnImplThread() = 0; |
@@ -40,17 +40,17 @@ public: |
virtual void onCanDrawStateChanged(bool canDraw) = 0; |
virtual void setNeedsRedrawOnImplThread() = 0; |
virtual void setNeedsCommitOnImplThread() = 0; |
- virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<CCAnimationEventsVector>, double wallClockTime) = 0; |
+ virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, double wallClockTime) = 0; |
// Returns true if resources were deleted by this call. |
virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes) = 0; |
}; |
-// CCPinchZoomViewport models the bounds and offset of the viewport that is used during a pinch-zoom operation. |
+// PinchZoomViewport models the bounds and offset of the viewport that is used during a pinch-zoom operation. |
// It tracks the layout-space dimensions of the viewport before any applied scale, and then tracks the layout-space |
// coordinates of the viewport respecting the pinch settings. |
-class CCPinchZoomViewport { |
+class PinchZoomViewport { |
public: |
- CCPinchZoomViewport(); |
+ PinchZoomViewport(); |
float totalPageScaleFactor() const; |
@@ -96,18 +96,18 @@ private: |
FloatSize m_layoutViewportSize; |
}; |
-// CCLayerTreeHostImpl owns the CCLayerImpl tree as well as associated rendering state |
-class CCLayerTreeHostImpl : public CCInputHandlerClient, |
- public CCRendererClient, |
+// LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering state |
+class LayerTreeHostImpl : public InputHandlerClient, |
+ public RendererClient, |
public WebKit::WebCompositorOutputSurfaceClient { |
- typedef std::vector<CCLayerImpl*> CCLayerList; |
+ typedef std::vector<LayerImpl*> LayerList; |
public: |
- static scoped_ptr<CCLayerTreeHostImpl> create(const CCLayerTreeSettings&, CCLayerTreeHostImplClient*); |
- virtual ~CCLayerTreeHostImpl(); |
+ static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerTreeHostImplClient*); |
+ virtual ~LayerTreeHostImpl(); |
- // CCInputHandlerClient implementation |
- virtual CCInputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, CCInputHandlerClient::ScrollInputType) OVERRIDE; |
+ // InputHandlerClient implementation |
+ virtual InputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, InputHandlerClient::ScrollInputType) OVERRIDE; |
virtual void scrollBy(const IntPoint&, const IntSize&) OVERRIDE; |
virtual void scrollEnd() OVERRIDE; |
virtual void pinchGestureBegin() OVERRIDE; |
@@ -116,18 +116,18 @@ public: |
virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anchorPoint, float pageScale, double startTime, double duration) OVERRIDE; |
virtual void scheduleAnimation() OVERRIDE; |
- struct FrameData : public CCRenderPassSink { |
+ struct FrameData : public RenderPassSink { |
FrameData(); |
~FrameData(); |
Vector<IntRect> occludingScreenSpaceRects; |
- CCRenderPassList renderPasses; |
- CCRenderPassIdHashMap renderPassesById; |
- CCLayerList* renderSurfaceLayerList; |
- CCLayerList willDrawLayers; |
+ RenderPassList renderPasses; |
+ RenderPassIdHashMap renderPassesById; |
+ LayerList* renderSurfaceLayerList; |
+ LayerList willDrawLayers; |
- // CCRenderPassSink implementation. |
- virtual void appendRenderPass(scoped_ptr<CCRenderPass>) OVERRIDE; |
+ // RenderPassSink implementation. |
+ virtual void appendRenderPass(scoped_ptr<RenderPass>) OVERRIDE; |
}; |
// Virtual for testing. |
@@ -144,9 +144,9 @@ public: |
// Must be called if and only if prepareToDraw was called. |
void didDrawAllLayers(const FrameData&); |
- // CCRendererClient implementation |
+ // RendererClient implementation |
virtual const IntSize& deviceViewportSize() const OVERRIDE; |
- virtual const CCLayerTreeSettings& settings() const OVERRIDE; |
+ virtual const LayerTreeSettings& settings() const OVERRIDE; |
virtual void didLoseContext() OVERRIDE; |
virtual void onSwapBuffersComplete() OVERRIDE; |
virtual void setFullRootLayerDamage() OVERRIDE; |
@@ -157,33 +157,33 @@ public: |
// Implementation |
bool canDraw(); |
- CCGraphicsContext* context() const; |
+ GraphicsContext* context() const; |
std::string layerTreeAsText() const; |
void finishAllRendering(); |
int sourceAnimationFrameNumber() const; |
- bool initializeRenderer(scoped_ptr<CCGraphicsContext>); |
+ bool initializeRenderer(scoped_ptr<GraphicsContext>); |
bool isContextLost(); |
- CCRenderer* renderer() { return m_renderer.get(); } |
+ Renderer* renderer() { return m_renderer.get(); } |
const RendererCapabilities& rendererCapabilities() const; |
bool swapBuffers(); |
void readback(void* pixels, const IntRect&); |
- void setRootLayer(scoped_ptr<CCLayerImpl>); |
- CCLayerImpl* rootLayer() { return m_rootLayerImpl.get(); } |
+ void setRootLayer(scoped_ptr<LayerImpl>); |
+ LayerImpl* rootLayer() { return m_rootLayerImpl.get(); } |
- void setHudLayer(CCHeadsUpDisplayLayerImpl* layerImpl) { m_hudLayerImpl = layerImpl; } |
- CCHeadsUpDisplayLayerImpl* hudLayer() { return m_hudLayerImpl; } |
+ void setHudLayer(HeadsUpDisplayLayerImpl* layerImpl) { m_hudLayerImpl = layerImpl; } |
+ HeadsUpDisplayLayerImpl* hudLayer() { return m_hudLayerImpl; } |
// Release ownership of the current layer tree and replace it with an empty |
// tree. Returns the root layer of the detached tree. |
- scoped_ptr<CCLayerImpl> detachLayerTree(); |
+ scoped_ptr<LayerImpl> detachLayerTree(); |
- CCLayerImpl* rootScrollLayer() const { return m_rootScrollLayerImpl; } |
+ LayerImpl* rootScrollLayer() const { return m_rootScrollLayerImpl; } |
bool visible() const { return m_visible; } |
void setVisible(bool); |
@@ -206,7 +206,7 @@ public: |
float pageScaleFactor() const; |
void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFactor, float maxPageScaleFactor); |
- scoped_ptr<CCScrollAndScaleSet> processScrollDeltas(); |
+ scoped_ptr<ScrollAndScaleSet> processScrollDeltas(); |
WebKit::WebTransformationMatrix implTransform() const; |
void startPageScaleAnimation(const IntSize& tragetPosition, bool useAnchor, float scale, double durationSec); |
@@ -222,38 +222,38 @@ public: |
void setNeedsRedraw(); |
- void renderingStats(CCRenderingStats*) const; |
+ void renderingStats(RenderingStats*) const; |
void updateRootScrollLayerImplTransform(); |
- CCFrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } |
- CCDebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get(); } |
- CCResourceProvider* resourceProvider() const { return m_resourceProvider.get(); } |
+ FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } |
+ DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get(); } |
+ ResourceProvider* resourceProvider() const { return m_resourceProvider.get(); } |
class CullRenderPassesWithCachedTextures { |
public: |
- bool shouldRemoveRenderPass(const CCRenderPassDrawQuad&, const FrameData&) const; |
+ bool shouldRemoveRenderPass(const RenderPassDrawQuad&, const FrameData&) const; |
// Iterates from the root first, in order to remove the surfaces closest |
// to the root with cached textures, and all surfaces that draw into |
// them. |
- size_t renderPassListBegin(const CCRenderPassList& list) const { return list.size() - 1; } |
- size_t renderPassListEnd(const CCRenderPassList&) const { return 0 - 1; } |
+ size_t renderPassListBegin(const RenderPassList& list) const { return list.size() - 1; } |
+ size_t renderPassListEnd(const RenderPassList&) const { return 0 - 1; } |
size_t renderPassListNext(size_t it) const { return it - 1; } |
- CullRenderPassesWithCachedTextures(CCRenderer& renderer) : m_renderer(renderer) { } |
+ CullRenderPassesWithCachedTextures(Renderer& renderer) : m_renderer(renderer) { } |
private: |
- CCRenderer& m_renderer; |
+ Renderer& m_renderer; |
}; |
class CullRenderPassesWithNoQuads { |
public: |
- bool shouldRemoveRenderPass(const CCRenderPassDrawQuad&, const FrameData&) const; |
+ bool shouldRemoveRenderPass(const RenderPassDrawQuad&, const FrameData&) const; |
// Iterates in draw order, so that when a surface is removed, and its |
// target becomes empty, then its target can be removed also. |
- size_t renderPassListBegin(const CCRenderPassList&) const { return 0; } |
- size_t renderPassListEnd(const CCRenderPassList& list) const { return list.size(); } |
+ size_t renderPassListBegin(const RenderPassList&) const { return 0; } |
+ size_t renderPassListEnd(const RenderPassList& list) const { return list.size(); } |
size_t renderPassListNext(size_t it) const { return it + 1; } |
}; |
@@ -261,13 +261,13 @@ public: |
static void removeRenderPasses(RenderPassCuller, FrameData&); |
protected: |
- CCLayerTreeHostImpl(const CCLayerTreeSettings&, CCLayerTreeHostImplClient*); |
+ LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*); |
void animatePageScale(double monotonicTime); |
void animateScrollbars(double monotonicTime); |
// Exposed for testing. |
- void calculateRenderSurfaceLayerList(CCLayerList&); |
+ void calculateRenderSurfaceLayerList(LayerList&); |
// Virtual for testing. |
virtual void animateLayers(double monotonicTime, double wallClockTime); |
@@ -275,45 +275,45 @@ protected: |
// Virtual for testing. |
virtual base::TimeDelta lowFrequencyAnimationInterval() const; |
- CCLayerTreeHostImplClient* m_client; |
+ LayerTreeHostImplClient* m_client; |
int m_sourceFrameNumber; |
private: |
- void computeDoubleTapZoomDeltas(CCScrollAndScaleSet* scrollInfo); |
- void computePinchZoomDeltas(CCScrollAndScaleSet* scrollInfo); |
- void makeScrollAndScaleSet(CCScrollAndScaleSet* scrollInfo, const IntSize& scrollOffset, float pageScale); |
+ void computeDoubleTapZoomDeltas(ScrollAndScaleSet* scrollInfo); |
+ void computePinchZoomDeltas(ScrollAndScaleSet* scrollInfo); |
+ void makeScrollAndScaleSet(ScrollAndScaleSet* scrollInfo, const IntSize& scrollOffset, float pageScale); |
void setPageScaleDelta(float); |
void updateMaxScrollPosition(); |
- void trackDamageForAllSurfaces(CCLayerImpl* rootDrawLayer, const CCLayerList& renderSurfaceLayerList); |
+ void trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, const LayerList& renderSurfaceLayerList); |
// Returns false if the frame should not be displayed. This function should |
// only be called from prepareToDraw, as didDrawAllLayers must be called |
// if this helper function is called. |
bool calculateRenderPasses(FrameData&); |
- void animateLayersRecursive(CCLayerImpl*, double monotonicTime, double wallClockTime, CCAnimationEventsVector*, bool& didAnimate, bool& needsAnimateLayers); |
+ void animateLayersRecursive(LayerImpl*, double monotonicTime, double wallClockTime, AnimationEventsVector*, bool& didAnimate, bool& needsAnimateLayers); |
void setBackgroundTickingEnabled(bool); |
IntSize contentSize() const; |
- void sendDidLoseContextRecursive(CCLayerImpl*); |
+ void sendDidLoseContextRecursive(LayerImpl*); |
void clearRenderSurfaces(); |
bool ensureRenderSurfaceLayerList(); |
void clearCurrentlyScrollingLayer(); |
- void animateScrollbarsRecursive(CCLayerImpl*, double monotonicTime); |
+ void animateScrollbarsRecursive(LayerImpl*, double monotonicTime); |
- void dumpRenderSurfaces(std::string*, int indent, const CCLayerImpl*) const; |
+ void dumpRenderSurfaces(std::string*, int indent, const LayerImpl*) const; |
- scoped_ptr<CCGraphicsContext> m_context; |
- scoped_ptr<CCResourceProvider> m_resourceProvider; |
- scoped_ptr<CCRenderer> m_renderer; |
- scoped_ptr<CCLayerImpl> m_rootLayerImpl; |
- CCLayerImpl* m_rootScrollLayerImpl; |
- CCLayerImpl* m_currentlyScrollingLayerImpl; |
- CCHeadsUpDisplayLayerImpl* m_hudLayerImpl; |
+ scoped_ptr<GraphicsContext> m_context; |
+ scoped_ptr<ResourceProvider> m_resourceProvider; |
+ scoped_ptr<Renderer> m_renderer; |
+ scoped_ptr<LayerImpl> m_rootLayerImpl; |
+ LayerImpl* m_rootScrollLayerImpl; |
+ LayerImpl* m_currentlyScrollingLayerImpl; |
+ HeadsUpDisplayLayerImpl* m_hudLayerImpl; |
int m_scrollingLayerIdFromPreviousTree; |
bool m_scrollDeltaIsInScreenSpace; |
- CCLayerTreeSettings m_settings; |
+ LayerTreeSettings m_settings; |
IntSize m_layoutViewportSize; |
IntSize m_deviceViewportSize; |
float m_deviceScaleFactor; |
@@ -329,26 +329,26 @@ private: |
bool m_pinchGestureActive; |
IntPoint m_previousPinchAnchor; |
- scoped_ptr<CCPageScaleAnimation> m_pageScaleAnimation; |
+ scoped_ptr<PageScaleAnimation> m_pageScaleAnimation; |
// This is used for ticking animations slowly when hidden. |
- scoped_ptr<CCLayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter; |
+ scoped_ptr<LayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter; |
- CCLayerSorter m_layerSorter; |
+ LayerSorter m_layerSorter; |
// List of visible layers for the most recently prepared frame. Used for |
// rendering and input event hit testing. |
- CCLayerList m_renderSurfaceLayerList; |
+ LayerList m_renderSurfaceLayerList; |
- CCPinchZoomViewport m_pinchZoomViewport; |
+ PinchZoomViewport m_pinchZoomViewport; |
- scoped_ptr<CCFrameRateCounter> m_fpsCounter; |
- scoped_ptr<CCDebugRectHistory> m_debugRectHistory; |
+ scoped_ptr<FrameRateCounter> m_fpsCounter; |
+ scoped_ptr<DebugRectHistory> m_debugRectHistory; |
size_t m_numImplThreadScrolls; |
size_t m_numMainThreadScrolls; |
- DISALLOW_COPY_AND_ASSIGN(CCLayerTreeHostImpl); |
+ DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
}; |
} // namespace cc |