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

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

Issue 10735010: 3D Compositing in <browser>, first draft. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Major changes to clean up deadlock & other issues Created 8 years, 4 months 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..74bc1231e10db5eda7f745314ea7bd77b117a3bd
--- /dev/null
+++ b/content/renderer/browser_plugin/browser_plugin_texture_provider.h
@@ -0,0 +1,82 @@
+// 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_WEB_BROWSER_PLUGIN_TEXTURE_PROVIDER_H_
+#define CONTENT_RENDERER_BROWSER_PLUGIN_WEB_BROWSER_PLUGIN_TEXTURE_PROVIDER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/lock.h"
+#include "content/common/browser_plugin_info.h"
+#include "ipc/ipc_forwarding_message_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 BrowserPluginManager;
+
+class BrowserPluginTextureProvider : public WebKit::WebExternalTextureProvider {
+ public:
+ BrowserPluginTextureProvider(int instance_id, RenderViewImpl* render_view);
+ void Destroy();
+
+ virtual void setTextureProviderClient(Client*);
+
+ virtual unsigned textureId() const OVERRIDE;
+ virtual bool premultipliedAlpha() const OVERRIDE;
+ virtual bool flipped() const OVERRIDE;
+ virtual WebKit::WebFloatRect uvRect() const OVERRIDE;
+
+ void OnMessageReceived(const IPC::Message& message);
+ void OnBuffersSwapped(
+ int instance_id,
+ uint64 surface_id,
+ const BrowserPlugin_SwapInfo& info);
+ void OnSurfaceResize(int instance_id, const gfx::Size& size);
+
+ void Resize(const gfx::Size& size);
+ void SurfaceResize(const gfx::Size& size);
+ void SetDelayedSwap(
+ uint64 surface_id,
+ const BrowserPlugin_SwapInfo& delayed_swap_info);
+
+ private:
+ virtual ~BrowserPluginTextureProvider();
+ void DestroyImpl();
+
+ void ResizeImpl(const gfx::Size& size);
+
+ static void SignalReady(int instance_id);
+
+ WebExternalTextureProvider::Client* client_;
+ unsigned texture_id_;
+ scoped_refptr<IPC::ForwardingMessageFilter> filter_;
+ int instance_id_;
+ // If impl_loop_ is 0, we are working only on the main thread.
+ scoped_refptr<base::MessageLoopProxy> main_loop_, impl_loop_;
+ IPC::ChannelProxy* channel_proxy_;
+ RenderViewImpl* render_view_;
+ gfx::Size texture_size_, size_;
+ bool has_delayed_swap_;
+ BrowserPlugin_SwapInfo delayed_swap_info_;
+ // This lock is for when we may be updating the impl_loop_ member, which
+ // could trigger a switch between threaded and non-threaded. It is also
+ // used for setting a delayed swap.
+ base::Lock lock_;
scshunt 2012/08/12 01:42:45 Some whitespace here would be nice.
scshunt 2012/08/17 17:30:28 Done.
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_BROWSER_PLUGIN_WEB_BROWSER_PLUGIN_TEXTURE_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698