OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 5 #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace cc { | 24 namespace cc { |
25 class InputHandler; | 25 class InputHandler; |
26 class Layer; | 26 class Layer; |
27 class LayerTreeHost; | 27 class LayerTreeHost; |
28 } | 28 } |
29 | 29 |
30 namespace content { | 30 namespace content { |
31 class RenderWidget; | 31 class RenderWidget; |
32 | 32 |
33 class RenderWidgetCompositor : public WebKit::WebLayerTreeView, | 33 class RenderWidgetCompositor : public blink::WebLayerTreeView, |
34 public cc::LayerTreeHostClient { | 34 public cc::LayerTreeHostClient { |
35 public: | 35 public: |
36 // Attempt to construct and initialize a compositor instance for the widget | 36 // Attempt to construct and initialize a compositor instance for the widget |
37 // with the given settings. Returns NULL if initialization fails. | 37 // with the given settings. Returns NULL if initialization fails. |
38 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget, | 38 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget, |
39 bool threaded); | 39 bool threaded); |
40 | 40 |
41 virtual ~RenderWidgetCompositor(); | 41 virtual ~RenderWidgetCompositor(); |
42 | 42 |
43 const base::WeakPtr<cc::InputHandler>& GetInputHandler(); | 43 const base::WeakPtr<cc::InputHandler>& GetInputHandler(); |
(...skipping 16 matching lines...) Expand all Loading... |
60 int GetLayerTreeId() const; | 60 int GetLayerTreeId() const; |
61 void NotifyInputThrottledUntilCommit(); | 61 void NotifyInputThrottledUntilCommit(); |
62 const cc::Layer* GetRootLayer() const; | 62 const cc::Layer* GetRootLayer() const; |
63 bool ScheduleMicroBenchmark( | 63 bool ScheduleMicroBenchmark( |
64 const std::string& name, | 64 const std::string& name, |
65 scoped_ptr<base::Value> value, | 65 scoped_ptr<base::Value> value, |
66 const base::Callback<void(scoped_ptr<base::Value>)>& callback); | 66 const base::Callback<void(scoped_ptr<base::Value>)>& callback); |
67 | 67 |
68 // WebLayerTreeView implementation. | 68 // WebLayerTreeView implementation. |
69 virtual void setSurfaceReady(); | 69 virtual void setSurfaceReady(); |
70 virtual void setRootLayer(const WebKit::WebLayer& layer); | 70 virtual void setRootLayer(const blink::WebLayer& layer); |
71 virtual void clearRootLayer(); | 71 virtual void clearRootLayer(); |
72 virtual void setViewportSize( | 72 virtual void setViewportSize( |
73 const WebKit::WebSize& unused_deprecated, | 73 const blink::WebSize& unused_deprecated, |
74 const WebKit::WebSize& device_viewport_size); | 74 const blink::WebSize& device_viewport_size); |
75 virtual WebKit::WebSize layoutViewportSize() const; | 75 virtual blink::WebSize layoutViewportSize() const; |
76 virtual WebKit::WebSize deviceViewportSize() const; | 76 virtual blink::WebSize deviceViewportSize() const; |
77 virtual WebKit::WebFloatPoint adjustEventPointForPinchZoom( | 77 virtual blink::WebFloatPoint adjustEventPointForPinchZoom( |
78 const WebKit::WebFloatPoint& point) const; | 78 const blink::WebFloatPoint& point) const; |
79 virtual void setDeviceScaleFactor(float device_scale); | 79 virtual void setDeviceScaleFactor(float device_scale); |
80 virtual float deviceScaleFactor() const; | 80 virtual float deviceScaleFactor() const; |
81 virtual void setBackgroundColor(WebKit::WebColor color); | 81 virtual void setBackgroundColor(blink::WebColor color); |
82 virtual void setHasTransparentBackground(bool transparent); | 82 virtual void setHasTransparentBackground(bool transparent); |
83 virtual void setOverhangBitmap(const SkBitmap& bitmap); | 83 virtual void setOverhangBitmap(const SkBitmap& bitmap); |
84 virtual void setVisible(bool visible); | 84 virtual void setVisible(bool visible); |
85 virtual void setPageScaleFactorAndLimits(float page_scale_factor, | 85 virtual void setPageScaleFactorAndLimits(float page_scale_factor, |
86 float minimum, | 86 float minimum, |
87 float maximum); | 87 float maximum); |
88 virtual void startPageScaleAnimation(const WebKit::WebPoint& destination, | 88 virtual void startPageScaleAnimation(const blink::WebPoint& destination, |
89 bool use_anchor, | 89 bool use_anchor, |
90 float new_page_scale, | 90 float new_page_scale, |
91 double duration_sec); | 91 double duration_sec); |
92 virtual void setNeedsAnimate(); | 92 virtual void setNeedsAnimate(); |
93 virtual void setNeedsRedraw(); | 93 virtual void setNeedsRedraw(); |
94 virtual bool commitRequested() const; | 94 virtual bool commitRequested() const; |
95 virtual void didStopFlinging(); | 95 virtual void didStopFlinging(); |
96 virtual bool compositeAndReadback(void *pixels, const WebKit::WebRect& rect); | 96 virtual bool compositeAndReadback(void *pixels, const blink::WebRect& rect); |
97 virtual void finishAllRendering(); | 97 virtual void finishAllRendering(); |
98 virtual void setDeferCommits(bool defer_commits); | 98 virtual void setDeferCommits(bool defer_commits); |
99 virtual void registerForAnimations(WebKit::WebLayer* layer); | 99 virtual void registerForAnimations(blink::WebLayer* layer); |
100 virtual void registerViewportLayers( | 100 virtual void registerViewportLayers( |
101 const WebKit::WebLayer* pageScaleLayer, | 101 const blink::WebLayer* pageScaleLayer, |
102 const WebKit::WebLayer* innerViewportScrollLayer, | 102 const blink::WebLayer* innerViewportScrollLayer, |
103 const WebKit::WebLayer* outerViewportScrollLayer) OVERRIDE; | 103 const blink::WebLayer* outerViewportScrollLayer) OVERRIDE; |
104 virtual void clearViewportLayers() OVERRIDE; | 104 virtual void clearViewportLayers() OVERRIDE; |
105 virtual void renderingStats(WebKit::WebRenderingStats& stats) const {} | 105 virtual void renderingStats(blink::WebRenderingStats& stats) const {} |
106 virtual void setShowFPSCounter(bool show); | 106 virtual void setShowFPSCounter(bool show); |
107 virtual void setShowPaintRects(bool show); | 107 virtual void setShowPaintRects(bool show); |
108 virtual void setShowDebugBorders(bool show); | 108 virtual void setShowDebugBorders(bool show); |
109 virtual void setContinuousPaintingEnabled(bool enabled); | 109 virtual void setContinuousPaintingEnabled(bool enabled); |
110 virtual void setShowScrollBottleneckRects(bool show); | 110 virtual void setShowScrollBottleneckRects(bool show); |
111 | 111 |
112 // cc::LayerTreeHostClient implementation. | 112 // cc::LayerTreeHostClient implementation. |
113 virtual void WillBeginMainFrame() OVERRIDE; | 113 virtual void WillBeginMainFrame() OVERRIDE; |
114 virtual void DidBeginMainFrame() OVERRIDE; | 114 virtual void DidBeginMainFrame() OVERRIDE; |
115 virtual void Animate(double frame_begin_time) OVERRIDE; | 115 virtual void Animate(double frame_begin_time) OVERRIDE; |
(...skipping 19 matching lines...) Expand all Loading... |
135 | 135 |
136 bool threaded_; | 136 bool threaded_; |
137 bool suppress_schedule_composite_; | 137 bool suppress_schedule_composite_; |
138 RenderWidget* widget_; | 138 RenderWidget* widget_; |
139 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 139 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
140 }; | 140 }; |
141 | 141 |
142 } // namespace content | 142 } // namespace content |
143 | 143 |
144 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 144 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
OLD | NEW |