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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void DidFailToInitializeOutputSurface() override; | 65 void DidFailToInitializeOutputSurface() override; |
66 void DidInitializeOutputSurface() override; | 66 void DidInitializeOutputSurface() override; |
67 void WillCommit() override; | 67 void WillCommit() override; |
68 void DidCommit() override; | 68 void DidCommit() override; |
69 void DidCommitAndDrawFrame() override; | 69 void DidCommitAndDrawFrame() override; |
70 void DidCompleteSwapBuffers() override; | 70 void DidCompleteSwapBuffers() override; |
71 void DidCompletePageScaleAnimation() override {} | 71 void DidCompletePageScaleAnimation() override {} |
72 void RateLimitSharedMainThreadContext() override {} | 72 void RateLimitSharedMainThreadContext() override {} |
73 | 73 |
74 // blink::WebLayerTreeView implementation. | 74 // blink::WebLayerTreeView implementation. |
75 void setRootLayer(const blink::WebLayer& layer) override; | 75 virtual void setRootLayer(const blink::WebLayer& layer); |
76 void clearRootLayer() override; | 76 virtual void clearRootLayer(); |
77 void setViewportSize(const blink::WebSize& device_viewport_size) override; | 77 virtual void setViewportSize(const blink::WebSize& device_viewport_size); |
78 blink::WebSize deviceViewportSize() const override; | 78 virtual blink::WebSize deviceViewportSize() const; |
79 void setDeviceScaleFactor(float) override; | 79 virtual void setDeviceScaleFactor(float); |
80 float deviceScaleFactor() const override; | 80 virtual float deviceScaleFactor() const; |
81 void setBackgroundColor(blink::WebColor color) override; | 81 virtual void setBackgroundColor(blink::WebColor color); |
82 void setHasTransparentBackground(bool has_transparent_background) override; | 82 virtual void setHasTransparentBackground(bool has_transparent_background); |
83 void setVisible(bool visible) override; | 83 virtual void setVisible(bool visible); |
84 void setPageScaleFactorAndLimits(float page_scale_factor, | 84 virtual void setPageScaleFactorAndLimits(float page_scale_factor, |
85 float minimum, | 85 float minimum, |
86 float maximum) override; | 86 float maximum); |
87 void startPageScaleAnimation(const blink::WebPoint& destination, | 87 virtual void startPageScaleAnimation(const blink::WebPoint& destination, |
88 bool use_anchor, | 88 bool use_anchor, |
89 float new_page_scale, | 89 float new_page_scale, |
90 double duration_sec) override; | 90 double duration_sec); |
91 void heuristicsForGpuRasterizationUpdated(bool matches_heuristic) override {} | 91 virtual void heuristicsForGpuRasterizationUpdated(bool matches_heuristic) {} |
92 void setNeedsAnimate() override; | 92 virtual void setNeedsAnimate(); |
93 bool commitRequested() const override; | 93 virtual bool commitRequested() const; |
94 void didStopFlinging() override {} | 94 virtual void didStopFlinging() {} |
95 void compositeAndReadbackAsync( | 95 virtual void compositeAndReadbackAsync( |
96 blink::WebCompositeAndReadbackAsyncCallback* callback) override {} | 96 blink::WebCompositeAndReadbackAsyncCallback* callback) {} |
97 void finishAllRendering() override; | 97 virtual void finishAllRendering(); |
98 void setDeferCommits(bool defer_commits) override {} | 98 virtual void setDeferCommits(bool defer_commits) {} |
99 void registerForAnimations(blink::WebLayer* layer) override; | 99 virtual void registerForAnimations(blink::WebLayer* layer); |
100 void registerViewportLayers( | 100 virtual void registerViewportLayers( |
101 const blink::WebLayer* overscrollElasticityLayer, | 101 const blink::WebLayer* overscrollElasticityLayer, |
102 const blink::WebLayer* pageScaleLayerLayer, | 102 const blink::WebLayer* pageScaleLayerLayer, |
103 const blink::WebLayer* innerViewportScrollLayer, | 103 const blink::WebLayer* innerViewportScrollLayer, |
104 const blink::WebLayer* outerViewportScrollLayer) override; | 104 const blink::WebLayer* outerViewportScrollLayer); |
105 void clearViewportLayers() override; | 105 virtual void clearViewportLayers(); |
106 void registerSelection(const blink::WebSelectionBound& start, | 106 virtual void registerSelection(const blink::WebSelectionBound& start, |
107 const blink::WebSelectionBound& end) override {} | 107 const blink::WebSelectionBound& end) {} |
108 void clearSelection() override {} | 108 virtual void clearSelection() {} |
109 void setShowFPSCounter(bool) override {} | 109 virtual void setShowFPSCounter(bool) {} |
110 void setShowPaintRects(bool) override {} | 110 virtual void setShowPaintRects(bool) {} |
111 void setShowDebugBorders(bool) override {} | 111 virtual void setShowDebugBorders(bool) {} |
112 void setContinuousPaintingEnabled(bool) override {} | 112 virtual void setContinuousPaintingEnabled(bool) {} |
113 void setShowScrollBottleneckRects(bool) override {} | 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 DidCreateSurfaceOnMainThread(cc::SurfaceId id); | 119 void DidCreateSurfaceOnMainThread(cc::SurfaceId id); |
120 | 120 |
121 // widget_ and view_ will outlive us. | 121 // widget_ and view_ will outlive us. |
122 blink::WebWidget* widget_; | 122 blink::WebWidget* widget_; |
123 mojo::View* view_; | 123 mojo::View* view_; |
124 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 124 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
125 scoped_ptr<cc::OutputSurface> output_surface_; | 125 scoped_ptr<cc::OutputSurface> output_surface_; |
126 scoped_refptr<base::SingleThreadTaskRunner> | 126 scoped_refptr<base::SingleThreadTaskRunner> |
127 main_thread_compositor_task_runner_; | 127 main_thread_compositor_task_runner_; |
128 base::WeakPtr<WebLayerTreeViewImpl> main_thread_bound_weak_ptr_; | 128 base::WeakPtr<WebLayerTreeViewImpl> main_thread_bound_weak_ptr_; |
129 | 129 |
130 base::WeakPtrFactory<WebLayerTreeViewImpl> weak_factory_; | 130 base::WeakPtrFactory<WebLayerTreeViewImpl> weak_factory_; |
131 DISALLOW_COPY_AND_ASSIGN(WebLayerTreeViewImpl); | 131 DISALLOW_COPY_AND_ASSIGN(WebLayerTreeViewImpl); |
132 }; | 132 }; |
133 | 133 |
134 } // namespace html_viewer | 134 } // namespace html_viewer |
135 | 135 |
136 #endif // MOJO_SERVICES_HTML_VIEWER_WEBLAYERTREEVIEW_IMPL_H_ | 136 #endif // MOJO_SERVICES_HTML_VIEWER_WEBLAYERTREEVIEW_IMPL_H_ |
OLD | NEW |