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 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 bool can_compose_inline_; | 428 bool can_compose_inline_; |
429 | 429 |
430 base::scoped_nsobject<CALayer> software_layer_; | 430 base::scoped_nsobject<CALayer> software_layer_; |
431 | 431 |
432 // Accelerated compositing structures. These may be dynamically created and | 432 // Accelerated compositing structures. These may be dynamically created and |
433 // destroyed together in Create/DestroyCompositedIOSurfaceAndLayer. | 433 // destroyed together in Create/DestroyCompositedIOSurfaceAndLayer. |
434 base::scoped_nsobject<CompositingIOSurfaceLayer> compositing_iosurface_layer_; | 434 base::scoped_nsobject<CompositingIOSurfaceLayer> compositing_iosurface_layer_; |
435 scoped_ptr<CompositingIOSurfaceMac> compositing_iosurface_; | 435 scoped_ptr<CompositingIOSurfaceMac> compositing_iosurface_; |
436 scoped_refptr<CompositingIOSurfaceContext> compositing_iosurface_context_; | 436 scoped_refptr<CompositingIOSurfaceContext> compositing_iosurface_context_; |
437 | 437 |
438 // Timer used to dynamically transition the compositing layer in and out of | |
439 // asynchronous mode. | |
440 base::DelayTimer<RenderWidgetHostViewMac> | |
441 compositing_iosurface_layer_async_timer_; | |
442 | |
438 // This holds the current software compositing framebuffer, if any. | 443 // This holds the current software compositing framebuffer, if any. |
439 scoped_ptr<SoftwareFrameManager> software_frame_manager_; | 444 scoped_ptr<SoftwareFrameManager> software_frame_manager_; |
440 | 445 |
441 // Whether to allow overlapping views. | 446 // Whether to allow overlapping views. |
442 bool allow_overlapping_views_; | 447 bool allow_overlapping_views_; |
443 | 448 |
444 // Whether to use the CoreAnimation path to draw content. | 449 // Whether to use the CoreAnimation path to draw content. |
445 bool use_core_animation_; | 450 bool use_core_animation_; |
446 | 451 |
447 // Latency info to send back when the next frame appears on the | 452 // Latency info to send back when the next frame appears on the |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
505 | 510 |
506 // Unbind the GL context (if any) that is bound to |cocoa_view_|. | 511 // Unbind the GL context (if any) that is bound to |cocoa_view_|. |
507 void ClearBoundContextDrawable(); | 512 void ClearBoundContextDrawable(); |
508 | 513 |
509 // Called when a GPU SwapBuffers is received. | 514 // Called when a GPU SwapBuffers is received. |
510 void GotAcceleratedFrame(); | 515 void GotAcceleratedFrame(); |
511 | 516 |
512 // Called when a software DIB is received. | 517 // Called when a software DIB is received. |
513 void GotSoftwareFrame(); | 518 void GotSoftwareFrame(); |
514 | 519 |
520 // Called if it has been a quarter-second since a GPU SwapBuffers has been | |
Avi (use Gerrit)
2014/02/14 02:11:29
You say 250ms here...
| |
521 // received. In this case, switch from polling for frames to pushing them. | |
522 void TimerSinceGotAcceleratedFrameFired(); | |
523 | |
515 void OnPluginFocusChanged(bool focused, int plugin_id); | 524 void OnPluginFocusChanged(bool focused, int plugin_id); |
516 void OnStartPluginIme(); | 525 void OnStartPluginIme(); |
517 | 526 |
518 // Convert |rect| from the views coordinate (upper-left origin) into | 527 // Convert |rect| from the views coordinate (upper-left origin) into |
519 // the OpenGL coordinate (lower-left origin) and scale for HiDPI displays. | 528 // the OpenGL coordinate (lower-left origin) and scale for HiDPI displays. |
520 gfx::Rect GetScaledOpenGLPixelRect(const gfx::Rect& rect); | 529 gfx::Rect GetScaledOpenGLPixelRect(const gfx::Rect& rect); |
521 | 530 |
522 // The associated view. This is weak and is inserted into the view hierarchy | 531 // The associated view. This is weak and is inserted into the view hierarchy |
523 // to own this RenderWidgetHostViewMac object. Set to nil at the start of the | 532 // to own this RenderWidgetHostViewMac object. Set to nil at the start of the |
524 // destructor. | 533 // destructor. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
577 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 586 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
578 | 587 |
579 base::WeakPtrFactory<RenderWidgetHostViewMac> | 588 base::WeakPtrFactory<RenderWidgetHostViewMac> |
580 software_frame_weak_ptr_factory_; | 589 software_frame_weak_ptr_factory_; |
581 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 590 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
582 }; | 591 }; |
583 | 592 |
584 } // namespace content | 593 } // namespace content |
585 | 594 |
586 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 595 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |