OLD | NEW |
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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 int32 width, | 278 int32 width, |
279 int32 height, | 279 int32 height, |
280 TransportDIB::Handle transport_dib) OVERRIDE; | 280 TransportDIB::Handle transport_dib) OVERRIDE; |
281 virtual void AcceleratedSurfaceBuffersSwapped( | 281 virtual void AcceleratedSurfaceBuffersSwapped( |
282 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | 282 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
283 int gpu_host_id) OVERRIDE; | 283 int gpu_host_id) OVERRIDE; |
284 virtual void AcceleratedSurfacePostSubBuffer( | 284 virtual void AcceleratedSurfacePostSubBuffer( |
285 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 285 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
286 int gpu_host_id) OVERRIDE; | 286 int gpu_host_id) OVERRIDE; |
287 virtual void AcceleratedSurfaceSuspend() OVERRIDE; | 287 virtual void AcceleratedSurfaceSuspend() OVERRIDE; |
| 288 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; |
288 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; | 289 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; |
289 virtual gfx::Rect GetRootWindowBounds() OVERRIDE; | 290 virtual gfx::Rect GetRootWindowBounds() OVERRIDE; |
290 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; | 291 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
291 | 292 |
292 void DrawAcceleratedSurfaceInstance( | 293 void DrawAcceleratedSurfaceInstance( |
293 CGLContextObj context, | 294 CGLContextObj context, |
294 gfx::PluginWindowHandle plugin_handle, | 295 gfx::PluginWindowHandle plugin_handle, |
295 NSSize size); | 296 NSSize size); |
296 // Forces the textures associated with any accelerated plugin instances | 297 // Forces the textures associated with any accelerated plugin instances |
297 // to be reloaded. | 298 // to be reloaded. |
(...skipping 16 matching lines...) Expand all Loading... |
314 void KillSelf(); | 315 void KillSelf(); |
315 | 316 |
316 void SetTextInputActive(bool active); | 317 void SetTextInputActive(bool active); |
317 | 318 |
318 // Sends completed plugin IME notification and text back to the renderer. | 319 // Sends completed plugin IME notification and text back to the renderer. |
319 void PluginImeCompositionCompleted(const string16& text, int plugin_id); | 320 void PluginImeCompositionCompleted(const string16& text, int plugin_id); |
320 | 321 |
321 const std::string& selected_text() const { return selected_text_; } | 322 const std::string& selected_text() const { return selected_text_; } |
322 | 323 |
323 // Call setNeedsDisplay on the cocoa_view_. The IOSurface will be drawn during | 324 // Call setNeedsDisplay on the cocoa_view_. The IOSurface will be drawn during |
324 // the next drawRect. The route_id and gpu_host_id are added to a list to be | 325 // the next drawRect. |
325 // acked when the SwapBuffers occurs in drawRect. | 326 void CompositorSwapBuffers(uint64 surface_handle); |
326 void CompositorSwapBuffers(uint64 surface_handle, | |
327 int32 route_id, | |
328 int32 gpu_host_id); | |
329 // Ack pending SwapBuffers requests (queued up by CompositorSwapBuffers), if | |
330 // any, to unblock the GPU process. Has no effect if there are no pending | |
331 // requests. | |
332 void AckPendingCompositorSwapBuffers(); | |
333 | 327 |
334 // These member variables should be private, but the associated ObjC class | 328 // These member variables should be private, but the associated ObjC class |
335 // needs access to them and can't be made a friend. | 329 // needs access to them and can't be made a friend. |
336 | 330 |
337 // The associated Model. Can be NULL if Destroy() is called when | 331 // The associated Model. Can be NULL if Destroy() is called when |
338 // someone (other than superview) has retained |cocoa_view_|. | 332 // someone (other than superview) has retained |cocoa_view_|. |
339 content::RenderWidgetHostImpl* render_widget_host_; | 333 content::RenderWidgetHostImpl* render_widget_host_; |
340 | 334 |
341 // This is true when we are currently painting and thus should handle extra | 335 // This is true when we are currently painting and thus should handle extra |
342 // paint requests by expanding the invalid rect rather than actually painting. | 336 // paint requests by expanding the invalid rect rather than actually painting. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 // Returns whether this render view is a popup (autocomplete window). | 385 // Returns whether this render view is a popup (autocomplete window). |
392 bool IsPopup() const; | 386 bool IsPopup() const; |
393 | 387 |
394 // Updates the display cursor if the current event is over the view's window. | 388 // Updates the display cursor if the current event is over the view's window. |
395 void UpdateCursorIfNecessary(); | 389 void UpdateCursorIfNecessary(); |
396 | 390 |
397 // Shuts down the render_widget_host_. This is a separate function so we can | 391 // Shuts down the render_widget_host_. This is a separate function so we can |
398 // invoke it from the message loop. | 392 // invoke it from the message loop. |
399 void ShutdownHost(); | 393 void ShutdownHost(); |
400 | 394 |
| 395 // Called when a GPU SwapBuffers is received. |
| 396 void GotAcceleratedFrame(); |
| 397 // Called when a software DIB is received. |
| 398 void GotSoftwareFrame(); |
| 399 |
401 // The associated view. This is weak and is inserted into the view hierarchy | 400 // The associated view. This is weak and is inserted into the view hierarchy |
402 // to own this RenderWidgetHostViewMac object. | 401 // to own this RenderWidgetHostViewMac object. |
403 RenderWidgetHostViewCocoa* cocoa_view_; | 402 RenderWidgetHostViewCocoa* cocoa_view_; |
404 | 403 |
405 // The cursor for the page. This is passed up from the renderer. | 404 // The cursor for the page. This is passed up from the renderer. |
406 WebCursor current_cursor_; | 405 WebCursor current_cursor_; |
407 | 406 |
408 // Indicates if the page is loading. | 407 // Indicates if the page is loading. |
409 bool is_loading_; | 408 bool is_loading_; |
410 | 409 |
411 // true if the View is not visible. | 410 // true if the View is not visible. |
412 bool is_hidden_; | 411 bool is_hidden_; |
413 | 412 |
414 // The text to be shown in the tooltip, supplied by the renderer. | 413 // The text to be shown in the tooltip, supplied by the renderer. |
415 string16 tooltip_text_; | 414 string16 tooltip_text_; |
416 | 415 |
417 // Factory used to safely scope delayed calls to ShutdownHost(). | 416 // Factory used to safely scope delayed calls to ShutdownHost(). |
418 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; | 417 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; |
419 | 418 |
420 // selected text on the renderer. | 419 // selected text on the renderer. |
421 std::string selected_text_; | 420 std::string selected_text_; |
422 | 421 |
423 gfx::PluginWindowHandle compositing_surface_; | |
424 | |
425 // List of pending swaps for deferred acking: | |
426 // pairs of (route_id, gpu_host_id). | |
427 std::list<std::pair<int32, int32> > pending_swap_buffers_acks_; | |
428 | |
429 // The fullscreen window used for pepper flash. | 422 // The fullscreen window used for pepper flash. |
430 scoped_nsobject<NSWindow> pepper_fullscreen_window_; | 423 scoped_nsobject<NSWindow> pepper_fullscreen_window_; |
431 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; | 424 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; |
432 | 425 |
433 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 426 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
434 }; | 427 }; |
435 | 428 |
436 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 429 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |