Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Side by Side Diff: content/renderer/gpu/render_widget_compositor.h

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't use unknown to break the promise on deletion Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "third_party/WebKit/public/platform/WebLayerTreeView.h" 18 #include "third_party/WebKit/public/platform/WebLayerTreeView.h"
19 #include "third_party/skia/include/core/SkBitmap.h" 19 #include "third_party/skia/include/core/SkBitmap.h"
20 #include "ui/gfx/rect.h" 20 #include "ui/gfx/rect.h"
21 21
22 namespace ui { 22 namespace ui {
23 struct LatencyInfo; 23 struct LatencyInfo;
24 } 24 }
25 25
26 namespace cc { 26 namespace cc {
27 class InputHandler; 27 class InputHandler;
28 class Layer; 28 class Layer;
29 class LayerTreeHost; 29 class LayerTreeHost;
30 class SwapPromise;
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 RenderWidgetCompositor : public blink::WebLayerTreeView,
36 public cc::LayerTreeHostClient, 37 public cc::LayerTreeHostClient,
37 public cc::LayerTreeHostSingleThreadClient { 38 public cc::LayerTreeHostSingleThreadClient {
38 public: 39 public:
39 // Attempt to construct and initialize a compositor instance for the widget 40 // Attempt to construct and initialize a compositor instance for the widget
(...skipping 21 matching lines...) Expand all
61 // LatencyInfoSwapPromiseMonitor. During the life time of the 62 // LatencyInfoSwapPromiseMonitor. During the life time of the
62 // LatencyInfoSwapPromiseMonitor, if SetNeedsCommit() or SetNeedsUpdateLayer() 63 // LatencyInfoSwapPromiseMonitor, if SetNeedsCommit() or SetNeedsUpdateLayer()
63 // is called on LayerTreeHost, the original latency info will be turned 64 // is called on LayerTreeHost, the original latency info will be turned
64 // into a LatencyInfoSwapPromise. 65 // into a LatencyInfoSwapPromise.
65 scoped_ptr<cc::SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( 66 scoped_ptr<cc::SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor(
66 ui::LatencyInfo* latency); 67 ui::LatencyInfo* latency);
67 // Calling QueueSwapPromise() to directly queue a SwapPromise into 68 // Calling QueueSwapPromise() to directly queue a SwapPromise into
68 // LayerTreeHost. 69 // LayerTreeHost.
69 void QueueSwapPromise(scoped_ptr<cc::SwapPromise> swap_promise); 70 void QueueSwapPromise(scoped_ptr<cc::SwapPromise> swap_promise);
70 int GetLayerTreeId() const; 71 int GetLayerTreeId() const;
72 int GetSourceFrameNumber() const;
71 void NotifyInputThrottledUntilCommit(); 73 void NotifyInputThrottledUntilCommit();
72 const cc::Layer* GetRootLayer() const; 74 const cc::Layer* GetRootLayer() const;
73 int ScheduleMicroBenchmark( 75 int ScheduleMicroBenchmark(
74 const std::string& name, 76 const std::string& name,
75 scoped_ptr<base::Value> value, 77 scoped_ptr<base::Value> value,
76 const base::Callback<void(scoped_ptr<base::Value>)>& callback); 78 const base::Callback<void(scoped_ptr<base::Value>)>& callback);
77 bool SendMessageToMicroBenchmark(int id, scoped_ptr<base::Value> value); 79 bool SendMessageToMicroBenchmark(int id, scoped_ptr<base::Value> value);
78 80
79 // WebLayerTreeView implementation. 81 // WebLayerTreeView implementation.
80 virtual void setSurfaceReady(); 82 virtual void setSurfaceReady();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 153
152 bool threaded_; 154 bool threaded_;
153 bool suppress_schedule_composite_; 155 bool suppress_schedule_composite_;
154 RenderWidget* widget_; 156 RenderWidget* widget_;
155 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; 157 scoped_ptr<cc::LayerTreeHost> layer_tree_host_;
156 }; 158 };
157 159
158 } // namespace content 160 } // namespace content
159 161
160 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ 162 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698