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" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "cc/base/swap_promise.h" | 12 #include "cc/base/swap_promise.h" |
13 #include "cc/base/swap_promise_monitor.h" | 13 #include "cc/base/swap_promise_monitor.h" |
14 #include "cc/input/top_controls_state.h" | 14 #include "cc/input/top_controls_state.h" |
15 #include "cc/trees/layer_tree_host_client.h" | 15 #include "cc/trees/layer_tree_host_client.h" |
16 #include "cc/trees/layer_tree_host_single_thread_client.h" | 16 #include "cc/trees/layer_tree_host_single_thread_client.h" |
17 #include "cc/trees/layer_tree_settings.h" | 17 #include "cc/trees/layer_tree_settings.h" |
| 18 #include "content/common/content_export.h" |
18 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" | 19 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" |
19 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
20 #include "ui/gfx/rect.h" | 21 #include "ui/gfx/rect.h" |
21 | 22 |
22 namespace ui { | 23 namespace ui { |
23 struct LatencyInfo; | 24 struct LatencyInfo; |
24 } | 25 } |
25 | 26 |
26 namespace cc { | 27 namespace cc { |
27 class InputHandler; | 28 class InputHandler; |
28 class Layer; | 29 class Layer; |
29 class LayerTreeHost; | 30 class LayerTreeHost; |
30 } | 31 } |
31 | 32 |
32 namespace content { | 33 namespace content { |
33 class RenderWidget; | 34 class RenderWidget; |
34 | 35 |
35 class RenderWidgetCompositor : public blink::WebLayerTreeView, | 36 class CONTENT_EXPORT RenderWidgetCompositor |
36 public cc::LayerTreeHostClient, | 37 : NON_EXPORTED_BASE(public blink::WebLayerTreeView), |
37 public cc::LayerTreeHostSingleThreadClient { | 38 NON_EXPORTED_BASE(public cc::LayerTreeHostClient), |
| 39 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) { |
38 public: | 40 public: |
39 // Attempt to construct and initialize a compositor instance for the widget | 41 // Attempt to construct and initialize a compositor instance for the widget |
40 // with the given settings. Returns NULL if initialization fails. | 42 // with the given settings. Returns NULL if initialization fails. |
41 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget, | 43 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget, |
42 bool threaded); | 44 bool threaded); |
43 | 45 |
44 virtual ~RenderWidgetCompositor(); | 46 virtual ~RenderWidgetCompositor(); |
45 | 47 |
46 const base::WeakPtr<cc::InputHandler>& GetInputHandler(); | 48 const base::WeakPtr<cc::InputHandler>& GetInputHandler(); |
47 bool BeginMainFrameRequested() const; | 49 bool BeginMainFrameRequested() const; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 158 |
157 bool send_v8_idle_notification_after_commit_; | 159 bool send_v8_idle_notification_after_commit_; |
158 base::TimeTicks begin_main_frame_time_; | 160 base::TimeTicks begin_main_frame_time_; |
159 // The time interval between BeginMainFrame calls, provided by the scheduler. | 161 // The time interval between BeginMainFrame calls, provided by the scheduler. |
160 base::TimeDelta begin_main_frame_interval_; | 162 base::TimeDelta begin_main_frame_interval_; |
161 }; | 163 }; |
162 | 164 |
163 } // namespace content | 165 } // namespace content |
164 | 166 |
165 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 167 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
OLD | NEW |