| Index: webkit/plugins/ppapi/ppb_context_3d_impl.h
|
| ===================================================================
|
| --- webkit/plugins/ppapi/ppb_context_3d_impl.h (revision 70037)
|
| +++ webkit/plugins/ppapi/ppb_context_3d_impl.h (working copy)
|
| @@ -5,16 +5,11 @@
|
| #ifndef WEBKIT_PLUGINS_PPAPI_PPB_CONTEXT_3D_IMPL_H_
|
| #define WEBKIT_PLUGINS_PPAPI_PPB_CONTEXT_3D_IMPL_H_
|
|
|
| -#include "base/callback.h"
|
| #include "base/scoped_ptr.h"
|
| #include "ppapi/c/dev/ppb_context_3d_dev.h"
|
| #include "webkit/plugins/ppapi/plugin_delegate.h"
|
| #include "webkit/plugins/ppapi/resource.h"
|
|
|
| -namespace gfx {
|
| -class Size;
|
| -}
|
| -
|
| namespace gpu {
|
| namespace gles2 {
|
| class GLES2Implementation;
|
| @@ -24,9 +19,11 @@
|
| namespace webkit {
|
| namespace ppapi {
|
|
|
| +class PPB_Surface3D_Impl;
|
| +
|
| class PPB_Context3D_Impl : public Resource {
|
| public:
|
| - explicit PPB_Context3D_Impl(PluginModule* module);
|
| + explicit PPB_Context3D_Impl(PluginInstance* instance);
|
| virtual ~PPB_Context3D_Impl();
|
|
|
| static const PPB_Context3D_Dev* GetInterface();
|
| @@ -34,38 +31,26 @@
|
| // Resource override.
|
| virtual PPB_Context3D_Impl* AsPPB_Context3D_Impl();
|
|
|
| - bool Init(PluginInstance* instance,
|
| - PP_Config3D_Dev config,
|
| + bool Init(PP_Config3D_Dev config,
|
| PP_Resource share_context,
|
| const int32_t* attrib_list);
|
|
|
| - // Associates this PPB_Context3D_Impl with the given plugin instance.
|
| - // You can pass NULL to clear the existing device. Returns true on success.
|
| - // In this case, the last rendered frame is displayed.
|
| - //
|
| - // TODO(alokp): This is confusing. This context is already associated with
|
| - // an instance. This function should rather be called BindToInstanceGraphics
|
| - // or something similar which means from this point on, anything drawn with
|
| - // this context appears on instance window. This function should also not
|
| - // take any argument. But this means modifying PPB_Instance::BindGraphics.
|
| - bool BindToInstance(PluginInstance* new_instance);
|
| + PluginInstance* instance() {
|
| + return instance_;
|
| + }
|
|
|
| - bool SwapBuffers();
|
| - void SetSwapBuffersCallback(Callback0::Type* callback);
|
| -
|
| - unsigned int GetBackingTextureId();
|
| - void ResizeBackingTexture(const gfx::Size& size);
|
| -
|
| gpu::gles2::GLES2Implementation* gles2_impl() {
|
| return gles2_impl_;
|
| }
|
|
|
| + int32_t BindSurfaces(PPB_Surface3D_Impl* draw,
|
| + PPB_Surface3D_Impl* read);
|
| +
|
| private:
|
| void Destroy();
|
|
|
| - // Non-owning pointer to the plugin instance this context is currently bound
|
| - // to, if any. If the context is currently unbound, this will be NULL.
|
| - PluginInstance* bound_instance_;
|
| + // Plugin instance this context is associated with.
|
| + PluginInstance* instance_;
|
|
|
| // PluginDelegate's 3D Context. Responsible for providing the command buffer.
|
| scoped_ptr<PluginDelegate::PlatformContext3D> platform_context_;
|
| @@ -73,6 +58,9 @@
|
| // GLES2 Implementation instance. Owned by the platform context's GGL context.
|
| gpu::gles2::GLES2Implementation* gles2_impl_;
|
|
|
| + PPB_Surface3D_Impl* draw_surface_;
|
| + PPB_Surface3D_Impl* read_surface_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(PPB_Context3D_Impl);
|
| };
|
|
|
|
|