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

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

Issue 10382213: Defer CGLFlushDrawable until OSX-requested drawRect to avoid spinning when window is obscured. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test compile Created 8 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) 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_MAC_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #import <Cocoa/Cocoa.h> 9 #import <Cocoa/Cocoa.h>
10 #include <list> 10 #include <list>
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 int32 height, 276 int32 height,
277 TransportDIB::Handle transport_dib) OVERRIDE; 277 TransportDIB::Handle transport_dib) OVERRIDE;
278 virtual void AcceleratedSurfaceBuffersSwapped( 278 virtual void AcceleratedSurfaceBuffersSwapped(
279 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, 279 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
280 int gpu_host_id) OVERRIDE; 280 int gpu_host_id) OVERRIDE;
281 virtual void AcceleratedSurfacePostSubBuffer( 281 virtual void AcceleratedSurfacePostSubBuffer(
282 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, 282 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
283 int gpu_host_id) OVERRIDE; 283 int gpu_host_id) OVERRIDE;
284 virtual void AcceleratedSurfaceSuspend() OVERRIDE; 284 virtual void AcceleratedSurfaceSuspend() OVERRIDE;
285 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; 285 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE;
286 virtual void AboutToWaitForBackingStoreMsg() OVERRIDE;
286 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; 287 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE;
287 virtual gfx::Rect GetRootWindowBounds() OVERRIDE; 288 virtual gfx::Rect GetRootWindowBounds() OVERRIDE;
288 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; 289 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
289 290
290 void DrawAcceleratedSurfaceInstance( 291 void DrawAcceleratedSurfaceInstance(
291 CGLContextObj context, 292 CGLContextObj context,
292 gfx::PluginWindowHandle plugin_handle, 293 gfx::PluginWindowHandle plugin_handle,
293 NSSize size); 294 NSSize size);
294 // Forces the textures associated with any accelerated plugin instances 295 // Forces the textures associated with any accelerated plugin instances
295 // to be reloaded. 296 // to be reloaded.
(...skipping 16 matching lines...) Expand all
312 void KillSelf(); 313 void KillSelf();
313 314
314 void SetTextInputActive(bool active); 315 void SetTextInputActive(bool active);
315 316
316 // Sends completed plugin IME notification and text back to the renderer. 317 // Sends completed plugin IME notification and text back to the renderer.
317 void PluginImeCompositionCompleted(const string16& text, int plugin_id); 318 void PluginImeCompositionCompleted(const string16& text, int plugin_id);
318 319
319 const std::string& selected_text() const { return selected_text_; } 320 const std::string& selected_text() const { return selected_text_; }
320 321
321 // Call setNeedsDisplay on the cocoa_view_. The IOSurface will be drawn during 322 // Call setNeedsDisplay on the cocoa_view_. The IOSurface will be drawn during
322 // the next drawRect. 323 // the next drawRect. Return true if the Ack should be sent, false if it
323 void CompositorSwapBuffers(uint64 surface_handle); 324 // should be deferred until drawRect.
325 bool CompositorSwapBuffers(uint64 surface_handle);
326 // Ack pending SwapBuffers requests, if any, to unblock the GPU process. Has
327 // no effect if there are no pending requests.
328 void AckPendingSwapBuffers();
324 329
325 // These member variables should be private, but the associated ObjC class 330 // These member variables should be private, but the associated ObjC class
326 // needs access to them and can't be made a friend. 331 // needs access to them and can't be made a friend.
327 332
328 // The associated Model. Can be NULL if Destroy() is called when 333 // The associated Model. Can be NULL if Destroy() is called when
329 // someone (other than superview) has retained |cocoa_view_|. 334 // someone (other than superview) has retained |cocoa_view_|.
330 content::RenderWidgetHostImpl* render_widget_host_; 335 content::RenderWidgetHostImpl* render_widget_host_;
331 336
332 // This is true when we are currently painting and thus should handle extra 337 // This is true when we are currently painting and thus should handle extra
333 // paint requests by expanding the invalid rect rather than actually painting. 338 // paint requests by expanding the invalid rect rather than actually painting.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // Factory used to safely scope delayed calls to ShutdownHost(). 418 // Factory used to safely scope delayed calls to ShutdownHost().
414 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; 419 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_;
415 420
416 // selected text on the renderer. 421 // selected text on the renderer.
417 std::string selected_text_; 422 std::string selected_text_;
418 423
419 // The fullscreen window used for pepper flash. 424 // The fullscreen window used for pepper flash.
420 scoped_nsobject<NSWindow> pepper_fullscreen_window_; 425 scoped_nsobject<NSWindow> pepper_fullscreen_window_;
421 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; 426 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_;
422 427
428 // List of pending swaps for deferred acking:
429 // pairs of (route_id, gpu_host_id).
430 std::list<std::pair<int32, int32> > pending_swap_buffers_acks_;
431
423 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 432 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
424 }; 433 };
425 434
426 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 435 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698