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/input/top_controls_state.h" | 12 #include "cc/input/top_controls_state.h" |
| 13 #include "cc/output/activation_promise.h" |
13 #include "cc/output/swap_promise.h" | 14 #include "cc/output/swap_promise.h" |
14 #include "cc/trees/layer_tree_host_client.h" | 15 #include "cc/trees/layer_tree_host_client.h" |
15 #include "cc/trees/layer_tree_host_single_thread_client.h" | 16 #include "cc/trees/layer_tree_host_single_thread_client.h" |
16 #include "cc/trees/layer_tree_settings.h" | 17 #include "cc/trees/layer_tree_settings.h" |
17 #include "cc/trees/swap_promise_monitor.h" | 18 #include "cc/trees/swap_promise_monitor.h" |
18 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
19 #include "content/renderer/gpu/compositor_dependencies.h" | 20 #include "content/renderer/gpu/compositor_dependencies.h" |
20 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" | 21 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" |
21 #include "third_party/skia/include/core/SkBitmap.h" | 22 #include "third_party/skia/include/core/SkBitmap.h" |
22 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Like setNeedsRedraw but forces the frame to be drawn, without early-outs. | 57 // Like setNeedsRedraw but forces the frame to be drawn, without early-outs. |
57 // Redraw will be forced after the next commit | 58 // Redraw will be forced after the next commit |
58 void SetNeedsForcedRedraw(); | 59 void SetNeedsForcedRedraw(); |
59 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped | 60 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped |
60 // LatencyInfoSwapPromiseMonitor. During the life time of the | 61 // LatencyInfoSwapPromiseMonitor. During the life time of the |
61 // LatencyInfoSwapPromiseMonitor, if SetNeedsCommit() or | 62 // LatencyInfoSwapPromiseMonitor, if SetNeedsCommit() or |
62 // SetNeedsUpdateLayers() is called on LayerTreeHost, the original latency | 63 // SetNeedsUpdateLayers() is called on LayerTreeHost, the original latency |
63 // info will be turned into a LatencyInfoSwapPromise. | 64 // info will be turned into a LatencyInfoSwapPromise. |
64 scoped_ptr<cc::SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( | 65 scoped_ptr<cc::SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( |
65 ui::LatencyInfo* latency); | 66 ui::LatencyInfo* latency); |
66 // Calling QueueSwapPromise() to directly queue a SwapPromise into | 67 |
| 68 // Calling QueuePromise() to directly queue a SwapPromise into |
67 // LayerTreeHost. | 69 // LayerTreeHost. |
68 void QueueSwapPromise(scoped_ptr<cc::SwapPromise> swap_promise); | 70 void QueuePromise(scoped_ptr<cc::Promise> promise); |
| 71 |
69 int GetSourceFrameNumber() const; | 72 int GetSourceFrameNumber() const; |
70 void SetNeedsUpdateLayers(); | 73 void SetNeedsUpdateLayers(); |
71 void SetNeedsCommit(); | 74 void SetNeedsCommit(); |
72 void NotifyInputThrottledUntilCommit(); | 75 void NotifyInputThrottledUntilCommit(); |
73 const cc::Layer* GetRootLayer() const; | 76 const cc::Layer* GetRootLayer() const; |
74 int ScheduleMicroBenchmark( | 77 int ScheduleMicroBenchmark( |
75 const std::string& name, | 78 const std::string& name, |
76 scoped_ptr<base::Value> value, | 79 scoped_ptr<base::Value> value, |
77 const base::Callback<void(scoped_ptr<base::Value>)>& callback); | 80 const base::Callback<void(scoped_ptr<base::Value>)>& callback); |
78 bool SendMessageToMicroBenchmark(int id, scoped_ptr<base::Value> value); | 81 bool SendMessageToMicroBenchmark(int id, scoped_ptr<base::Value> value); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 182 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
180 | 183 |
181 scoped_ptr<cc::CopyOutputRequest> temporary_copy_output_request_; | 184 scoped_ptr<cc::CopyOutputRequest> temporary_copy_output_request_; |
182 | 185 |
183 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; | 186 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; |
184 }; | 187 }; |
185 | 188 |
186 } // namespace content | 189 } // namespace content |
187 | 190 |
188 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 191 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
OLD | NEW |