OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ |
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 class SolidColorLayer; | 16 class SolidColorLayer; |
17 class TextureLayer; | 17 class TextureLayer; |
18 } | 18 } |
19 | 19 |
20 namespace gpu { | |
21 struct Mailbox; | |
22 } | |
23 | |
24 namespace WebKit { | 20 namespace WebKit { |
25 class WebPluginContainer; | 21 class WebPluginContainer; |
26 class WebLayer; | 22 class WebLayer; |
27 } | 23 } |
28 | 24 |
29 namespace content { | 25 namespace content { |
30 | 26 |
31 class BrowserPluginManager; | 27 class BrowserPluginManager; |
32 | 28 |
33 class CONTENT_EXPORT BrowserPluginCompositingHelper : | 29 class CONTENT_EXPORT BrowserPluginCompositingHelper : |
34 public base::RefCounted<BrowserPluginCompositingHelper> { | 30 public base::RefCounted<BrowserPluginCompositingHelper> { |
35 public: | 31 public: |
36 BrowserPluginCompositingHelper(WebKit::WebPluginContainer* container, | 32 BrowserPluginCompositingHelper(WebKit::WebPluginContainer* container, |
37 BrowserPluginManager* manager, | 33 BrowserPluginManager* manager, |
38 int instance_id, | 34 int instance_id, |
39 int host_routing_id); | 35 int host_routing_id); |
40 void EnableCompositing(bool); | 36 void EnableCompositing(bool); |
41 void OnContainerDestroy(); | 37 void OnContainerDestroy(); |
42 void OnBuffersSwapped(const gfx::Size& size, | 38 void OnBuffersSwapped(const gfx::Size& size, |
43 const gpu::Mailbox& mailbox_name, | 39 const std::string& mailbox_name, |
44 int gpu_route_id, | 40 int gpu_route_id, |
45 int gpu_host_id, | 41 int gpu_host_id, |
46 float device_scale_factor); | 42 float device_scale_factor); |
47 void UpdateVisibility(bool); | 43 void UpdateVisibility(bool); |
48 protected: | 44 protected: |
49 // Friend RefCounted so that the dtor can be non-public. | 45 // Friend RefCounted so that the dtor can be non-public. |
50 friend class base::RefCounted<BrowserPluginCompositingHelper>; | 46 friend class base::RefCounted<BrowserPluginCompositingHelper>; |
51 private: | 47 private: |
52 ~BrowserPluginCompositingHelper(); | 48 ~BrowserPluginCompositingHelper(); |
53 void FreeMailboxMemory(const gpu::Mailbox& mailbox_name, | 49 void FreeMailboxMemory(const std::string& mailbox_name, |
54 unsigned sync_point); | 50 unsigned sync_point); |
55 void MailboxReleased(const gpu::Mailbox& mailbox_name, | 51 void MailboxReleased(const std::string& mailbox_name, |
56 int gpu_route_id, | 52 int gpu_route_id, |
57 int gpu_host_id, | 53 int gpu_host_id, |
58 unsigned sync_point); | 54 unsigned sync_point); |
59 int instance_id_; | 55 int instance_id_; |
60 int host_routing_id_; | 56 int host_routing_id_; |
61 int last_gpu_route_id_; | 57 int last_gpu_route_id_; |
62 int last_gpu_host_id_; | 58 int last_gpu_host_id_; |
63 bool last_mailbox_valid_; | 59 bool last_mailbox_valid_; |
64 bool ack_pending_; | 60 bool ack_pending_; |
65 bool ack_pending_for_crashed_guest_; | 61 bool ack_pending_for_crashed_guest_; |
66 | 62 |
67 gfx::Size buffer_size_; | 63 gfx::Size buffer_size_; |
68 | 64 |
69 scoped_refptr<cc::SolidColorLayer> background_layer_; | 65 scoped_refptr<cc::SolidColorLayer> background_layer_; |
70 scoped_refptr<cc::TextureLayer> texture_layer_; | 66 scoped_refptr<cc::TextureLayer> texture_layer_; |
71 scoped_ptr<WebKit::WebLayer> web_layer_; | 67 scoped_ptr<WebKit::WebLayer> web_layer_; |
72 WebKit::WebPluginContainer* container_; | 68 WebKit::WebPluginContainer* container_; |
73 | 69 |
74 scoped_refptr<BrowserPluginManager> browser_plugin_manager_; | 70 scoped_refptr<BrowserPluginManager> browser_plugin_manager_; |
75 }; | 71 }; |
76 | 72 |
77 } // namespace content | 73 } // namespace content |
78 | 74 |
79 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ | 75 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ |
OLD | NEW |