OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_TEXTURE_PROVIDER_H_ |
| 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_TEXTURE_PROVIDER_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/synchronization/lock.h" |
| 10 #include "content/common/content_export.h" |
| 11 #include "content/renderer/browser_plugin/browser_plugin_compositing_filter.h" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureP
rovider.h" |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
| 14 #include "ui/gfx/size.h" |
| 15 |
| 16 struct BrowserPluginMsg_UpdateRect_Params; |
| 17 |
| 18 class RenderViewImpl; |
| 19 |
| 20 namespace base { |
| 21 class MessageLoopProxy; |
| 22 } |
| 23 |
| 24 namespace content { |
| 25 |
| 26 class CONTENT_EXPORT BrowserPluginTextureProvider |
| 27 : public WebKit::WebExternalTextureProvider, |
| 28 public IPC::Sender { |
| 29 public: |
| 30 BrowserPluginTextureProvider( |
| 31 int instance_id, |
| 32 int routing_id, |
| 33 IPC::ChannelProxy* channel_proxy, |
| 34 scoped_refptr<base::MessageLoopProxy> message_loop); |
| 35 void Initialize(); |
| 36 |
| 37 // WebExternalTextureProvider implementation |
| 38 virtual void setTextureProviderClient(Client*); |
| 39 |
| 40 // IPC::Sender implementation |
| 41 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 42 |
| 43 virtual ~BrowserPluginTextureProvider(); |
| 44 |
| 45 void OnMessageReceived(const IPC::Message& message); |
| 46 void OnBuffersSwapped(int instance_id, |
| 47 uint64 surface_id, |
| 48 int route_id, |
| 49 int gpu_host_id); |
| 50 void OnSurfaceResize(int instance_id, const gfx::Size& size); |
| 51 |
| 52 virtual void Destroy(); |
| 53 protected: |
| 54 virtual void SetUpFilter(); |
| 55 virtual void RemoveFilter(); |
| 56 virtual bool IsOnCorrectThread(); |
| 57 |
| 58 void DestroyImpl(); |
| 59 |
| 60 WebExternalTextureProvider::Client* client_; |
| 61 scoped_refptr<BrowserPluginCompositingFilter> filter_; |
| 62 int instance_id_; |
| 63 |
| 64 scoped_refptr<base::MessageLoopProxy> impl_loop_; |
| 65 |
| 66 // The IPC channel used by the renderer to communicate with the host. |
| 67 IPC::ChannelProxy* channel_proxy_; |
| 68 |
| 69 int host_routing_id_; |
| 70 |
| 71 gfx::Size texture_size_; |
| 72 |
| 73 bool pending_swap_buffers_; |
| 74 uint64 pending_swap_buffers_surface_handle_; |
| 75 int pending_swap_buffers_route_id_; |
| 76 int pending_swap_buffers_gpu_host_id_; |
| 77 }; |
| 78 |
| 79 } // namespace content |
| 80 |
| 81 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_TEXTURE_PROVIDER_H_ |
OLD | NEW |