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

Unified Diff: gpu/demos/framework/pepper.cc

Issue 6047008: Added ppapi::Surface3D. This CL completes the new Pepper3D interface. The imp... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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 | « no previous file | ppapi/c/dev/ppb_context_3d_dev.h » ('j') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/demos/framework/pepper.cc
===================================================================
--- gpu/demos/framework/pepper.cc (revision 70037)
+++ gpu/demos/framework/pepper.cc (working copy)
@@ -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 @@
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 @@
void Paint() {
glSetCurrentContextPPAPI(context_.pp_resource());
demo_->Draw();
- context_.SwapBuffers();
+ surface_.SwapBuffers();
glSetCurrentContextPPAPI(0);
}
@@ -81,6 +86,7 @@
pp::Module* module_;
Demo* demo_;
pp::Context3D_Dev context_;
+ pp::Surface3D_Dev surface_;
pp::Size size_;
pp::CompletionCallbackFactory<PluginInstance> callback_factory_;
};
« no previous file with comments | « no previous file | ppapi/c/dev/ppb_context_3d_dev.h » ('j') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698