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" | 18 #include "cc/layers/delegated_frame_provider.h" |
19 #include "cc/layers/delegated_frame_resource_collection.h" | 19 #include "cc/layers/delegated_frame_resource_collection.h" |
20 #include "cc/resources/texture_mailbox.h" | 20 #include "cc/resources/texture_mailbox.h" |
21 #include "content/browser/accessibility/browser_accessibility_manager.h" | 21 #include "content/browser/accessibility/browser_accessibility_manager.h" |
22 #include "content/browser/aura/image_transport_factory.h" | 22 #include "content/browser/aura/image_transport_factory.h" |
| 23 #include "content/browser/renderer_host/delegated_frame_evictor.h" |
23 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
24 #include "content/browser/renderer_host/software_frame_manager.h" | 25 #include "content/browser/renderer_host/software_frame_manager.h" |
25 #include "content/common/content_export.h" | 26 #include "content/common/content_export.h" |
26 #include "content/common/gpu/client/gl_helper.h" | 27 #include "content/common/gpu/client/gl_helper.h" |
27 #include "third_party/skia/include/core/SkRegion.h" | 28 #include "third_party/skia/include/core/SkRegion.h" |
28 #include "ui/aura/client/activation_change_observer.h" | 29 #include "ui/aura/client/activation_change_observer.h" |
29 #include "ui/aura/client/activation_delegate.h" | 30 #include "ui/aura/client/activation_delegate.h" |
30 #include "ui/aura/client/cursor_client_observer.h" | 31 #include "ui/aura/client/cursor_client_observer.h" |
31 #include "ui/aura/client/focus_change_observer.h" | 32 #include "ui/aura/client/focus_change_observer.h" |
32 #include "ui/aura/root_window_observer.h" | 33 #include "ui/aura/root_window_observer.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 public gfx::DisplayObserver, | 72 public gfx::DisplayObserver, |
72 public aura::RootWindowObserver, | 73 public aura::RootWindowObserver, |
73 public aura::WindowDelegate, | 74 public aura::WindowDelegate, |
74 public aura::client::ActivationDelegate, | 75 public aura::client::ActivationDelegate, |
75 public aura::client::ActivationChangeObserver, | 76 public aura::client::ActivationChangeObserver, |
76 public aura::client::FocusChangeObserver, | 77 public aura::client::FocusChangeObserver, |
77 public aura::client::CursorClientObserver, | 78 public aura::client::CursorClientObserver, |
78 public ImageTransportFactoryObserver, | 79 public ImageTransportFactoryObserver, |
79 public BrowserAccessibilityDelegate, | 80 public BrowserAccessibilityDelegate, |
80 public SoftwareFrameManagerClient, | 81 public SoftwareFrameManagerClient, |
| 82 public DelegatedFrameEvictorClient, |
81 public base::SupportsWeakPtr<RenderWidgetHostViewAura>, | 83 public base::SupportsWeakPtr<RenderWidgetHostViewAura>, |
82 public cc::DelegatedFrameResourceCollectionClient { | 84 public cc::DelegatedFrameResourceCollectionClient { |
83 public: | 85 public: |
84 // Used to notify whenever the paint-content of the view changes. | 86 // Used to notify whenever the paint-content of the view changes. |
85 class PaintObserver { | 87 class PaintObserver { |
86 public: | 88 public: |
87 PaintObserver() {} | 89 PaintObserver() {} |
88 virtual ~PaintObserver() {} | 90 virtual ~PaintObserver() {} |
89 | 91 |
90 // This is called when painting of the page is completed. | 92 // This is called when painting of the page is completed. |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 base::TimeDelta interval) OVERRIDE; | 383 base::TimeDelta interval) OVERRIDE; |
382 | 384 |
383 private: | 385 private: |
384 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText); | 386 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText); |
385 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState); | 387 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState); |
386 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync); | 388 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync); |
387 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow); | 389 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow); |
388 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, | 390 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
389 SkippedDelegatedFrames); | 391 SkippedDelegatedFrames); |
390 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, OutputSurfaceIdChange); | 392 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, OutputSurfaceIdChange); |
| 393 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
| 394 DiscardDelegatedFrames); |
391 | 395 |
392 class WindowObserver; | 396 class WindowObserver; |
393 friend class WindowObserver; | 397 friend class WindowObserver; |
394 #if defined(OS_WIN) | 398 #if defined(OS_WIN) |
395 class TransientWindowObserver; | 399 class TransientWindowObserver; |
396 friend class TransientWindowObserver; | 400 friend class TransientWindowObserver; |
397 #endif | 401 #endif |
398 | 402 |
399 // Overridden from ImageTransportFactoryObserver: | 403 // Overridden from ImageTransportFactoryObserver: |
400 virtual void OnLostResources() OVERRIDE; | 404 virtual void OnLostResources() OVERRIDE; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 const scoped_refptr<ui::Texture>& texture_to_return); | 524 const scoped_refptr<ui::Texture>& texture_to_return); |
521 | 525 |
522 void SwapDelegatedFrame( | 526 void SwapDelegatedFrame( |
523 uint32 output_surface_id, | 527 uint32 output_surface_id, |
524 scoped_ptr<cc::DelegatedFrameData> frame_data, | 528 scoped_ptr<cc::DelegatedFrameData> frame_data, |
525 float frame_device_scale_factor, | 529 float frame_device_scale_factor, |
526 const ui::LatencyInfo& latency_info); | 530 const ui::LatencyInfo& latency_info); |
527 void SendDelegatedFrameAck(uint32 output_surface_id); | 531 void SendDelegatedFrameAck(uint32 output_surface_id); |
528 void SendReturnedDelegatedResources(uint32 output_surface_id); | 532 void SendReturnedDelegatedResources(uint32 output_surface_id); |
529 | 533 |
| 534 // DelegatedFrameEvictorClient implementation. |
| 535 virtual void EvictDelegatedFrame() OVERRIDE; |
| 536 |
530 // cc::DelegatedFrameProviderClient implementation. | 537 // cc::DelegatedFrameProviderClient implementation. |
531 virtual void UnusedResourcesAreAvailable() OVERRIDE; | 538 virtual void UnusedResourcesAreAvailable() OVERRIDE; |
532 | 539 |
533 void SwapSoftwareFrame(uint32 output_surface_id, | 540 void SwapSoftwareFrame(uint32 output_surface_id, |
534 scoped_ptr<cc::SoftwareFrameData> frame_data, | 541 scoped_ptr<cc::SoftwareFrameData> frame_data, |
535 float frame_device_scale_factor, | 542 float frame_device_scale_factor, |
536 const ui::LatencyInfo& latency_info); | 543 const ui::LatencyInfo& latency_info); |
537 void SendSoftwareFrameAck(uint32 output_surface_id); | 544 void SendSoftwareFrameAck(uint32 output_surface_id); |
538 void SendReclaimSoftwareFrames(); | 545 void SendReclaimSoftwareFrames(); |
539 void ReleaseSoftwareFrame(uint32 output_surface_id, | 546 void ReleaseSoftwareFrame(uint32 output_surface_id, |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 | 754 |
748 ui::LatencyInfo software_latency_info_; | 755 ui::LatencyInfo software_latency_info_; |
749 | 756 |
750 struct ReleasedFrameInfo { | 757 struct ReleasedFrameInfo { |
751 ReleasedFrameInfo(uint32 output_id, unsigned software_frame_id) | 758 ReleasedFrameInfo(uint32 output_id, unsigned software_frame_id) |
752 : output_surface_id(output_id), frame_id(software_frame_id) {} | 759 : output_surface_id(output_id), frame_id(software_frame_id) {} |
753 uint32 output_surface_id; | 760 uint32 output_surface_id; |
754 unsigned frame_id; | 761 unsigned frame_id; |
755 }; | 762 }; |
756 scoped_ptr<ReleasedFrameInfo> released_software_frame_; | 763 scoped_ptr<ReleasedFrameInfo> released_software_frame_; |
| 764 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
757 | 765 |
758 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; | 766 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
759 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 767 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
760 }; | 768 }; |
761 | 769 |
762 } // namespace content | 770 } // namespace content |
763 | 771 |
764 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 772 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |