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/time.h" | 8 #include "base/time.h" |
9 #include "cc/debug/rendering_stats.h" | 9 #include "cc/debug/rendering_stats.h" |
10 #include "cc/trees/layer_tree_host_client.h" | 10 #include "cc/trees/layer_tree_host_client.h" |
11 #include "cc/trees/layer_tree_settings.h" | 11 #include "cc/trees/layer_tree_settings.h" |
12 #include "skia/ext/refptr.h" | 12 #include "skia/ext/refptr.h" |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" |
14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
15 | 15 |
16 class SkPicture; | 16 class SkPicture; |
17 | 17 |
| 18 namespace ui { |
| 19 class LatencyInfo; |
| 20 } |
| 21 |
18 namespace cc { | 22 namespace cc { |
19 class LayerTreeHost; | 23 class LayerTreeHost; |
20 struct LatencyInfo; | |
21 } | 24 } |
22 | 25 |
23 namespace content { | 26 namespace content { |
24 class RenderWidget; | 27 class RenderWidget; |
25 | 28 |
26 class RenderWidgetCompositor : public WebKit::WebLayerTreeView, | 29 class RenderWidgetCompositor : public WebKit::WebLayerTreeView, |
27 public cc::LayerTreeHostClient { | 30 public cc::LayerTreeHostClient { |
28 public: | 31 public: |
29 // Attempt to construct and initialize a compositor instance for the widget | 32 // Attempt to construct and initialize a compositor instance for the widget |
30 // with the given settings. Returns NULL if initialization fails. | 33 // with the given settings. Returns NULL if initialization fails. |
31 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget); | 34 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget); |
32 | 35 |
33 virtual ~RenderWidgetCompositor(); | 36 virtual ~RenderWidgetCompositor(); |
34 | 37 |
35 void SetSuppressScheduleComposite(bool suppress); | 38 void SetSuppressScheduleComposite(bool suppress); |
36 void Animate(base::TimeTicks time); | 39 void Animate(base::TimeTicks time); |
37 void Composite(base::TimeTicks frame_begin_time); | 40 void Composite(base::TimeTicks frame_begin_time); |
38 void SetNeedsDisplayOnAllLayers(); | 41 void SetNeedsDisplayOnAllLayers(); |
39 void GetRenderingStats(cc::RenderingStats* stats); | 42 void GetRenderingStats(cc::RenderingStats* stats); |
40 skia::RefPtr<SkPicture> CapturePicture(); | 43 skia::RefPtr<SkPicture> CapturePicture(); |
41 void UpdateTopControlsState(bool enable_hiding, | 44 void UpdateTopControlsState(bool enable_hiding, |
42 bool enable_showing, | 45 bool enable_showing, |
43 bool animate); | 46 bool animate); |
44 void SetOverdrawBottomHeight(float overdraw_bottom_height); | 47 void SetOverdrawBottomHeight(float overdraw_bottom_height); |
45 void SetNeedsRedrawRect(gfx::Rect damage_rect); | 48 void SetNeedsRedrawRect(gfx::Rect damage_rect); |
46 void SetLatencyInfo(const cc::LatencyInfo& latency_info); | 49 void SetLatencyInfo(const ui::LatencyInfo& latency_info); |
47 | 50 |
48 // WebLayerTreeView implementation. | 51 // WebLayerTreeView implementation. |
49 virtual void setSurfaceReady(); | 52 virtual void setSurfaceReady(); |
50 virtual void setRootLayer(const WebKit::WebLayer& layer); | 53 virtual void setRootLayer(const WebKit::WebLayer& layer); |
51 virtual void clearRootLayer(); | 54 virtual void clearRootLayer(); |
52 virtual void setViewportSize( | 55 virtual void setViewportSize( |
53 const WebKit::WebSize& unused_deprecated, | 56 const WebKit::WebSize& unused_deprecated, |
54 const WebKit::WebSize& device_viewport_size); | 57 const WebKit::WebSize& device_viewport_size); |
55 virtual WebKit::WebSize layoutViewportSize() const; | 58 virtual WebKit::WebSize layoutViewportSize() const; |
56 virtual WebKit::WebSize deviceViewportSize() const; | 59 virtual WebKit::WebSize deviceViewportSize() const; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 113 |
111 bool threaded_; | 114 bool threaded_; |
112 bool suppress_schedule_composite_; | 115 bool suppress_schedule_composite_; |
113 RenderWidget* widget_; | 116 RenderWidget* widget_; |
114 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 117 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
115 }; | 118 }; |
116 | 119 |
117 } // namespace content | 120 } // namespace content |
118 | 121 |
119 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 122 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
OLD | NEW |