| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_SERVICES_HTML_VIEWER_WEBLAYERTREEVIEW_IMPL_H_ | 5 #ifndef MOJO_SERVICES_HTML_VIEWER_WEBLAYERTREEVIEW_IMPL_H_ |
| 6 #define MOJO_SERVICES_HTML_VIEWER_WEBLAYERTREEVIEW_IMPL_H_ | 6 #define MOJO_SERVICES_HTML_VIEWER_WEBLAYERTREEVIEW_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace html_viewer { | 35 namespace html_viewer { |
| 36 | 36 |
| 37 class WebLayerTreeViewImpl : public blink::WebLayerTreeView, | 37 class WebLayerTreeViewImpl : public blink::WebLayerTreeView, |
| 38 public cc::LayerTreeHostClient, | 38 public cc::LayerTreeHostClient, |
| 39 public mojo::OutputSurfaceMojoClient { | 39 public mojo::OutputSurfaceMojoClient { |
| 40 public: | 40 public: |
| 41 WebLayerTreeViewImpl( | 41 WebLayerTreeViewImpl( |
| 42 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy, | 42 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy, |
| 43 mojo::SurfacesServicePtr surfaces_service, | 43 mojo::SurfacePtr surface, |
| 44 mojo::GpuPtr gpu_service); | 44 mojo::GpuPtr gpu_service); |
| 45 virtual ~WebLayerTreeViewImpl(); | 45 virtual ~WebLayerTreeViewImpl(); |
| 46 | 46 |
| 47 void set_widget(blink::WebWidget* widget) { widget_ = widget; } | 47 void set_widget(blink::WebWidget* widget) { widget_ = widget; } |
| 48 void set_view(mojo::View* view) { view_ = view; } | 48 void set_view(mojo::View* view) { view_ = view; } |
| 49 | 49 |
| 50 // cc::LayerTreeHostClient implementation. | 50 // cc::LayerTreeHostClient implementation. |
| 51 void WillBeginMainFrame(int frame_id) override; | 51 void WillBeginMainFrame(int frame_id) override; |
| 52 void DidBeginMainFrame() override; | 52 void DidBeginMainFrame() override; |
| 53 void BeginMainFrame(const cc::BeginFrameArgs& args) override; | 53 void BeginMainFrame(const cc::BeginFrameArgs& args) override; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 virtual void setShowFPSCounter(bool) {} | 109 virtual void setShowFPSCounter(bool) {} |
| 110 virtual void setShowPaintRects(bool) {} | 110 virtual void setShowPaintRects(bool) {} |
| 111 virtual void setShowDebugBorders(bool) {} | 111 virtual void setShowDebugBorders(bool) {} |
| 112 virtual void setContinuousPaintingEnabled(bool) {} | 112 virtual void setContinuousPaintingEnabled(bool) {} |
| 113 virtual void setShowScrollBottleneckRects(bool) {} | 113 virtual void setShowScrollBottleneckRects(bool) {} |
| 114 | 114 |
| 115 // OutputSurfaceMojoClient implementation. | 115 // OutputSurfaceMojoClient implementation. |
| 116 void DidCreateSurface(cc::SurfaceId id) override; | 116 void DidCreateSurface(cc::SurfaceId id) override; |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 void OnSurfaceConnectionCreated(mojo::SurfacePtr surface, | |
| 120 uint32_t id_namespace); | |
| 121 void DidCreateSurfaceOnMainThread(cc::SurfaceId id); | 119 void DidCreateSurfaceOnMainThread(cc::SurfaceId id); |
| 122 | 120 |
| 123 // widget_ and view_ will outlive us. | 121 // widget_ and view_ will outlive us. |
| 124 blink::WebWidget* widget_; | 122 blink::WebWidget* widget_; |
| 125 mojo::View* view_; | 123 mojo::View* view_; |
| 126 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 124 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
| 127 mojo::SurfacesServicePtr surfaces_service_; | |
| 128 scoped_ptr<cc::OutputSurface> output_surface_; | 125 scoped_ptr<cc::OutputSurface> output_surface_; |
| 129 mojo::GpuPtr gpu_service_; | |
| 130 scoped_refptr<base::SingleThreadTaskRunner> | 126 scoped_refptr<base::SingleThreadTaskRunner> |
| 131 main_thread_compositor_task_runner_; | 127 main_thread_compositor_task_runner_; |
| 132 base::WeakPtr<WebLayerTreeViewImpl> main_thread_bound_weak_ptr_; | 128 base::WeakPtr<WebLayerTreeViewImpl> main_thread_bound_weak_ptr_; |
| 133 | 129 |
| 134 base::WeakPtrFactory<WebLayerTreeViewImpl> weak_factory_; | 130 base::WeakPtrFactory<WebLayerTreeViewImpl> weak_factory_; |
| 135 DISALLOW_COPY_AND_ASSIGN(WebLayerTreeViewImpl); | 131 DISALLOW_COPY_AND_ASSIGN(WebLayerTreeViewImpl); |
| 136 }; | 132 }; |
| 137 | 133 |
| 138 } // namespace html_viewer | 134 } // namespace html_viewer |
| 139 | 135 |
| 140 #endif // MOJO_SERVICES_HTML_VIEWER_WEBLAYERTREEVIEW_IMPL_H_ | 136 #endif // MOJO_SERVICES_HTML_VIEWER_WEBLAYERTREEVIEW_IMPL_H_ |
| OLD | NEW |