| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_LAYER_TREE_HOST_IMPL_H_ |
| 6 #define CC_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_LAYER_TREE_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) = 0; | 43 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) = 0; |
| 44 virtual void onCanDrawStateChanged(bool canDraw) = 0; | 44 virtual void onCanDrawStateChanged(bool canDraw) = 0; |
| 45 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) = 0; | 45 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) = 0; |
| 46 virtual void setNeedsRedrawOnImplThread() = 0; | 46 virtual void setNeedsRedrawOnImplThread() = 0; |
| 47 virtual void setNeedsCommitOnImplThread() = 0; | 47 virtual void setNeedsCommitOnImplThread() = 0; |
| 48 virtual void setNeedsManageTilesOnImplThread() = 0; | 48 virtual void setNeedsManageTilesOnImplThread() = 0; |
| 49 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; | 49 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; |
| 50 // Returns true if resources were deleted by this call. | 50 // Returns true if resources were deleted by this call. |
| 51 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; | 51 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; |
| 52 virtual void sendManagedMemoryStats() = 0; | 52 virtual void sendManagedMemoryStats() = 0; |
| 53 virtual void onReceivedLatencyInfo(const LatencyInfo& latencyInfo) = 0; |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 // PinchZoomViewport models the bounds and offset of the viewport that is used d
uring a pinch-zoom operation. | 56 // PinchZoomViewport models the bounds and offset of the viewport that is used d
uring a pinch-zoom operation. |
| 56 // It tracks the layout-space dimensions of the viewport before any applied scal
e, and then tracks the layout-space | 57 // It tracks the layout-space dimensions of the viewport before any applied scal
e, and then tracks the layout-space |
| 57 // coordinates of the viewport respecting the pinch settings. | 58 // coordinates of the viewport respecting the pinch settings. |
| 58 class CC_EXPORT PinchZoomViewport { | 59 class CC_EXPORT PinchZoomViewport { |
| 59 public: | 60 public: |
| 60 PinchZoomViewport(); | 61 PinchZoomViewport(); |
| 61 | 62 |
| 62 float totalPageScaleFactor() const; | 63 float totalPageScaleFactor() const; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 public TileManagerClient, | 118 public TileManagerClient, |
| 118 public OutputSurfaceClient { | 119 public OutputSurfaceClient { |
| 119 typedef std::vector<LayerImpl*> LayerList; | 120 typedef std::vector<LayerImpl*> LayerList; |
| 120 | 121 |
| 121 public: | 122 public: |
| 122 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT
reeHostImplClient*, Proxy*); | 123 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT
reeHostImplClient*, Proxy*); |
| 123 virtual ~LayerTreeHostImpl(); | 124 virtual ~LayerTreeHostImpl(); |
| 124 | 125 |
| 125 // InputHandlerClient implementation | 126 // InputHandlerClient implementation |
| 126 virtual InputHandlerClient::ScrollStatus scrollBegin(gfx::Point, InputHandle
rClient::ScrollInputType) OVERRIDE; | 127 virtual InputHandlerClient::ScrollStatus scrollBegin(gfx::Point, InputHandle
rClient::ScrollInputType) OVERRIDE; |
| 127 virtual bool scrollBy(const gfx::Point&, const gfx::Vector2d&) OVERRIDE; | 128 virtual bool scrollBy(int64 frame_number, const gfx::Point&, const gfx::Vect
or2d&) OVERRIDE; |
| 128 virtual void scrollEnd() OVERRIDE; | 129 virtual void scrollEnd() OVERRIDE; |
| 129 virtual void pinchGestureBegin() OVERRIDE; | 130 virtual void pinchGestureBegin() OVERRIDE; |
| 130 virtual void pinchGestureUpdate(float, gfx::Point) OVERRIDE; | 131 virtual void pinchGestureUpdate(float, gfx::Point) OVERRIDE; |
| 131 virtual void pinchGestureEnd() OVERRIDE; | 132 virtual void pinchGestureEnd() OVERRIDE; |
| 132 virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool anchor
Point, float pageScale, base::TimeTicks startTime, base::TimeDelta duration) OVE
RRIDE; | 133 virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool anchor
Point, float pageScale, base::TimeTicks startTime, base::TimeDelta duration) OVE
RRIDE; |
| 133 virtual void scheduleAnimation() OVERRIDE; | 134 virtual void scheduleAnimation() OVERRIDE; |
| 134 virtual bool haveTouchEventHandlersAt(const gfx::Point&) OVERRIDE; | 135 virtual bool haveTouchEventHandlersAt(const gfx::Point&) OVERRIDE; |
| 135 | 136 |
| 136 struct CC_EXPORT FrameData : public RenderPassSink { | 137 struct CC_EXPORT FrameData : public RenderPassSink { |
| 137 FrameData(); | 138 FrameData(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 virtual bool shouldClearRootRenderPass() const OVERRIDE; | 177 virtual bool shouldClearRootRenderPass() const OVERRIDE; |
| 177 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const OVERRIDE
; | 178 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const OVERRIDE
; |
| 178 | 179 |
| 179 // TileManagerClient implementation. | 180 // TileManagerClient implementation. |
| 180 virtual void ScheduleManageTiles() OVERRIDE; | 181 virtual void ScheduleManageTiles() OVERRIDE; |
| 181 virtual void ScheduleCheckForCompletedSetPixels() OVERRIDE; | 182 virtual void ScheduleCheckForCompletedSetPixels() OVERRIDE; |
| 182 | 183 |
| 183 // OutputSurfaceClient implementation. | 184 // OutputSurfaceClient implementation. |
| 184 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; | 185 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; |
| 185 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck&) OVE
RRIDE; | 186 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck&) OVE
RRIDE; |
| 187 virtual void OnReceivedLatencyInfo(const LatencyInfo& latency_info) OVERRIDE
; |
| 186 | 188 |
| 187 // Called from LayerTreeImpl. | 189 // Called from LayerTreeImpl. |
| 188 void OnCanDrawStateChangedForTree(LayerTreeImpl*); | 190 void OnCanDrawStateChangedForTree(LayerTreeImpl*); |
| 189 | 191 |
| 190 // Implementation | 192 // Implementation |
| 191 bool canDraw(); | 193 bool canDraw(); |
| 192 OutputSurface* outputSurface() const; | 194 OutputSurface* outputSurface() const; |
| 193 | 195 |
| 194 std::string layerTreeAsText() const; | 196 std::string layerTreeAsText() const; |
| 195 std::string layerTreeAsJson() const; | 197 std::string layerTreeAsJson() const; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } | 258 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } |
| 257 bool needsAnimateLayers() const { return !m_animationRegistrar->active_anima
tion_controllers().empty(); } | 259 bool needsAnimateLayers() const { return !m_animationRegistrar->active_anima
tion_controllers().empty(); } |
| 258 | 260 |
| 259 bool needsUpdateDrawProperties() const { return m_needsUpdateDrawProperties;
} | 261 bool needsUpdateDrawProperties() const { return m_needsUpdateDrawProperties;
} |
| 260 void setNeedsUpdateDrawProperties() { m_needsUpdateDrawProperties = true; } | 262 void setNeedsUpdateDrawProperties() { m_needsUpdateDrawProperties = true; } |
| 261 | 263 |
| 262 void setNeedsRedraw(); | 264 void setNeedsRedraw(); |
| 263 | 265 |
| 264 void renderingStats(RenderingStats*) const; | 266 void renderingStats(RenderingStats*) const; |
| 265 | 267 |
| 268 void setLatencyInfo(const LatencyInfo& latency_info); |
| 269 |
| 266 void sendManagedMemoryStats( | 270 void sendManagedMemoryStats( |
| 267 size_t memoryVisibleBytes, | 271 size_t memoryVisibleBytes, |
| 268 size_t memoryVisibleAndNearbyBytes, | 272 size_t memoryVisibleAndNearbyBytes, |
| 269 size_t memoryUseBytes); | 273 size_t memoryUseBytes); |
| 270 | 274 |
| 271 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } | 275 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } |
| 272 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get()
; } | 276 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get()
; } |
| 273 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } | 277 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } |
| 274 | 278 |
| 275 Proxy* proxy() const { return m_proxy; } | 279 Proxy* proxy() const { return m_proxy; } |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 int64 m_cumulativeNumLayersDrawn; | 404 int64 m_cumulativeNumLayersDrawn; |
| 401 | 405 |
| 402 int64 m_cumulativeNumMissingTiles; | 406 int64 m_cumulativeNumMissingTiles; |
| 403 | 407 |
| 404 size_t m_lastSentMemoryVisibleBytes; | 408 size_t m_lastSentMemoryVisibleBytes; |
| 405 size_t m_lastSentMemoryVisibleAndNearbyBytes; | 409 size_t m_lastSentMemoryVisibleAndNearbyBytes; |
| 406 size_t m_lastSentMemoryUseBytes; | 410 size_t m_lastSentMemoryUseBytes; |
| 407 | 411 |
| 408 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 412 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
| 409 | 413 |
| 414 LatencyInfo m_latencyInfo; |
| 415 bool m_createdFrame; |
| 416 |
| 410 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 417 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 411 }; | 418 }; |
| 412 | 419 |
| 413 } // namespace cc | 420 } // namespace cc |
| 414 | 421 |
| 415 #endif // CC_LAYER_TREE_HOST_IMPL_H_ | 422 #endif // CC_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |