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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.h

Issue 14348029: Android: Throttle render compositor if browser (compositor) is behind. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue>
9 10
10 #include "base/callback.h" 11 #include "base/callback.h"
11 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
12 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
13 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
14 #include "base/process.h" 15 #include "base/process.h"
16 #include "cc/layers/texture_layer_client.h"
15 #include "content/browser/renderer_host/ime_adapter_android.h" 17 #include "content/browser/renderer_host/ime_adapter_android.h"
16 #include "content/browser/renderer_host/render_widget_host_view_base.h" 18 #include "content/browser/renderer_host/render_widget_host_view_base.h"
17 #include "gpu/command_buffer/common/mailbox.h" 19 #include "gpu/command_buffer/common/mailbox.h"
18 #include "third_party/skia/include/core/SkColor.h" 20 #include "third_party/skia/include/core/SkColor.h"
19 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
20 #include "ui/gfx/size.h" 22 #include "ui/gfx/size.h"
21 #include "ui/gfx/vector2d_f.h" 23 #include "ui/gfx/vector2d_f.h"
22 24
23 struct ViewHostMsg_TextInputState_Params; 25 struct ViewHostMsg_TextInputState_Params;
24 26
(...skipping 14 matching lines...) Expand all
39 namespace content { 41 namespace content {
40 class ContentViewCoreImpl; 42 class ContentViewCoreImpl;
41 class RenderWidgetHost; 43 class RenderWidgetHost;
42 class RenderWidgetHostImpl; 44 class RenderWidgetHostImpl;
43 class SurfaceTextureTransportClient; 45 class SurfaceTextureTransportClient;
44 struct NativeWebKeyboardEvent; 46 struct NativeWebKeyboardEvent;
45 47
46 // ----------------------------------------------------------------------------- 48 // -----------------------------------------------------------------------------
47 // See comments in render_widget_host_view.h about this class and its members. 49 // See comments in render_widget_host_view.h about this class and its members.
48 // ----------------------------------------------------------------------------- 50 // -----------------------------------------------------------------------------
49 class RenderWidgetHostViewAndroid : public RenderWidgetHostViewBase { 51 class RenderWidgetHostViewAndroid : public RenderWidgetHostViewBase,
52 public cc::TextureLayerClient {
50 public: 53 public:
51 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, 54 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget,
52 ContentViewCoreImpl* content_view_core); 55 ContentViewCoreImpl* content_view_core);
53 virtual ~RenderWidgetHostViewAndroid(); 56 virtual ~RenderWidgetHostViewAndroid();
54 57
55 // RenderWidgetHostView implementation. 58 // RenderWidgetHostView implementation.
56 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 59 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
57 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; 60 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE;
58 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, 61 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
59 const gfx::Rect& pos) OVERRIDE; 62 const gfx::Rect& pos) OVERRIDE;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 const std::vector<AccessibilityHostMsg_NotificationParams>& 143 const std::vector<AccessibilityHostMsg_NotificationParams>&
141 params) OVERRIDE; 144 params) OVERRIDE;
142 virtual bool LockMouse() OVERRIDE; 145 virtual bool LockMouse() OVERRIDE;
143 virtual void UnlockMouse() OVERRIDE; 146 virtual void UnlockMouse() OVERRIDE;
144 virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE; 147 virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE;
145 virtual void OnSwapCompositorFrame( 148 virtual void OnSwapCompositorFrame(
146 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; 149 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE;
147 virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect, 150 virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect,
148 const SkBitmap& zoomed_bitmap) OVERRIDE; 151 const SkBitmap& zoomed_bitmap) OVERRIDE;
149 152
153 // cc::TextureLayerClient implementation.
154 virtual unsigned PrepareTexture(cc::ResourceUpdateQueue* queue) OVERRIDE;
155 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE;
156 virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox) OVERRIDE;
157
150 // Non-virtual methods 158 // Non-virtual methods
151 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 159 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
152 SkColor GetCachedBackgroundColor() const; 160 SkColor GetCachedBackgroundColor() const;
153 void SendKeyEvent(const NativeWebKeyboardEvent& event); 161 void SendKeyEvent(const NativeWebKeyboardEvent& event);
154 void SendTouchEvent(const WebKit::WebTouchEvent& event); 162 void SendTouchEvent(const WebKit::WebTouchEvent& event);
155 void SendMouseEvent(const WebKit::WebMouseEvent& event); 163 void SendMouseEvent(const WebKit::WebMouseEvent& event);
156 void SendMouseWheelEvent(const WebKit::WebMouseWheelEvent& event); 164 void SendMouseWheelEvent(const WebKit::WebMouseWheelEvent& event);
157 void SendGestureEvent(const WebKit::WebGestureEvent& event); 165 void SendGestureEvent(const WebKit::WebGestureEvent& event);
158 166
159 void OnProcessImeBatchStateAck(bool is_begin); 167 void OnProcessImeBatchStateAck(bool is_begin);
(...skipping 13 matching lines...) Expand all
173 void SelectRange(const gfx::Point& start, const gfx::Point& end); 181 void SelectRange(const gfx::Point& start, const gfx::Point& end);
174 182
175 void MoveCaret(const gfx::Point& point); 183 void MoveCaret(const gfx::Point& point);
176 184
177 private: 185 private:
178 void BuffersSwapped(const gpu::Mailbox& mailbox, 186 void BuffersSwapped(const gpu::Mailbox& mailbox,
179 const gfx::Size texture_size, 187 const gfx::Size texture_size,
180 const gfx::SizeF content_size, 188 const gfx::SizeF content_size,
181 const base::Closure& ack_callback); 189 const base::Closure& ack_callback);
182 190
191 void RunAckCallbacks();
192
183 // The model object. 193 // The model object.
184 RenderWidgetHostImpl* host_; 194 RenderWidgetHostImpl* host_;
185 195
186 // Whether or not this widget is potentially attached to the view hierarchy. 196 // Whether or not this widget is potentially attached to the view hierarchy.
187 // This view may not actually be attached if this is true, but it should be 197 // This view may not actually be attached if this is true, but it should be
188 // treated as such, because as soon as a ContentViewCore is set the layer 198 // treated as such, because as soon as a ContentViewCore is set the layer
189 // will be attached automatically. 199 // will be attached automatically.
190 bool is_layer_attached_; 200 bool is_layer_attached_;
191 201
192 // ContentViewCoreImpl is our interface to the view system. 202 // ContentViewCoreImpl is our interface to the view system.
(...skipping 20 matching lines...) Expand all
213 223
214 // Used for image transport when needing to share resources across threads. 224 // Used for image transport when needing to share resources across threads.
215 scoped_ptr<SurfaceTextureTransportClient> surface_texture_transport_; 225 scoped_ptr<SurfaceTextureTransportClient> surface_texture_transport_;
216 226
217 // The mailbox of the previously received frame. 227 // The mailbox of the previously received frame.
218 gpu::Mailbox current_mailbox_; 228 gpu::Mailbox current_mailbox_;
219 229
220 // The mailbox of the frame we last returned. 230 // The mailbox of the frame we last returned.
221 gpu::Mailbox last_mailbox_; 231 gpu::Mailbox last_mailbox_;
222 232
233 bool consumed_current_texture_;
234
235 std::queue<base::Closure> ack_callbacks_;
236
223 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 237 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
224 }; 238 };
225 239
226 } // namespace content 240 } // namespace content
227 241
228 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 242 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698