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