| 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 29 matching lines...) Expand all Loading... |
| 40 virtual void onSwapBuffersCompleteOnImplThread() = 0; | 40 virtual void onSwapBuffersCompleteOnImplThread() = 0; |
| 41 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) = 0; | 41 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) = 0; |
| 42 virtual void onCanDrawStateChanged(bool canDraw) = 0; | 42 virtual void onCanDrawStateChanged(bool canDraw) = 0; |
| 43 virtual void setNeedsRedrawOnImplThread() = 0; | 43 virtual void setNeedsRedrawOnImplThread() = 0; |
| 44 virtual void setNeedsCommitOnImplThread() = 0; | 44 virtual void setNeedsCommitOnImplThread() = 0; |
| 45 virtual void setNeedsManageTilesOnImplThread() = 0; | 45 virtual void setNeedsManageTilesOnImplThread() = 0; |
| 46 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; | 46 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; |
| 47 // Returns true if resources were deleted by this call. | 47 // Returns true if resources were deleted by this call. |
| 48 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; | 48 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; |
| 49 virtual void sendManagedMemoryStats() = 0; | 49 virtual void sendManagedMemoryStats() = 0; |
| 50 virtual void onReceivedLatencyInfo(const WebKit::WebLatencyInfoImpl& latency
Info) = 0; |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 // PinchZoomViewport models the bounds and offset of the viewport that is used d
uring a pinch-zoom operation. | 53 // PinchZoomViewport models the bounds and offset of the viewport that is used d
uring a pinch-zoom operation. |
| 53 // It tracks the layout-space dimensions of the viewport before any applied scal
e, and then tracks the layout-space | 54 // It tracks the layout-space dimensions of the viewport before any applied scal
e, and then tracks the layout-space |
| 54 // coordinates of the viewport respecting the pinch settings. | 55 // coordinates of the viewport respecting the pinch settings. |
| 55 class PinchZoomViewport { | 56 class PinchZoomViewport { |
| 56 public: | 57 public: |
| 57 PinchZoomViewport(); | 58 PinchZoomViewport(); |
| 58 | 59 |
| 59 float totalPageScaleFactor() const; | 60 float totalPageScaleFactor() const; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 public TileManagerClient, | 115 public TileManagerClient, |
| 115 public OutputSurfaceClient { | 116 public OutputSurfaceClient { |
| 116 typedef std::vector<LayerImpl*> LayerList; | 117 typedef std::vector<LayerImpl*> LayerList; |
| 117 | 118 |
| 118 public: | 119 public: |
| 119 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT
reeHostImplClient*, Proxy*); | 120 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT
reeHostImplClient*, Proxy*); |
| 120 virtual ~LayerTreeHostImpl(); | 121 virtual ~LayerTreeHostImpl(); |
| 121 | 122 |
| 122 // InputHandlerClient implementation | 123 // InputHandlerClient implementation |
| 123 virtual InputHandlerClient::ScrollStatus scrollBegin(gfx::Point, InputHandle
rClient::ScrollInputType) OVERRIDE; | 124 virtual InputHandlerClient::ScrollStatus scrollBegin(gfx::Point, InputHandle
rClient::ScrollInputType) OVERRIDE; |
| 124 virtual bool scrollBy(const gfx::Point&, const gfx::Vector2d&) OVERRIDE; | 125 virtual bool scrollBy(int64 frame_number, const gfx::Point&, const gfx::Vect
or2d&) OVERRIDE; |
| 125 virtual void scrollEnd() OVERRIDE; | 126 virtual void scrollEnd() OVERRIDE; |
| 126 virtual void pinchGestureBegin() OVERRIDE; | 127 virtual void pinchGestureBegin() OVERRIDE; |
| 127 virtual void pinchGestureUpdate(float, gfx::Point) OVERRIDE; | 128 virtual void pinchGestureUpdate(float, gfx::Point) OVERRIDE; |
| 128 virtual void pinchGestureEnd() OVERRIDE; | 129 virtual void pinchGestureEnd() OVERRIDE; |
| 129 virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool anchor
Point, float pageScale, base::TimeTicks startTime, base::TimeDelta duration) OVE
RRIDE; | 130 virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool anchor
Point, float pageScale, base::TimeTicks startTime, base::TimeDelta duration) OVE
RRIDE; |
| 130 virtual void scheduleAnimation() OVERRIDE; | 131 virtual void scheduleAnimation() OVERRIDE; |
| 131 virtual bool haveTouchEventHandlersAt(const gfx::Point&) OVERRIDE; | 132 virtual bool haveTouchEventHandlersAt(const gfx::Point&) OVERRIDE; |
| 132 | 133 |
| 133 struct CC_EXPORT FrameData : public RenderPassSink { | 134 struct CC_EXPORT FrameData : public RenderPassSink { |
| 134 FrameData(); | 135 FrameData(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 163 | 164 |
| 164 // RendererClient implementation | 165 // RendererClient implementation |
| 165 virtual const gfx::Size& deviceViewportSize() const OVERRIDE; | 166 virtual const gfx::Size& deviceViewportSize() const OVERRIDE; |
| 166 virtual const LayerTreeSettings& settings() const OVERRIDE; | 167 virtual const LayerTreeSettings& settings() const OVERRIDE; |
| 167 virtual void didLoseOutputSurface() OVERRIDE; | 168 virtual void didLoseOutputSurface() OVERRIDE; |
| 168 virtual void onSwapBuffersComplete() OVERRIDE; | 169 virtual void onSwapBuffersComplete() OVERRIDE; |
| 169 virtual void setFullRootLayerDamage() OVERRIDE; | 170 virtual void setFullRootLayerDamage() OVERRIDE; |
| 170 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE; | 171 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE; |
| 171 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE; | 172 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE; |
| 172 virtual bool hasImplThread() const OVERRIDE; | 173 virtual bool hasImplThread() const OVERRIDE; |
| 174 virtual void onReceivedLatencyInfo(const WebKit::WebLatencyInfoImpl& latency
_info) OVERRIDE; |
| 173 | 175 |
| 174 // TileManagerClient implementation. | 176 // TileManagerClient implementation. |
| 175 virtual void ScheduleManageTiles() OVERRIDE; | 177 virtual void ScheduleManageTiles() OVERRIDE; |
| 176 virtual void ScheduleCheckForCompletedSetPixels() OVERRIDE; | 178 virtual void ScheduleCheckForCompletedSetPixels() OVERRIDE; |
| 177 | 179 |
| 178 // OutputSurfaceClient implementation. | 180 // OutputSurfaceClient implementation. |
| 179 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; | 181 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; |
| 180 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck&) OVE
RRIDE; | 182 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck&) OVE
RRIDE; |
| 181 | 183 |
| 182 // Called from LayerTreeImpl. | 184 // Called from LayerTreeImpl. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 bool needsAnimateLayers() const { return m_needsAnimateLayers; } | 250 bool needsAnimateLayers() const { return m_needsAnimateLayers; } |
| 249 void setNeedsAnimateLayers() { m_needsAnimateLayers = true; } | 251 void setNeedsAnimateLayers() { m_needsAnimateLayers = true; } |
| 250 | 252 |
| 251 bool needsUpdateDrawProperties() const { return m_needsUpdateDrawProperties;
} | 253 bool needsUpdateDrawProperties() const { return m_needsUpdateDrawProperties;
} |
| 252 void setNeedsUpdateDrawProperties() { m_needsUpdateDrawProperties = true; } | 254 void setNeedsUpdateDrawProperties() { m_needsUpdateDrawProperties = true; } |
| 253 | 255 |
| 254 void setNeedsRedraw(); | 256 void setNeedsRedraw(); |
| 255 | 257 |
| 256 void renderingStats(RenderingStats*) const; | 258 void renderingStats(RenderingStats*) const; |
| 257 | 259 |
| 260 void setLatencyInfo(const WebKit::WebLatencyInfoImpl& latency_info); |
| 261 |
| 258 void updateRootScrollLayerImplTransform(); | 262 void updateRootScrollLayerImplTransform(); |
| 259 | 263 |
| 260 void sendManagedMemoryStats( | 264 void sendManagedMemoryStats( |
| 261 size_t memoryVisibleBytes, | 265 size_t memoryVisibleBytes, |
| 262 size_t memoryVisibleAndNearbyBytes, | 266 size_t memoryVisibleAndNearbyBytes, |
| 263 size_t memoryUseBytes); | 267 size_t memoryUseBytes); |
| 264 | 268 |
| 265 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } | 269 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } |
| 266 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get()
; } | 270 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get()
; } |
| 267 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } | 271 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 int64 m_numMainThreadScrolls; | 396 int64 m_numMainThreadScrolls; |
| 393 | 397 |
| 394 int64 m_cumulativeNumLayersDrawn; | 398 int64 m_cumulativeNumLayersDrawn; |
| 395 | 399 |
| 396 int64 m_cumulativeNumMissingTiles; | 400 int64 m_cumulativeNumMissingTiles; |
| 397 | 401 |
| 398 size_t m_lastSentMemoryVisibleBytes; | 402 size_t m_lastSentMemoryVisibleBytes; |
| 399 size_t m_lastSentMemoryVisibleAndNearbyBytes; | 403 size_t m_lastSentMemoryVisibleAndNearbyBytes; |
| 400 size_t m_lastSentMemoryUseBytes; | 404 size_t m_lastSentMemoryUseBytes; |
| 401 | 405 |
| 406 WebKit::WebLatencyInfoImpl m_latencyInfo; |
| 407 bool m_createdFrame; |
| 408 |
| 402 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 409 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 403 }; | 410 }; |
| 404 | 411 |
| 405 } // namespace cc | 412 } // namespace cc |
| 406 | 413 |
| 407 #endif // CC_LAYER_TREE_HOST_IMPL_H_ | 414 #endif // CC_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |