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/frame_memory_manager.h" | |
24 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 23 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 24 #include "content/browser/renderer_host/software_frame_manager.h" |
25 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
26 #include "content/common/gpu/client/gl_helper.h" | 26 #include "content/common/gpu/client/gl_helper.h" |
27 #include "third_party/skia/include/core/SkRegion.h" | 27 #include "third_party/skia/include/core/SkRegion.h" |
28 #include "ui/aura/client/activation_change_observer.h" | 28 #include "ui/aura/client/activation_change_observer.h" |
29 #include "ui/aura/client/activation_delegate.h" | 29 #include "ui/aura/client/activation_delegate.h" |
30 #include "ui/aura/client/cursor_client_observer.h" | 30 #include "ui/aura/client/cursor_client_observer.h" |
31 #include "ui/aura/client/focus_change_observer.h" | 31 #include "ui/aura/client/focus_change_observer.h" |
32 #include "ui/aura/root_window_observer.h" | 32 #include "ui/aura/root_window_observer.h" |
33 #include "ui/aura/window_delegate.h" | 33 #include "ui/aura/window_delegate.h" |
34 #include "ui/base/ime/text_input_client.h" | 34 #include "ui/base/ime/text_input_client.h" |
(...skipping 17 matching lines...) Expand all Loading... |
52 class Display; | 52 class Display; |
53 } | 53 } |
54 | 54 |
55 namespace ui { | 55 namespace ui { |
56 class CompositorLock; | 56 class CompositorLock; |
57 class InputMethod; | 57 class InputMethod; |
58 class Texture; | 58 class Texture; |
59 } | 59 } |
60 | 60 |
61 namespace content { | 61 namespace content { |
62 class MemoryHolder; | |
63 class RenderWidgetHostImpl; | 62 class RenderWidgetHostImpl; |
64 class RenderWidgetHostView; | 63 class RenderWidgetHostView; |
65 class ResizeLock; | 64 class ResizeLock; |
66 | 65 |
67 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 66 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
68 class CONTENT_EXPORT RenderWidgetHostViewAura | 67 class CONTENT_EXPORT RenderWidgetHostViewAura |
69 : public RenderWidgetHostViewBase, | 68 : public RenderWidgetHostViewBase, |
70 public ui::CompositorObserver, | 69 public ui::CompositorObserver, |
71 public ui::TextInputClient, | 70 public ui::TextInputClient, |
72 public gfx::DisplayObserver, | 71 public gfx::DisplayObserver, |
73 public aura::RootWindowObserver, | 72 public aura::RootWindowObserver, |
74 public aura::WindowDelegate, | 73 public aura::WindowDelegate, |
75 public aura::client::ActivationDelegate, | 74 public aura::client::ActivationDelegate, |
76 public aura::client::ActivationChangeObserver, | 75 public aura::client::ActivationChangeObserver, |
77 public aura::client::FocusChangeObserver, | 76 public aura::client::FocusChangeObserver, |
78 public aura::client::CursorClientObserver, | 77 public aura::client::CursorClientObserver, |
79 public ImageTransportFactoryObserver, | 78 public ImageTransportFactoryObserver, |
80 public BrowserAccessibilityDelegate, | 79 public BrowserAccessibilityDelegate, |
81 public FrameContainer, | 80 public SoftwareFrameManagerClient, |
82 public base::SupportsWeakPtr<RenderWidgetHostViewAura>, | 81 public base::SupportsWeakPtr<RenderWidgetHostViewAura>, |
83 public cc::DelegatedFrameResourceCollectionClient { | 82 public cc::DelegatedFrameResourceCollectionClient { |
84 public: | 83 public: |
85 // Used to notify whenever the paint-content of the view changes. | 84 // Used to notify whenever the paint-content of the view changes. |
86 class PaintObserver { | 85 class PaintObserver { |
87 public: | 86 public: |
88 PaintObserver() {} | 87 PaintObserver() {} |
89 virtual ~PaintObserver() {} | 88 virtual ~PaintObserver() {} |
90 | 89 |
91 // This is called when painting of the page is completed. | 90 // This is called when painting of the page is completed. |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE; | 324 virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE; |
326 | 325 |
327 // Overridden from aura::client::FocusChangeObserver: | 326 // Overridden from aura::client::FocusChangeObserver: |
328 virtual void OnWindowFocused(aura::Window* gained_focus, | 327 virtual void OnWindowFocused(aura::Window* gained_focus, |
329 aura::Window* lost_focus) OVERRIDE; | 328 aura::Window* lost_focus) OVERRIDE; |
330 | 329 |
331 // Overridden from aura::RootWindowObserver: | 330 // Overridden from aura::RootWindowObserver: |
332 virtual void OnRootWindowHostMoved(const aura::RootWindow* root, | 331 virtual void OnRootWindowHostMoved(const aura::RootWindow* root, |
333 const gfx::Point& new_origin) OVERRIDE; | 332 const gfx::Point& new_origin) OVERRIDE; |
334 | 333 |
335 // FrameContainer implementation: | 334 // SoftwareFrameManagerClient implementation: |
336 virtual void ReleaseCurrentFrame() OVERRIDE; | 335 virtual void SoftwareFrameWasFreed( |
| 336 uint32 output_surface_id, unsigned frame_id) OVERRIDE; |
| 337 virtual void ReleaseReferencesToSoftwareFrame() OVERRIDE; |
337 | 338 |
338 bool CanCopyToBitmap() const; | 339 bool CanCopyToBitmap() const; |
339 | 340 |
340 #if defined(OS_WIN) | 341 #if defined(OS_WIN) |
341 // Sets the cutout rects from constrained windows. These are rectangles that | 342 // Sets the cutout rects from constrained windows. These are rectangles that |
342 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout | 343 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout |
343 // rects. | 344 // rects. |
344 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); | 345 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); |
345 #endif | 346 #endif |
346 | 347 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 bool has_composition_text_; | 607 bool has_composition_text_; |
607 | 608 |
608 // Current tooltip text. | 609 // Current tooltip text. |
609 string16 tooltip_; | 610 string16 tooltip_; |
610 | 611 |
611 std::vector<base::Closure> on_compositing_did_commit_callbacks_; | 612 std::vector<base::Closure> on_compositing_did_commit_callbacks_; |
612 | 613 |
613 // The current frontbuffer texture. | 614 // The current frontbuffer texture. |
614 scoped_refptr<ui::Texture> current_surface_; | 615 scoped_refptr<ui::Texture> current_surface_; |
615 | 616 |
616 // This holds the current software framebuffer. | 617 // This holds the current software framebuffer, if any. |
617 scoped_refptr<MemoryHolder> framebuffer_holder_; | 618 scoped_ptr<SoftwareFrameManager> software_frame_manager_; |
618 | 619 |
619 // With delegated renderer, this is the last output surface, used to | 620 // With delegated renderer, this is the last output surface, used to |
620 // disambiguate resources with the same id coming from different output | 621 // disambiguate resources with the same id coming from different output |
621 // surfaces. | 622 // surfaces. |
622 uint32 last_output_surface_id_; | 623 uint32 last_output_surface_id_; |
623 | 624 |
624 // The number of delegated frame acks that are pending, to delay resource | 625 // The number of delegated frame acks that are pending, to delay resource |
625 // returns until the acks are sent. | 626 // returns until the acks are sent. |
626 int pending_delegated_ack_count_; | 627 int pending_delegated_ack_count_; |
627 | 628 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 ui::LatencyInfo software_latency_info_; | 748 ui::LatencyInfo software_latency_info_; |
748 | 749 |
749 struct ReleasedFrameInfo { | 750 struct ReleasedFrameInfo { |
750 ReleasedFrameInfo(uint32 output_id, unsigned software_frame_id) | 751 ReleasedFrameInfo(uint32 output_id, unsigned software_frame_id) |
751 : output_surface_id(output_id), frame_id(software_frame_id) {} | 752 : output_surface_id(output_id), frame_id(software_frame_id) {} |
752 uint32 output_surface_id; | 753 uint32 output_surface_id; |
753 unsigned frame_id; | 754 unsigned frame_id; |
754 }; | 755 }; |
755 scoped_ptr<ReleasedFrameInfo> released_software_frame_; | 756 scoped_ptr<ReleasedFrameInfo> released_software_frame_; |
756 | 757 |
| 758 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
757 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 759 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
758 }; | 760 }; |
759 | 761 |
760 } // namespace content | 762 } // namespace content |
761 | 763 |
762 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 764 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |