| 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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 void DidCommitCompositorFrame(); | 44 void DidCommitCompositorFrame(); |
| 45 void EnableCompositing(bool); | 45 void EnableCompositing(bool); |
| 46 void OnContainerDestroy(); | 46 void OnContainerDestroy(); |
| 47 void OnBuffersSwapped(const gfx::Size& size, | 47 void OnBuffersSwapped(const gfx::Size& size, |
| 48 const std::string& mailbox_name, | 48 const std::string& mailbox_name, |
| 49 int gpu_route_id, | 49 int gpu_route_id, |
| 50 int gpu_host_id, | 50 int gpu_host_id, |
| 51 float device_scale_factor); | 51 float device_scale_factor); |
| 52 void OnCompositorFrameSwapped(scoped_ptr<cc::CompositorFrame> frame, | 52 void OnCompositorFrameSwapped(scoped_ptr<cc::CompositorFrame> frame, |
| 53 int route_id, | 53 int route_id, |
| 54 uint32 output_surface_id, |
| 54 int host_id); | 55 int host_id); |
| 55 void UpdateVisibility(bool); | 56 void UpdateVisibility(bool); |
| 56 protected: | 57 protected: |
| 57 // Friend RefCounted so that the dtor can be non-public. | 58 // Friend RefCounted so that the dtor can be non-public. |
| 58 friend class base::RefCounted<BrowserPluginCompositingHelper>; | 59 friend class base::RefCounted<BrowserPluginCompositingHelper>; |
| 59 private: | 60 private: |
| 60 enum SwapBuffersType { | 61 enum SwapBuffersType { |
| 61 TEXTURE_IMAGE_TRANSPORT, | 62 TEXTURE_IMAGE_TRANSPORT, |
| 62 GL_COMPOSITOR_FRAME, | 63 GL_COMPOSITOR_FRAME, |
| 63 SOFTWARE_COMPOSITOR_FRAME, | 64 SOFTWARE_COMPOSITOR_FRAME, |
| 64 }; | 65 }; |
| 65 struct SwapBuffersInfo { | 66 struct SwapBuffersInfo { |
| 66 SwapBuffersInfo(); | 67 SwapBuffersInfo(); |
| 67 | 68 |
| 68 gpu::Mailbox name; | 69 gpu::Mailbox name; |
| 69 SwapBuffersType type; | 70 SwapBuffersType type; |
| 70 gfx::Size size; | 71 gfx::Size size; |
| 71 int route_id; | 72 int route_id; |
| 73 uint32 output_surface_id; |
| 72 int host_id; | 74 int host_id; |
| 73 unsigned software_frame_id; | 75 unsigned software_frame_id; |
| 74 base::SharedMemory* shared_memory; | 76 base::SharedMemory* shared_memory; |
| 75 }; | 77 }; |
| 76 ~BrowserPluginCompositingHelper(); | 78 ~BrowserPluginCompositingHelper(); |
| 77 void CheckSizeAndAdjustLayerBounds(const gfx::Size& new_size, | 79 void CheckSizeAndAdjustLayerBounds(const gfx::Size& new_size, |
| 78 float device_scale_factor, | 80 float device_scale_factor, |
| 79 cc::Layer* layer); | 81 cc::Layer* layer); |
| 80 void OnBuffersSwappedPrivate(const SwapBuffersInfo& mailbox, | 82 void OnBuffersSwappedPrivate(const SwapBuffersInfo& mailbox, |
| 81 unsigned sync_point, | 83 unsigned sync_point, |
| 82 float device_scale_factor); | 84 float device_scale_factor); |
| 83 void MailboxReleased(SwapBuffersInfo mailbox, | 85 void MailboxReleased(SwapBuffersInfo mailbox, |
| 84 unsigned sync_point, | 86 unsigned sync_point, |
| 85 bool lost_resource); | 87 bool lost_resource); |
| 86 int instance_id_; | 88 int instance_id_; |
| 87 int host_routing_id_; | 89 int host_routing_id_; |
| 88 int last_route_id_; | 90 int last_route_id_; |
| 91 uint32 last_output_surface_id_; |
| 89 int last_host_id_; | 92 int last_host_id_; |
| 90 bool last_mailbox_valid_; | 93 bool last_mailbox_valid_; |
| 91 bool ack_pending_; | 94 bool ack_pending_; |
| 92 | 95 |
| 93 gfx::Size buffer_size_; | 96 gfx::Size buffer_size_; |
| 94 | 97 |
| 95 scoped_refptr<cc::SolidColorLayer> background_layer_; | 98 scoped_refptr<cc::SolidColorLayer> background_layer_; |
| 96 scoped_refptr<cc::TextureLayer> texture_layer_; | 99 scoped_refptr<cc::TextureLayer> texture_layer_; |
| 97 scoped_refptr<cc::DelegatedRendererLayer> delegated_layer_; | 100 scoped_refptr<cc::DelegatedRendererLayer> delegated_layer_; |
| 98 scoped_ptr<WebKit::WebLayer> web_layer_; | 101 scoped_ptr<WebKit::WebLayer> web_layer_; |
| 99 WebKit::WebPluginContainer* container_; | 102 WebKit::WebPluginContainer* container_; |
| 100 | 103 |
| 101 scoped_refptr<BrowserPluginManager> browser_plugin_manager_; | 104 scoped_refptr<BrowserPluginManager> browser_plugin_manager_; |
| 102 }; | 105 }; |
| 103 | 106 |
| 104 } // namespace content | 107 } // namespace content |
| 105 | 108 |
| 106 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ | 109 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ |
| OLD | NEW |