diff options
author | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-28 18:02:10 +0000 |
---|---|---|
committer | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-28 18:02:10 +0000 |
commit | 900b20d4a4d98d511989879f90ef78f26d77e60e (patch) | |
tree | eeab6121361ae55f2344ec8bf823aaef9b2fc0a3 /gpu | |
parent | 37f858dbc0411f0b69f9a524ae6f4d89d3bc886b (diff) | |
download | chromium_src-900b20d4a4d98d511989879f90ef78f26d77e60e.zip chromium_src-900b20d4a4d98d511989879f90ef78f26d77e60e.tar.gz chromium_src-900b20d4a4d98d511989879f90ef78f26d77e60e.tar.bz2 |
Added ppapi::Surface3D. This CL completes the new Pepper3D interface. The implementation is still incomplete but all gpu demos still work!
Review URL: http://codereview.chromium.org/6047008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/demos/framework/pepper.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gpu/demos/framework/pepper.cc b/gpu/demos/framework/pepper.cc index 8c9e43a..ce698d5 100644 --- a/gpu/demos/framework/pepper.cc +++ b/gpu/demos/framework/pepper.cc @@ -13,6 +13,7 @@ #include "ppapi/cpp/size.h" #include "ppapi/cpp/dev/context_3d_dev.h" #include "ppapi/cpp/dev/graphics_3d_dev.h" +#include "ppapi/cpp/dev/surface_3d_dev.h" #include "ppapi/lib/gl/gles2/gl2ext_ppapi.h" namespace gpu { @@ -50,13 +51,17 @@ class PluginInstance : public pp::Instance { if (context_.is_null()) return; - if (!pp::Instance::BindGraphics(context_)) - return; - glSetCurrentContextPPAPI(context_.pp_resource()); demo_->InitGL(); glSetCurrentContextPPAPI(0); + } else { + // Need to recreate surface. Unbind existing surface. + pp::Instance::BindGraphics(pp::Surface3D_Dev()); + context_.BindSurfaces(pp::Surface3D_Dev(), pp::Surface3D_Dev()); } + surface_ = pp::Surface3D_Dev(*this, 0, NULL); + context_.BindSurfaces(surface_, surface_); + pp::Instance::BindGraphics(surface_); if (demo_->IsAnimated()) Animate(0); @@ -67,7 +72,7 @@ class PluginInstance : public pp::Instance { void Paint() { glSetCurrentContextPPAPI(context_.pp_resource()); demo_->Draw(); - context_.SwapBuffers(); + surface_.SwapBuffers(); glSetCurrentContextPPAPI(0); } @@ -81,6 +86,7 @@ class PluginInstance : public pp::Instance { pp::Module* module_; Demo* demo_; pp::Context3D_Dev context_; + pp::Surface3D_Dev surface_; pp::Size size_; pp::CompletionCallbackFactory<PluginInstance> callback_factory_; }; |