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

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

Issue 11861020: Aura: Browser-side changes for Composite-To-Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 virtual void SetHasHorizontalScrollbar( 169 virtual void SetHasHorizontalScrollbar(
170 bool has_horizontal_scrollbar) OVERRIDE; 170 bool has_horizontal_scrollbar) OVERRIDE;
171 virtual void SetScrollOffsetPinning( 171 virtual void SetScrollOffsetPinning(
172 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; 172 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE;
173 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; 173 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
174 virtual void OnAccessibilityNotifications( 174 virtual void OnAccessibilityNotifications(
175 const std::vector<AccessibilityHostMsg_NotificationParams>& 175 const std::vector<AccessibilityHostMsg_NotificationParams>&
176 params) OVERRIDE; 176 params) OVERRIDE;
177 virtual bool LockMouse() OVERRIDE; 177 virtual bool LockMouse() OVERRIDE;
178 virtual void UnlockMouse() OVERRIDE; 178 virtual void UnlockMouse() OVERRIDE;
179 virtual void OnSwapCompositorFrame(
180 const cc::CompositorFrame& frame) OVERRIDE;
179 181
180 // Overridden from ui::TextInputClient: 182 // Overridden from ui::TextInputClient:
181 virtual void SetCompositionText( 183 virtual void SetCompositionText(
182 const ui::CompositionText& composition) OVERRIDE; 184 const ui::CompositionText& composition) OVERRIDE;
183 virtual void ConfirmCompositionText() OVERRIDE; 185 virtual void ConfirmCompositionText() OVERRIDE;
184 virtual void ClearCompositionText() OVERRIDE; 186 virtual void ClearCompositionText() OVERRIDE;
185 virtual void InsertText(const string16& text) OVERRIDE; 187 virtual void InsertText(const string16& text) OVERRIDE;
186 virtual void InsertChar(char16 ch, int flags) OVERRIDE; 188 virtual void InsertChar(char16 ch, int flags) OVERRIDE;
187 virtual ui::TextInputType GetTextInputType() const OVERRIDE; 189 virtual ui::TextInputType GetTextInputType() const OVERRIDE;
188 virtual bool CanComposeInline() const OVERRIDE; 190 virtual bool CanComposeInline() const OVERRIDE;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 // SchedulePaint() is invoked for |rect|. 313 // SchedulePaint() is invoked for |rect|.
312 void SchedulePaintIfNotInClip(const gfx::Rect& rect, const gfx::Rect& clip); 314 void SchedulePaintIfNotInClip(const gfx::Rect& rect, const gfx::Rect& clip);
313 315
314 // Helper method to determine if, in mouse locked mode, the cursor should be 316 // Helper method to determine if, in mouse locked mode, the cursor should be
315 // moved to center. 317 // moved to center.
316 bool ShouldMoveToCenter(); 318 bool ShouldMoveToCenter();
317 319
318 // Run the compositing callbacks. 320 // Run the compositing callbacks.
319 void RunCompositingDidCommitCallbacks(); 321 void RunCompositingDidCommitCallbacks();
320 322
321 struct BufferPresentedParams {
322 BufferPresentedParams(int route_id,
323 int gpu_host_id);
324 ~BufferPresentedParams();
325
326 int32 route_id;
327 int gpu_host_id;
328 scoped_refptr<ui::Texture> texture_to_produce;
329 };
330
331 // Insert a sync point into the compositor's command stream and acknowledge
332 // that we have presented the accelerated surface buffer.
333 static void InsertSyncPointAndACK(const BufferPresentedParams& params);
334
335 // Called after |window_| is parented to a RootWindow. 323 // Called after |window_| is parented to a RootWindow.
336 void AddedToRootWindow(); 324 void AddedToRootWindow();
337 325
338 // Called prior to removing |window_| from a RootWindow. 326 // Called prior to removing |window_| from a RootWindow.
339 void RemovingFromRootWindow(); 327 void RemovingFromRootWindow();
340 328
341 // Called after commit for the last reference to the texture going away 329 // Called after commit for the last reference to the texture going away
342 // after it was released as the frontbuffer. 330 // after it was released as the frontbuffer.
343 void SetSurfaceNotInUseByCompositor(scoped_refptr<ui::Texture>); 331 void SetSurfaceNotInUseByCompositor(scoped_refptr<ui::Texture>);
344 332
345 // Called after async thumbnailer task completes. Used to call 333 // Called after async thumbnailer task completes. Used to call
346 // AdjustSurfaceProtection. 334 // AdjustSurfaceProtection.
347 static void CopyFromCompositingSurfaceFinished( 335 static void CopyFromCompositingSurfaceFinished(
348 base::WeakPtr<RenderWidgetHostViewAura> render_widget_host_view, 336 base::WeakPtr<RenderWidgetHostViewAura> render_widget_host_view,
349 const SkBitmap& bitmap, 337 const SkBitmap& bitmap,
350 const base::Callback<void(bool, const SkBitmap&)>& callback, 338 const base::Callback<void(bool, const SkBitmap&)>& callback,
351 bool result); 339 bool result);
352 340
353 ui::Compositor* GetCompositor(); 341 ui::Compositor* GetCompositor();
354 342
355 // Detaches |this| from the input method object. 343 // Detaches |this| from the input method object.
356 void DetachFromInputMethod(); 344 void DetachFromInputMethod();
357 345
358 // Dismisses a Web Popup on mouse press outside the popup and its parent. 346 // Dismisses a Web Popup on mouse press outside the popup and its parent.
359 void ApplyEventFilterForPopupExit(ui::MouseEvent* event); 347 void ApplyEventFilterForPopupExit(ui::MouseEvent* event);
360 348
361 // Converts |rect| from window coordinate to screen coordinate. 349 // Converts |rect| from window coordinate to screen coordinate.
362 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect); 350 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect);
363 351
352 typedef base::Callback<void(bool, const scoped_refptr<ui::Texture>&)>
353 BufferPresentedCallback;
354
355 // The common entry point for full buffer updates from renderer
356 // and GPU process.
357 void BuffersSwapped(const gfx::Size& size,
358 const std::string& mailbox_name,
359 const BufferPresentedCallback& ack_callback);
360
364 bool SwapBuffersPrepare(const gfx::Rect& surface_rect, 361 bool SwapBuffersPrepare(const gfx::Rect& surface_rect,
365 const gfx::Rect& damage_rect, 362 const gfx::Rect& damage_rect,
366 const std::string& mailbox_name, 363 const std::string& mailbox_name,
367 BufferPresentedParams* params); 364 const BufferPresentedCallback& ack_callback);
368 365
369 void SwapBuffersCompleted(const BufferPresentedParams& params); 366 void SwapBuffersCompleted(
367 const BufferPresentedCallback& ack_callback,
368 const scoped_refptr<ui::Texture>& texture_to_return);
370 369
371 #if defined(OS_WIN) 370 #if defined(OS_WIN)
372 // Sets the cutout rects from transient windows. These are rectangles that 371 // Sets the cutout rects from transient windows. These are rectangles that
373 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout 372 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout
374 // rects. 373 // rects.
375 void UpdateTransientRects(const std::vector<gfx::Rect>& rects); 374 void UpdateTransientRects(const std::vector<gfx::Rect>& rects);
376 375
377 // Updates the total list of cutout rects, which is the union of transient 376 // Updates the total list of cutout rects, which is the union of transient
378 // windows and constrained windows. 377 // windows and constrained windows.
379 void UpdateCutoutRects(); 378 void UpdateCutoutRects();
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 #endif 527 #endif
529 528
530 base::TimeTicks last_draw_ended_; 529 base::TimeTicks last_draw_ended_;
531 530
532 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 531 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
533 }; 532 };
534 533
535 } // namespace content 534 } // namespace content
536 535
537 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 536 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698