Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1990)

Unified Diff: content/renderer/browser_plugin/browser_plugin_texture_provider.h

Issue 11359024: Texture provider to feed data to the impl side thread for webview compositing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/browser_plugin/browser_plugin_texture_provider.h
diff --git a/content/renderer/browser_plugin/browser_plugin_texture_provider.h b/content/renderer/browser_plugin/browser_plugin_texture_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..3a30b5780df91b35fe1c4036454769a835a1c0d7
--- /dev/null
+++ b/content/renderer/browser_plugin/browser_plugin_texture_provider.h
@@ -0,0 +1,81 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_TEXTURE_PROVIDER_H_
+#define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_TEXTURE_PROVIDER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/lock.h"
+#include "content/common/content_export.h"
+#include "content/renderer/browser_plugin/browser_plugin_compositing_filter.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureProvider.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h"
+#include "ui/gfx/size.h"
+
+struct BrowserPluginMsg_UpdateRect_Params;
+
+class RenderViewImpl;
+
+namespace base {
+class MessageLoopProxy;
+}
+
+namespace content {
+
+class CONTENT_EXPORT BrowserPluginTextureProvider
+ : public WebKit::WebExternalTextureProvider,
+ public IPC::Sender {
+ public:
+ BrowserPluginTextureProvider(
+ int instance_id,
+ int routing_id,
+ IPC::ChannelProxy* channel_proxy,
+ scoped_refptr<base::MessageLoopProxy> message_loop);
+ void Initialize();
+
+ // WebExternalTextureProvider implementation
+ virtual void setTextureProviderClient(Client*);
+
+ // IPC::Sender implementation
+ virtual bool Send(IPC::Message* message) OVERRIDE;
+
+ virtual ~BrowserPluginTextureProvider();
+
+ void OnMessageReceived(const IPC::Message& message);
+ void OnBuffersSwapped(int instance_id,
+ uint64 surface_id,
+ int route_id,
+ int gpu_host_id);
+ void OnSurfaceResize(int instance_id, const gfx::Size& size);
+
+ virtual void Destroy();
+ protected:
+ virtual void SetUpFilter();
+ virtual void RemoveFilter();
+ virtual bool IsOnCorrectThread();
+
+ void DestroyImpl();
+
+ WebExternalTextureProvider::Client* client_;
+ scoped_refptr<BrowserPluginCompositingFilter> filter_;
+ int instance_id_;
+
+ scoped_refptr<base::MessageLoopProxy> impl_loop_;
+
+ // The IPC channel used by the renderer to communicate with the host.
+ IPC::ChannelProxy* channel_proxy_;
+
+ int host_routing_id_;
+
+ gfx::Size texture_size_;
+
+ bool pending_swap_buffers_;
+ uint64 pending_swap_buffers_surface_handle_;
+ int pending_swap_buffers_route_id_;
+ int pending_swap_buffers_gpu_host_id_;
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_TEXTURE_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698