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_TREES_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 class MemoryHistory; | 43 class MemoryHistory; |
44 class RenderingStatsInstrumentation; | 44 class RenderingStatsInstrumentation; |
45 class RenderPassDrawQuad; | 45 class RenderPassDrawQuad; |
46 class ResourceProvider; | 46 class ResourceProvider; |
47 class TopControlsManager; | 47 class TopControlsManager; |
48 struct RendererCapabilities; | 48 struct RendererCapabilities; |
49 | 49 |
50 // LayerTreeHost->Proxy callback interface. | 50 // LayerTreeHost->Proxy callback interface. |
51 class LayerTreeHostImplClient { | 51 class LayerTreeHostImplClient { |
52 public: | 52 public: |
53 virtual void DidTryInitializeRendererOnImplThread( | |
54 bool success, | |
55 scoped_refptr<ContextProvider> offscreen_context_provider) = 0; | |
53 virtual void DidLoseOutputSurfaceOnImplThread() = 0; | 56 virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
54 virtual void OnSwapBuffersCompleteOnImplThread() = 0; | 57 virtual void OnSwapBuffersCompleteOnImplThread() = 0; |
55 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, | 58 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
56 base::TimeDelta interval) = 0; | 59 base::TimeDelta interval) = 0; |
57 virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) = 0; | 60 virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) = 0; |
58 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 61 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
59 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; | 62 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; |
60 virtual void SetNeedsRedrawOnImplThread() = 0; | 63 virtual void SetNeedsRedrawOnImplThread() = 0; |
61 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; | 64 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; |
62 virtual void DidInitializeVisibleTileOnImplThread() = 0; | 65 virtual void DidInitializeVisibleTileOnImplThread() = 0; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; | 200 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; |
198 virtual bool AllowPartialSwap() const OVERRIDE; | 201 virtual bool AllowPartialSwap() const OVERRIDE; |
199 | 202 |
200 // TileManagerClient implementation. | 203 // TileManagerClient implementation. |
201 virtual void ScheduleManageTiles() OVERRIDE; | 204 virtual void ScheduleManageTiles() OVERRIDE; |
202 virtual void DidInitializeVisibleTile() OVERRIDE; | 205 virtual void DidInitializeVisibleTile() OVERRIDE; |
203 virtual bool ShouldForceTileUploadsRequiredForActivationToComplete() const | 206 virtual bool ShouldForceTileUploadsRequiredForActivationToComplete() const |
204 OVERRIDE; | 207 OVERRIDE; |
205 | 208 |
206 // OutputSurfaceClient implementation. | 209 // OutputSurfaceClient implementation. |
210 virtual bool DeferredInitialize( | |
211 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; | |
danakj
2013/06/05 21:53:32
Is the embedder just going to have to always provi
boliu
2013/06/05 22:17:27
Part 3 of this patch will just pass in NULL for no
| |
207 virtual void SetNeedsRedrawRect(gfx::Rect rect) OVERRIDE; | 212 virtual void SetNeedsRedrawRect(gfx::Rect rect) OVERRIDE; |
208 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, | 213 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
209 base::TimeDelta interval) OVERRIDE; | 214 base::TimeDelta interval) OVERRIDE; |
210 virtual void BeginFrame(base::TimeTicks frame_time) | 215 virtual void BeginFrame(base::TimeTicks frame_time) |
211 OVERRIDE; | 216 OVERRIDE; |
212 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack) | 217 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack) |
213 OVERRIDE; | 218 OVERRIDE; |
214 | 219 |
215 // Called from LayerTreeImpl. | 220 // Called from LayerTreeImpl. |
216 void OnCanDrawStateChangedForTree(); | 221 void OnCanDrawStateChangedForTree(); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 | 395 |
391 const AnimationRegistrar::AnimationControllerMap& | 396 const AnimationRegistrar::AnimationControllerMap& |
392 active_animation_controllers() const { | 397 active_animation_controllers() const { |
393 return animation_registrar_->active_animation_controllers(); | 398 return animation_registrar_->active_animation_controllers(); |
394 } | 399 } |
395 | 400 |
396 LayerTreeHostImplClient* client_; | 401 LayerTreeHostImplClient* client_; |
397 Proxy* proxy_; | 402 Proxy* proxy_; |
398 | 403 |
399 private: | 404 private: |
405 bool DoInitializeRenderer(scoped_ptr<OutputSurface> output_surface, | |
406 bool is_deffered_init); | |
407 | |
400 void AnimatePageScale(base::TimeTicks monotonic_time); | 408 void AnimatePageScale(base::TimeTicks monotonic_time); |
401 void AnimateScrollbars(base::TimeTicks monotonic_time); | 409 void AnimateScrollbars(base::TimeTicks monotonic_time); |
402 void AnimateTopControls(base::TimeTicks monotonic_time); | 410 void AnimateTopControls(base::TimeTicks monotonic_time); |
403 | 411 |
404 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( | 412 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( |
405 LayerImpl* layer_impl, | 413 LayerImpl* layer_impl, |
406 float scale_from_viewport_to_screen_space, | 414 float scale_from_viewport_to_screen_space, |
407 gfx::PointF viewport_point, | 415 gfx::PointF viewport_point, |
408 gfx::Vector2dF viewport_delta); | 416 gfx::Vector2dF viewport_delta); |
409 | 417 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
506 scoped_ptr<AnimationRegistrar> animation_registrar_; | 514 scoped_ptr<AnimationRegistrar> animation_registrar_; |
507 | 515 |
508 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 516 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
509 | 517 |
510 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 518 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
511 }; | 519 }; |
512 | 520 |
513 } // namespace cc | 521 } // namespace cc |
514 | 522 |
515 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 523 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |