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

Unified Diff: webkit/plugins/ppapi/ppb_graphics_3d_impl.h

Issue 7431001: Re-land r92885, which was reverted in r92891. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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
« no previous file with comments | « ppapi/thunk/resource_creation_api.h ('k') | webkit/plugins/ppapi/ppb_graphics_3d_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_graphics_3d_impl.h
===================================================================
--- webkit/plugins/ppapi/ppb_graphics_3d_impl.h (revision 92908)
+++ webkit/plugins/ppapi/ppb_graphics_3d_impl.h (working copy)
@@ -5,14 +5,16 @@
#ifndef WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_
#define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_
-#include "ppapi/thunk/ppb_graphics_3d_api.h"
+#include "base/memory/scoped_callback_factory.h"
+#include "ppapi/shared_impl/graphics_3d_impl.h"
+#include "webkit/plugins/ppapi/plugin_delegate.h"
#include "webkit/plugins/ppapi/resource.h"
namespace webkit {
namespace ppapi {
class PPB_Graphics3D_Impl : public Resource,
- public ::ppapi::thunk::PPB_Graphics3D_API {
+ public ::ppapi::Graphics3DImpl {
public:
virtual ~PPB_Graphics3D_Impl();
@@ -20,22 +22,72 @@
PP_Config3D_Dev config,
PP_Resource share_context,
const int32_t* attrib_list);
+ static PP_Resource CreateRaw(PluginInstance* instance,
+ PP_Config3D_Dev config,
+ PP_Resource share_context,
+ const int32_t* attrib_list);
// ResourceObjectBase override.
virtual ::ppapi::thunk::PPB_Graphics3D_API* AsPPB_Graphics3D_API() OVERRIDE;
- // PPB_Graphics3D_API implementation.
- virtual int32_t GetAttribs(int32_t* attrib_list) OVERRIDE;
- virtual int32_t SetAttribs(int32_t* attrib_list) OVERRIDE;
- virtual int32_t SwapBuffers(PP_CompletionCallback callback) OVERRIDE;
+ // PPB_Graphics3D_API trusted implementation.
+ virtual PP_Bool InitCommandBuffer(int32_t size) OVERRIDE;
+ virtual PP_Bool GetRingBuffer(int* shm_handle,
+ uint32_t* shm_size) OVERRIDE;
+ virtual PP_Graphics3DTrustedState GetState() OVERRIDE;
+ virtual int32_t CreateTransferBuffer(uint32_t size) OVERRIDE;
+ virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE;
+ virtual PP_Bool GetTransferBuffer(int32_t id,
+ int* shm_handle,
+ uint32_t* shm_size) OVERRIDE;
+ virtual PP_Bool Flush(int32_t put_offset) OVERRIDE;
+ virtual PP_Graphics3DTrustedState FlushSync(int32_t put_offset) OVERRIDE;
+ virtual PP_Graphics3DTrustedState FlushSyncFast(
+ int32_t put_offset,
+ int32_t last_known_get) OVERRIDE;
+ // Binds/unbinds the graphics of this context with the associated instance.
+ // Returns true if binding/unbinding is successful.
+ bool BindToInstance(bool bind);
+
+ // Returns the id of texture that can be used by the compositor.
+ unsigned int GetBackingTextureId();
+
+ // Notifications that the view has rendered the page and that it has been
+ // flushed to the screen. These messages are used to send Flush callbacks to
+ // the plugin.
+ void ViewInitiatedPaint();
+ void ViewFlushedPaint();
+
+ protected:
+ // ppapi::Graphics3DImpl overrides.
+ virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE;
+ virtual int32 DoSwapBuffers() OVERRIDE;
+
private:
explicit PPB_Graphics3D_Impl(PluginInstance* instance);
bool Init(PP_Config3D_Dev config,
PP_Resource share_context,
const int32_t* attrib_list);
+ bool InitRaw(PP_Config3D_Dev config,
+ PP_Resource share_context,
+ const int32_t* attrib_list);
+ // Notifications received from the GPU process.
+ void OnSwapBuffers();
+ void OnContextLost();
+ // Notifications sent to plugin.
+ void SendContextLost();
+
+ // True if context is bound to instance.
+ bool bound_to_instance_;
+ // True when waiting for compositor to commit our backing texture.
+ bool commit_pending_;
+ // PluginDelegate's 3D Context. Responsible for providing the command buffer.
+ scoped_ptr<PluginDelegate::PlatformContext3D> platform_context_;
+ base::ScopedCallbackFactory<PPB_Graphics3D_Impl> callback_factory_;
+
DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl);
};
@@ -43,4 +95,3 @@
} // namespace webkit
#endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_
-
« no previous file with comments | « ppapi/thunk/resource_creation_api.h ('k') | webkit/plugins/ppapi/ppb_graphics_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698