| 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_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> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "cc/layers/delegated_frame_provider.h" |
| 19 #include "cc/layers/delegated_frame_resource_collection.h" |
| 18 #include "cc/resources/texture_mailbox.h" | 20 #include "cc/resources/texture_mailbox.h" |
| 19 #include "content/browser/accessibility/browser_accessibility_manager.h" | 21 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 20 #include "content/browser/aura/image_transport_factory.h" | 22 #include "content/browser/aura/image_transport_factory.h" |
| 21 #include "content/browser/renderer_host/frame_memory_manager.h" | 23 #include "content/browser/renderer_host/frame_memory_manager.h" |
| 22 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 23 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
| 24 #include "content/common/gpu/client/gl_helper.h" | 26 #include "content/common/gpu/client/gl_helper.h" |
| 25 #include "third_party/skia/include/core/SkRegion.h" | 27 #include "third_party/skia/include/core/SkRegion.h" |
| 26 #include "ui/aura/client/activation_change_observer.h" | 28 #include "ui/aura/client/activation_change_observer.h" |
| 27 #include "ui/aura/client/activation_delegate.h" | 29 #include "ui/aura/client/activation_delegate.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 public gfx::DisplayObserver, | 72 public gfx::DisplayObserver, |
| 71 public aura::RootWindowObserver, | 73 public aura::RootWindowObserver, |
| 72 public aura::WindowDelegate, | 74 public aura::WindowDelegate, |
| 73 public aura::client::ActivationDelegate, | 75 public aura::client::ActivationDelegate, |
| 74 public aura::client::ActivationChangeObserver, | 76 public aura::client::ActivationChangeObserver, |
| 75 public aura::client::FocusChangeObserver, | 77 public aura::client::FocusChangeObserver, |
| 76 public aura::client::CursorClientObserver, | 78 public aura::client::CursorClientObserver, |
| 77 public ImageTransportFactoryObserver, | 79 public ImageTransportFactoryObserver, |
| 78 public BrowserAccessibilityDelegate, | 80 public BrowserAccessibilityDelegate, |
| 79 public FrameContainer, | 81 public FrameContainer, |
| 80 public base::SupportsWeakPtr<RenderWidgetHostViewAura> { | 82 public base::SupportsWeakPtr<RenderWidgetHostViewAura>, |
| 83 public cc::DelegatedFrameResourceCollectionClient { |
| 81 public: | 84 public: |
| 82 // Used to notify whenever the paint-content of the view changes. | 85 // Used to notify whenever the paint-content of the view changes. |
| 83 class PaintObserver { | 86 class PaintObserver { |
| 84 public: | 87 public: |
| 85 PaintObserver() {} | 88 PaintObserver() {} |
| 86 virtual ~PaintObserver() {} | 89 virtual ~PaintObserver() {} |
| 87 | 90 |
| 88 // This is called when painting of the page is completed. | 91 // This is called when painting of the page is completed. |
| 89 virtual void OnPaintComplete() = 0; | 92 virtual void OnPaintComplete() = 0; |
| 90 | 93 |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 const BufferPresentedCallback& ack_callback, | 512 const BufferPresentedCallback& ack_callback, |
| 510 const scoped_refptr<ui::Texture>& texture_to_return); | 513 const scoped_refptr<ui::Texture>& texture_to_return); |
| 511 | 514 |
| 512 void SwapDelegatedFrame( | 515 void SwapDelegatedFrame( |
| 513 uint32 output_surface_id, | 516 uint32 output_surface_id, |
| 514 scoped_ptr<cc::DelegatedFrameData> frame_data, | 517 scoped_ptr<cc::DelegatedFrameData> frame_data, |
| 515 float frame_device_scale_factor, | 518 float frame_device_scale_factor, |
| 516 const ui::LatencyInfo& latency_info); | 519 const ui::LatencyInfo& latency_info); |
| 517 void SendDelegatedFrameAck(uint32 output_surface_id); | 520 void SendDelegatedFrameAck(uint32 output_surface_id); |
| 518 | 521 |
| 519 void SwapSoftwareFrame( | 522 // cc::DelegatedFrameProviderClient implementation. |
| 520 uint32 output_surface_id, | 523 virtual void UnusedResourcesAreAvailable() OVERRIDE; |
| 521 scoped_ptr<cc::SoftwareFrameData> frame_data, | 524 |
| 522 float frame_device_scale_factor, | 525 void SwapSoftwareFrame(uint32 output_surface_id, |
| 523 const ui::LatencyInfo& latency_info); | 526 scoped_ptr<cc::SoftwareFrameData> frame_data, |
| 527 float frame_device_scale_factor, |
| 528 const ui::LatencyInfo& latency_info); |
| 524 void SendSoftwareFrameAck(uint32 output_surface_id); | 529 void SendSoftwareFrameAck(uint32 output_surface_id); |
| 525 void SendReclaimSoftwareFrames(); | 530 void SendReclaimSoftwareFrames(); |
| 526 void ReleaseSoftwareFrame(uint32 output_surface_id, | 531 void ReleaseSoftwareFrame(uint32 output_surface_id, |
| 527 unsigned software_frame_id); | 532 unsigned software_frame_id); |
| 528 | 533 |
| 529 void DidReceiveFrameFromRenderer(); | 534 void DidReceiveFrameFromRenderer(); |
| 530 | 535 |
| 531 BrowserAccessibilityManager* GetOrCreateBrowserAccessibilityManager(); | 536 BrowserAccessibilityManager* GetOrCreateBrowserAccessibilityManager(); |
| 532 | 537 |
| 533 #if defined(OS_WIN) | 538 #if defined(OS_WIN) |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 // The damage in the previously presented buffer. | 617 // The damage in the previously presented buffer. |
| 613 SkRegion previous_damage_; | 618 SkRegion previous_damage_; |
| 614 | 619 |
| 615 // Pending damage from previous frames that we skipped. | 620 // Pending damage from previous frames that we skipped. |
| 616 SkRegion skipped_damage_; | 621 SkRegion skipped_damage_; |
| 617 | 622 |
| 618 // True after a delegated frame has been skipped, until a frame is not | 623 // True after a delegated frame has been skipped, until a frame is not |
| 619 // skipped. | 624 // skipped. |
| 620 bool skipped_frames_; | 625 bool skipped_frames_; |
| 621 | 626 |
| 627 // Holds delegated resources that have been given to a DelegatedFrameProvider, |
| 628 // and gives back resources when they are no longer in use for return to the |
| 629 // renderer. |
| 630 scoped_refptr<cc::DelegatedFrameResourceCollection> resource_collection_; |
| 631 |
| 632 // Provides delegated frame updates to the cc::DelegatedRendererLayer. |
| 633 scoped_refptr<cc::DelegatedFrameProvider> frame_provider_; |
| 634 |
| 622 // The size of the last frame that was swapped (even if we skipped it). | 635 // The size of the last frame that was swapped (even if we skipped it). |
| 623 // Used to determine when the skipped_damage_ needs to be reset due to | 636 // Used to determine when the skipped_damage_ needs to be reset due to |
| 624 // size changes between front- and backbuffer. | 637 // size changes between front- and backbuffer. |
| 625 gfx::Size last_swapped_surface_size_; | 638 gfx::Size last_swapped_surface_size_; |
| 626 float last_swapped_surface_scale_factor_; | 639 float last_swapped_surface_scale_factor_; |
| 627 | 640 |
| 628 gfx::GLSurfaceHandle shared_surface_handle_; | 641 gfx::GLSurfaceHandle shared_surface_handle_; |
| 629 | 642 |
| 630 // If non-NULL we're in OnPaint() and this is the supplied canvas. | 643 // If non-NULL we're in OnPaint() and this is the supplied canvas. |
| 631 gfx::Canvas* paint_canvas_; | 644 gfx::Canvas* paint_canvas_; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 unsigned frame_id; | 742 unsigned frame_id; |
| 730 }; | 743 }; |
| 731 std::vector<ReleasedFrameInfo> released_software_frames_; | 744 std::vector<ReleasedFrameInfo> released_software_frames_; |
| 732 | 745 |
| 733 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 746 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
| 734 }; | 747 }; |
| 735 | 748 |
| 736 } // namespace content | 749 } // namespace content |
| 737 | 750 |
| 738 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 751 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| OLD | NEW |