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/resources/texture_mailbox.h" | 18 #include "cc/resources/texture_mailbox.h" |
19 #include "content/browser/accessibility/browser_accessibility_manager.h" | 19 #include "content/browser/accessibility/browser_accessibility_manager.h" |
20 #include "content/browser/aura/image_transport_factory.h" | 20 #include "content/browser/aura/image_transport_factory.h" |
21 #include "content/browser/renderer_host/frame_memory_manager.h" | 21 #include "content/browser/renderer_host/frame_memory_manager.h" |
22 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 22 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 23 #include "content/browser/renderer_host/software_framebuffer.h" |
23 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
24 #include "content/common/gpu/client/gl_helper.h" | 25 #include "content/common/gpu/client/gl_helper.h" |
25 #include "third_party/skia/include/core/SkRegion.h" | 26 #include "third_party/skia/include/core/SkRegion.h" |
26 #include "ui/aura/client/activation_change_observer.h" | 27 #include "ui/aura/client/activation_change_observer.h" |
27 #include "ui/aura/client/activation_delegate.h" | 28 #include "ui/aura/client/activation_delegate.h" |
28 #include "ui/aura/client/cursor_client_observer.h" | 29 #include "ui/aura/client/cursor_client_observer.h" |
29 #include "ui/aura/client/focus_change_observer.h" | 30 #include "ui/aura/client/focus_change_observer.h" |
30 #include "ui/aura/root_window_observer.h" | 31 #include "ui/aura/root_window_observer.h" |
31 #include "ui/aura/window_delegate.h" | 32 #include "ui/aura/window_delegate.h" |
32 #include "ui/base/ime/text_input_client.h" | 33 #include "ui/base/ime/text_input_client.h" |
(...skipping 25 matching lines...) Expand all Loading... |
58 | 59 |
59 namespace content { | 60 namespace content { |
60 class MemoryHolder; | 61 class MemoryHolder; |
61 class RenderWidgetHostImpl; | 62 class RenderWidgetHostImpl; |
62 class RenderWidgetHostView; | 63 class RenderWidgetHostView; |
63 class ResizeLock; | 64 class ResizeLock; |
64 | 65 |
65 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 66 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
66 class CONTENT_EXPORT RenderWidgetHostViewAura | 67 class CONTENT_EXPORT RenderWidgetHostViewAura |
67 : public RenderWidgetHostViewBase, | 68 : public RenderWidgetHostViewBase, |
| 69 public SoftwareFramebufferClient, |
68 public ui::CompositorObserver, | 70 public ui::CompositorObserver, |
69 public ui::TextInputClient, | 71 public ui::TextInputClient, |
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, | |
80 public base::SupportsWeakPtr<RenderWidgetHostViewAura> { | 81 public base::SupportsWeakPtr<RenderWidgetHostViewAura> { |
81 public: | 82 public: |
82 // Used to notify whenever the paint-content of the view changes. | 83 // Used to notify whenever the paint-content of the view changes. |
83 class PaintObserver { | 84 class PaintObserver { |
84 public: | 85 public: |
85 PaintObserver() {} | 86 PaintObserver() {} |
86 virtual ~PaintObserver() {} | 87 virtual ~PaintObserver() {} |
87 | 88 |
88 // This is called when painting of the page is completed. | 89 // This is called when painting of the page is completed. |
89 virtual void OnPaintComplete() = 0; | 90 virtual void OnPaintComplete() = 0; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE; | 323 virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE; |
323 | 324 |
324 // Overridden from aura::client::FocusChangeObserver: | 325 // Overridden from aura::client::FocusChangeObserver: |
325 virtual void OnWindowFocused(aura::Window* gained_focus, | 326 virtual void OnWindowFocused(aura::Window* gained_focus, |
326 aura::Window* lost_focus) OVERRIDE; | 327 aura::Window* lost_focus) OVERRIDE; |
327 | 328 |
328 // Overridden from aura::RootWindowObserver: | 329 // Overridden from aura::RootWindowObserver: |
329 virtual void OnRootWindowHostMoved(const aura::RootWindow* root, | 330 virtual void OnRootWindowHostMoved(const aura::RootWindow* root, |
330 const gfx::Point& new_origin) OVERRIDE; | 331 const gfx::Point& new_origin) OVERRIDE; |
331 | 332 |
332 // FrameContainer implementation: | 333 // SoftwareFramebufferClient implementation: |
333 virtual void ReleaseCurrentFrame() OVERRIDE; | 334 virtual void CurrentSoftwareFrameWasDiscarded() OVERRIDE; |
334 | 335 |
335 bool CanCopyToBitmap() const; | 336 bool CanCopyToBitmap() const; |
336 | 337 |
337 #if defined(OS_WIN) | 338 #if defined(OS_WIN) |
338 // Sets the cutout rects from constrained windows. These are rectangles that | 339 // Sets the cutout rects from constrained windows. These are rectangles that |
339 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout | 340 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout |
340 // rects. | 341 // rects. |
341 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); | 342 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); |
342 #endif | 343 #endif |
343 | 344 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 scoped_ptr<cc::DelegatedFrameData> frame_data, | 515 scoped_ptr<cc::DelegatedFrameData> frame_data, |
515 float frame_device_scale_factor, | 516 float frame_device_scale_factor, |
516 const ui::LatencyInfo& latency_info); | 517 const ui::LatencyInfo& latency_info); |
517 void SendDelegatedFrameAck(uint32 output_surface_id); | 518 void SendDelegatedFrameAck(uint32 output_surface_id); |
518 | 519 |
519 void SwapSoftwareFrame( | 520 void SwapSoftwareFrame( |
520 uint32 output_surface_id, | 521 uint32 output_surface_id, |
521 scoped_ptr<cc::SoftwareFrameData> frame_data, | 522 scoped_ptr<cc::SoftwareFrameData> frame_data, |
522 float frame_device_scale_factor, | 523 float frame_device_scale_factor, |
523 const ui::LatencyInfo& latency_info); | 524 const ui::LatencyInfo& latency_info); |
524 void SendSoftwareFrameAck(uint32 output_surface_id); | |
525 void SendReclaimSoftwareFrames(); | |
526 void ReleaseSoftwareFrame(uint32 output_surface_id, | |
527 unsigned software_frame_id); | |
528 | 525 |
529 void DidReceiveFrameFromRenderer(); | 526 void DidReceiveFrameFromRenderer(); |
530 | 527 |
531 BrowserAccessibilityManager* GetOrCreateBrowserAccessibilityManager(); | 528 BrowserAccessibilityManager* GetOrCreateBrowserAccessibilityManager(); |
532 | 529 |
533 #if defined(OS_WIN) | 530 #if defined(OS_WIN) |
534 // Sets the cutout rects from transient windows. These are rectangles that | 531 // Sets the cutout rects from transient windows. These are rectangles that |
535 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout | 532 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout |
536 // rects. | 533 // rects. |
537 void UpdateTransientRects(const std::vector<gfx::Rect>& rects); | 534 void UpdateTransientRects(const std::vector<gfx::Rect>& rects); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 | 592 |
596 // Current tooltip text. | 593 // Current tooltip text. |
597 string16 tooltip_; | 594 string16 tooltip_; |
598 | 595 |
599 std::vector<base::Closure> on_compositing_did_commit_callbacks_; | 596 std::vector<base::Closure> on_compositing_did_commit_callbacks_; |
600 | 597 |
601 // The current frontbuffer texture. | 598 // The current frontbuffer texture. |
602 scoped_refptr<ui::Texture> current_surface_; | 599 scoped_refptr<ui::Texture> current_surface_; |
603 | 600 |
604 // This holds the current software framebuffer. | 601 // This holds the current software framebuffer. |
605 scoped_refptr<MemoryHolder> framebuffer_holder_; | 602 scoped_ptr<SoftwareFramebuffer> software_framebuffer_; |
606 | 603 |
607 // With delegated renderer, this is the last output surface, used to | 604 // With delegated renderer, this is the last output surface, used to |
608 // disambiguate resources with the same id coming from different output | 605 // disambiguate resources with the same id coming from different output |
609 // surfaces. | 606 // surfaces. |
610 uint32 last_output_surface_id_; | 607 uint32 last_output_surface_id_; |
611 | 608 |
612 // The damage in the previously presented buffer. | 609 // The damage in the previously presented buffer. |
613 SkRegion previous_damage_; | 610 SkRegion previous_damage_; |
614 | 611 |
615 // Pending damage from previous frames that we skipped. | 612 // Pending damage from previous frames that we skipped. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 712 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
716 | 713 |
717 // YUV readback pipeline. | 714 // YUV readback pipeline. |
718 scoped_ptr<content::ReadbackYUVInterface> | 715 scoped_ptr<content::ReadbackYUVInterface> |
719 yuv_readback_pipeline_; | 716 yuv_readback_pipeline_; |
720 | 717 |
721 TouchEditingClient* touch_editing_client_; | 718 TouchEditingClient* touch_editing_client_; |
722 | 719 |
723 ui::LatencyInfo software_latency_info_; | 720 ui::LatencyInfo software_latency_info_; |
724 | 721 |
725 struct ReleasedFrameInfo { | |
726 ReleasedFrameInfo(uint32 output_id, unsigned software_frame_id) | |
727 : output_surface_id(output_id), frame_id(software_frame_id) {} | |
728 uint32 output_surface_id; | |
729 unsigned frame_id; | |
730 }; | |
731 std::vector<ReleasedFrameInfo> released_software_frames_; | |
732 | |
733 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 722 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
734 }; | 723 }; |
735 | 724 |
736 } // namespace content | 725 } // namespace content |
737 | 726 |
738 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 727 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |