OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ | 5 #ifndef CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ |
6 #define CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ | 6 #define CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 struct FrameHostMsg_CompositorFrameSwappedACK_Params; | 45 struct FrameHostMsg_CompositorFrameSwappedACK_Params; |
46 struct FrameHostMsg_BuffersSwappedACK_Params; | 46 struct FrameHostMsg_BuffersSwappedACK_Params; |
47 struct FrameHostMsg_ReclaimCompositorResources_Params; | 47 struct FrameHostMsg_ReclaimCompositorResources_Params; |
48 | 48 |
49 namespace content { | 49 namespace content { |
50 | 50 |
51 class BrowserPlugin; | 51 class BrowserPlugin; |
52 class BrowserPluginManager; | 52 class BrowserPluginManager; |
53 class RenderFrameImpl; | 53 class RenderFrameProxy; |
54 | 54 |
55 class CONTENT_EXPORT ChildFrameCompositingHelper | 55 class CONTENT_EXPORT ChildFrameCompositingHelper |
56 : public base::RefCounted<ChildFrameCompositingHelper>, | 56 : public base::RefCounted<ChildFrameCompositingHelper>, |
57 public cc::DelegatedFrameResourceCollectionClient { | 57 public cc::DelegatedFrameResourceCollectionClient { |
58 public: | 58 public: |
59 static ChildFrameCompositingHelper* CreateCompositingHelperForBrowserPlugin( | 59 static ChildFrameCompositingHelper* CreateCompositingHelperForBrowserPlugin( |
60 const base::WeakPtr<BrowserPlugin>& browser_plugin); | 60 const base::WeakPtr<BrowserPlugin>& browser_plugin); |
61 static ChildFrameCompositingHelper* CreateCompositingHelperForRenderFrame( | 61 static ChildFrameCompositingHelper* CreateCompositingHelperForRenderFrame( |
62 blink::WebFrame* frame, | 62 blink::WebFrame* frame, |
63 RenderFrameImpl* render_frame, | 63 RenderFrameProxy* render_frame_proxy, |
64 int host_routing_id); | 64 int host_routing_id); |
65 | 65 |
66 void CopyFromCompositingSurface(int request_id, | 66 void CopyFromCompositingSurface(int request_id, |
67 gfx::Rect source_rect, | 67 gfx::Rect source_rect, |
68 gfx::Size dest_size); | 68 gfx::Size dest_size); |
69 void DidCommitCompositorFrame(); | 69 void DidCommitCompositorFrame(); |
70 void EnableCompositing(bool); | 70 void EnableCompositing(bool); |
71 void OnContainerDestroy(); | 71 void OnContainerDestroy(); |
72 void OnBuffersSwapped(const gfx::Size& size, | 72 void OnBuffersSwapped(const gfx::Size& size, |
73 const gpu::Mailbox& mailbox, | 73 const gpu::Mailbox& mailbox, |
(...skipping 13 matching lines...) Expand all Loading... |
87 void SetContentsOpaque(bool); | 87 void SetContentsOpaque(bool); |
88 | 88 |
89 protected: | 89 protected: |
90 // Friend RefCounted so that the dtor can be non-public. | 90 // Friend RefCounted so that the dtor can be non-public. |
91 friend class base::RefCounted<ChildFrameCompositingHelper>; | 91 friend class base::RefCounted<ChildFrameCompositingHelper>; |
92 | 92 |
93 private: | 93 private: |
94 ChildFrameCompositingHelper( | 94 ChildFrameCompositingHelper( |
95 const base::WeakPtr<BrowserPlugin>& browser_plugin, | 95 const base::WeakPtr<BrowserPlugin>& browser_plugin, |
96 blink::WebFrame* frame, | 96 blink::WebFrame* frame, |
97 RenderFrameImpl* render_frame, | 97 RenderFrameProxy* render_frame_proxy, |
98 int host_routing_id); | 98 int host_routing_id); |
99 | 99 |
100 enum SwapBuffersType { | 100 enum SwapBuffersType { |
101 TEXTURE_IMAGE_TRANSPORT, | 101 TEXTURE_IMAGE_TRANSPORT, |
102 GL_COMPOSITOR_FRAME, | 102 GL_COMPOSITOR_FRAME, |
103 SOFTWARE_COMPOSITOR_FRAME, | 103 SOFTWARE_COMPOSITOR_FRAME, |
104 }; | 104 }; |
105 struct SwapBuffersInfo { | 105 struct SwapBuffersInfo { |
106 SwapBuffersInfo(); | 106 SwapBuffersInfo(); |
107 | 107 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 bool software_ack_pending_; | 150 bool software_ack_pending_; |
151 bool opaque_; | 151 bool opaque_; |
152 std::vector<unsigned> unacked_software_frames_; | 152 std::vector<unsigned> unacked_software_frames_; |
153 | 153 |
154 gfx::Size buffer_size_; | 154 gfx::Size buffer_size_; |
155 | 155 |
156 // The lifetime of this weak pointer should be greater than the lifetime of | 156 // The lifetime of this weak pointer should be greater than the lifetime of |
157 // other member objects, as they may access this pointer during their | 157 // other member objects, as they may access this pointer during their |
158 // destruction. | 158 // destruction. |
159 base::WeakPtr<BrowserPlugin> browser_plugin_; | 159 base::WeakPtr<BrowserPlugin> browser_plugin_; |
160 RenderFrameImpl* render_frame_; | 160 RenderFrameProxy* render_frame_proxy_; |
161 | 161 |
162 scoped_refptr<cc::DelegatedFrameResourceCollection> resource_collection_; | 162 scoped_refptr<cc::DelegatedFrameResourceCollection> resource_collection_; |
163 scoped_refptr<cc::DelegatedFrameProvider> frame_provider_; | 163 scoped_refptr<cc::DelegatedFrameProvider> frame_provider_; |
164 | 164 |
165 scoped_refptr<cc::SolidColorLayer> background_layer_; | 165 scoped_refptr<cc::SolidColorLayer> background_layer_; |
166 scoped_refptr<cc::TextureLayer> texture_layer_; | 166 scoped_refptr<cc::TextureLayer> texture_layer_; |
167 scoped_refptr<cc::DelegatedRendererLayer> delegated_layer_; | 167 scoped_refptr<cc::DelegatedRendererLayer> delegated_layer_; |
168 scoped_ptr<blink::WebLayer> web_layer_; | 168 scoped_ptr<blink::WebLayer> web_layer_; |
169 blink::WebFrame* frame_; | 169 blink::WebFrame* frame_; |
170 | 170 |
171 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper); | 171 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper); |
172 }; | 172 }; |
173 | 173 |
174 } // namespace content | 174 } // namespace content |
175 | 175 |
176 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ | 176 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ |
OLD | NEW |