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

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

Issue 10052018: Drop frontbuffers with ui-use-gpu-process, synchronized with browser, decoupled from backbuffer dro… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Major simplification! Created 8 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) 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_AURA_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/memory/linked_ptr.h" 13 #include "base/memory/linked_ptr.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/weak_ptr.h"
15 #include "content/browser/renderer_host/image_transport_factory.h" 16 #include "content/browser/renderer_host/image_transport_factory.h"
16 #include "content/browser/renderer_host/render_widget_host_view_base.h" 17 #include "content/browser/renderer_host/render_widget_host_view_base.h"
17 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
18 #include "ui/aura/client/activation_delegate.h" 19 #include "ui/aura/client/activation_delegate.h"
19 #include "ui/aura/window_delegate.h" 20 #include "ui/aura/window_delegate.h"
20 #include "ui/base/ime/text_input_client.h" 21 #include "ui/base/ime/text_input_client.h"
21 #include "ui/compositor/compositor_observer.h" 22 #include "ui/compositor/compositor_observer.h"
22 #include "ui/gfx/rect.h" 23 #include "ui/gfx/rect.h"
23 #include "webkit/glue/webcursor.h" 24 #include "webkit/glue/webcursor.h"
24 25
26 namespace aura {
27 class CompositorLock;
28 }
29
25 namespace content { 30 namespace content {
26 class RenderWidgetHostImpl; 31 class RenderWidgetHostImpl;
27 class RenderWidgetHostView; 32 class RenderWidgetHostView;
28 } 33 }
29 34
30 namespace gfx { 35 namespace gfx {
31 class Canvas; 36 class Canvas;
32 } 37 }
33 38
34 namespace ui { 39 namespace ui {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 int gpu_host_id) OVERRIDE; 109 int gpu_host_id) OVERRIDE;
105 virtual void AcceleratedSurfacePostSubBuffer( 110 virtual void AcceleratedSurfacePostSubBuffer(
106 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, 111 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel,
107 int gpu_host_id) OVERRIDE; 112 int gpu_host_id) OVERRIDE;
108 virtual void AcceleratedSurfaceSuspend() OVERRIDE; 113 virtual void AcceleratedSurfaceSuspend() OVERRIDE;
109 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; 114 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE;
110 virtual void AcceleratedSurfaceNew( 115 virtual void AcceleratedSurfaceNew(
111 int32 width_in_pixel, 116 int32 width_in_pixel,
112 int32 height_in_pixel, 117 int32 height_in_pixel,
113 uint64* surface_id, 118 uint64* surface_id,
114 TransportDIB::Handle* surface_handle) OVERRIDE; 119 TransportDIB::Handle* surface_handle,
120 int32 route_id,
121 int gpu_host_id) OVERRIDE;
115 virtual void AcceleratedSurfaceRelease(uint64 surface_id) OVERRIDE; 122 virtual void AcceleratedSurfaceRelease(uint64 surface_id) OVERRIDE;
116 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; 123 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE;
117 virtual gfx::Rect GetRootWindowBounds() OVERRIDE; 124 virtual gfx::Rect GetRootWindowBounds() OVERRIDE;
118 virtual void ProcessTouchAck(WebKit::WebInputEvent::Type type, 125 virtual void ProcessTouchAck(WebKit::WebInputEvent::Type type,
119 bool processed) OVERRIDE; 126 bool processed) OVERRIDE;
120 virtual void SetHasHorizontalScrollbar( 127 virtual void SetHasHorizontalScrollbar(
121 bool has_horizontal_scrollbar) OVERRIDE; 128 bool has_horizontal_scrollbar) OVERRIDE;
122 virtual void SetScrollOffsetPinning( 129 virtual void SetScrollOffsetPinning(
123 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; 130 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE;
124 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; 131 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // Helper method to determine if, in mouse locked mode, the cursor should be 221 // Helper method to determine if, in mouse locked mode, the cursor should be
215 // moved to center. 222 // moved to center.
216 bool ShouldMoveToCenter(); 223 bool ShouldMoveToCenter();
217 224
218 // Run the compositing callbacks. 225 // Run the compositing callbacks.
219 void RunCompositingCallbacks(); 226 void RunCompositingCallbacks();
220 227
221 // Called when window_ is removed from the window tree. 228 // Called when window_ is removed from the window tree.
222 void RemovingFromRootWindow(); 229 void RemovingFromRootWindow();
223 230
231 void SendSurfaceIsProtectedBasedOnVisibilityWhenReady();
232 void SendSurfaceIsProtectedFalseAfterThumbnailerFinished();
233
234 void CopyFromCompositingSurfaceFinished(base::Callback<void(bool)> callback,
235 bool result);
236
224 ui::Compositor* GetCompositor(); 237 ui::Compositor* GetCompositor();
225 238
226 // The model object. 239 // The model object.
227 content::RenderWidgetHostImpl* host_; 240 content::RenderWidgetHostImpl* host_;
228 241
229 aura::Window* window_; 242 aura::Window* window_;
230 243
231 scoped_ptr<WindowObserver> window_observer_; 244 scoped_ptr<WindowObserver> window_observer_;
232 245
233 // Are we in the process of closing? Tracked so fullscreen views can avoid 246 // Are we in the process of closing? Tracked so fullscreen views can avoid
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 // Current tooltip text. 282 // Current tooltip text.
270 string16 tooltip_; 283 string16 tooltip_;
271 284
272 std::vector< base::Callback<void(void)> > on_compositing_ended_callbacks_; 285 std::vector< base::Callback<void(void)> > on_compositing_ended_callbacks_;
273 286
274 std::map<uint64, scoped_refptr<ImageTransportClient> > 287 std::map<uint64, scoped_refptr<ImageTransportClient> >
275 image_transport_clients_; 288 image_transport_clients_;
276 289
277 uint64 current_surface_; 290 uint64 current_surface_;
278 291
292 int32 route_id_;
293 int gpu_host_id_;
294
295 // Factory used to safely scope delayed calls.
296 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_factory_;
297
298 bool is_thumbnailing_;
299
300 base::Callback<void(void)> on_thumbnailing_ended_callback_;
301
279 gfx::GLSurfaceHandle shared_surface_handle_; 302 gfx::GLSurfaceHandle shared_surface_handle_;
280 303
281 // If non-NULL we're in OnPaint() and this is the supplied canvas. 304 // If non-NULL we're in OnPaint() and this is the supplied canvas.
282 gfx::Canvas* paint_canvas_; 305 gfx::Canvas* paint_canvas_;
283 306
284 // Used to record the last position of the mouse. 307 // Used to record the last position of the mouse.
285 // While the mouse is locked, they store the last known position just as mouse 308 // While the mouse is locked, they store the last known position just as mouse
286 // lock was entered. 309 // lock was entered.
287 // Relative to the upper-left corner of the view. 310 // Relative to the upper-left corner of the view.
288 gfx::Point unlocked_mouse_position_; 311 gfx::Point unlocked_mouse_position_;
(...skipping 12 matching lines...) Expand all
301 bool needs_update_texture_; 324 bool needs_update_texture_;
302 325
303 // Used to prevent further resizes while a resize is pending. 326 // Used to prevent further resizes while a resize is pending.
304 class ResizeLock; 327 class ResizeLock;
305 // These locks are the ones waiting for a texture of the right size to come 328 // These locks are the ones waiting for a texture of the right size to come
306 // back from the renderer/GPU process. 329 // back from the renderer/GPU process.
307 std::vector<linked_ptr<ResizeLock> > resize_locks_; 330 std::vector<linked_ptr<ResizeLock> > resize_locks_;
308 // These locks are the ones waiting for a frame to be drawn. 331 // These locks are the ones waiting for a frame to be drawn.
309 std::vector<linked_ptr<ResizeLock> > locks_pending_draw_; 332 std::vector<linked_ptr<ResizeLock> > locks_pending_draw_;
310 333
334 // This lock is for waiting for a front surface to become available to draw.
335 scoped_refptr<aura::CompositorLock> released_front_lock_;
336
311 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 337 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
312 }; 338 };
313 339
314 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 340 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698