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

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: use IPC? Created 6 years, 7 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_monitor.h" 12 #include "cc/base/swap_promise_monitor.h"
13 #include "cc/input/top_controls_state.h" 13 #include "cc/input/top_controls_state.h"
14 #include "cc/trees/layer_tree_host_client.h" 14 #include "cc/trees/layer_tree_host_client.h"
15 #include "cc/trees/layer_tree_host_single_thread_client.h" 15 #include "cc/trees/layer_tree_host_single_thread_client.h"
16 #include "cc/trees/layer_tree_settings.h" 16 #include "cc/trees/layer_tree_settings.h"
17 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" 17 #include "third_party/WebKit/public/platform/WebLayerTreeView.h"
18 #include "third_party/skia/include/core/SkBitmap.h" 18 #include "third_party/skia/include/core/SkBitmap.h"
19 #include "ui/gfx/rect.h" 19 #include "ui/gfx/rect.h"
20 20
21 namespace ui { 21 namespace ui {
22 struct LatencyInfo; 22 struct LatencyInfo;
23 } 23 }
24 24
25 namespace cc { 25 namespace cc {
26 class InputHandler; 26 class InputHandler;
27 class Layer; 27 class Layer;
28 class LayerTreeHost; 28 class LayerTreeHost;
29 class SwapPromise;
29 } 30 }
30 31
31 namespace content { 32 namespace content {
32 class RenderWidget; 33 class RenderWidget;
33 34
34 class RenderWidgetCompositor : public blink::WebLayerTreeView, 35 class RenderWidgetCompositor : public blink::WebLayerTreeView,
35 public cc::LayerTreeHostClient, 36 public cc::LayerTreeHostClient,
36 public cc::LayerTreeHostSingleThreadClient { 37 public cc::LayerTreeHostSingleThreadClient {
37 public: 38 public:
38 // Attempt to construct and initialize a compositor instance for the widget 39 // Attempt to construct and initialize a compositor instance for the widget
(...skipping 18 matching lines...) Expand all
57 // Like setNeedsRedraw but forces the frame to be drawn, without early-outs. 58 // Like setNeedsRedraw but forces the frame to be drawn, without early-outs.
58 // Redraw will be forced after the next commit 59 // Redraw will be forced after the next commit
59 void SetNeedsForcedRedraw(); 60 void SetNeedsForcedRedraw();
60 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped 61 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped
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);
68 void QueueSwapPromise(scope_ptr<cc::SwapPromise> promise);
67 int GetLayerTreeId() const; 69 int GetLayerTreeId() const;
68 void NotifyInputThrottledUntilCommit(); 70 void NotifyInputThrottledUntilCommit();
69 const cc::Layer* GetRootLayer() const; 71 const cc::Layer* GetRootLayer() const;
70 bool ScheduleMicroBenchmark( 72 bool ScheduleMicroBenchmark(
71 const std::string& name, 73 const std::string& name,
72 scoped_ptr<base::Value> value, 74 scoped_ptr<base::Value> value,
73 const base::Callback<void(scoped_ptr<base::Value>)>& callback); 75 const base::Callback<void(scoped_ptr<base::Value>)>& callback);
76 int source_frame_number();
74 77
75 // WebLayerTreeView implementation. 78 // WebLayerTreeView implementation.
76 virtual void setSurfaceReady(); 79 virtual void setSurfaceReady();
77 virtual void setRootLayer(const blink::WebLayer& layer); 80 virtual void setRootLayer(const blink::WebLayer& layer);
78 virtual void clearRootLayer(); 81 virtual void clearRootLayer();
79 virtual void setViewportSize( 82 virtual void setViewportSize(
80 const blink::WebSize& unused_deprecated, 83 const blink::WebSize& unused_deprecated,
81 const blink::WebSize& device_viewport_size); 84 const blink::WebSize& device_viewport_size);
82 virtual blink::WebSize layoutViewportSize() const; 85 virtual blink::WebSize layoutViewportSize() const;
83 virtual blink::WebSize deviceViewportSize() const; 86 virtual blink::WebSize deviceViewportSize() const;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 147
145 bool threaded_; 148 bool threaded_;
146 bool suppress_schedule_composite_; 149 bool suppress_schedule_composite_;
147 RenderWidget* widget_; 150 RenderWidget* widget_;
148 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; 151 scoped_ptr<cc::LayerTreeHost> layer_tree_host_;
149 }; 152 };
150 153
151 } // namespace content 154 } // namespace content
152 155
153 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ 156 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698