summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 21:55:43 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 21:55:43 +0000
commitb0a7510c48c807338edf5ffa376d914e09adbf81 (patch)
treef04110317123e8fe8c0ff63fb4f9161ce5adc954 /gpu
parent59085ebc6e9fc0043548d58d7ae7d6b3764caeea (diff)
downloadchromium_src-b0a7510c48c807338edf5ffa376d914e09adbf81.zip
chromium_src-b0a7510c48c807338edf5ffa376d914e09adbf81.tar.gz
chromium_src-b0a7510c48c807338edf5ffa376d914e09adbf81.tar.bz2
Revert 93090 - Ported pepper 3d demos to use the new graphics3d interface instead of context3d and surface3d.
BUG=86370 Review URL: http://codereview.chromium.org/7433016 TBR=alokp@chromium.org Review URL: http://codereview.chromium.org/7450004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/demos/framework/pepper.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/gpu/demos/framework/pepper.cc b/gpu/demos/framework/pepper.cc
index 84aa672..c6f6e1f 100644
--- a/gpu/demos/framework/pepper.cc
+++ b/gpu/demos/framework/pepper.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -11,7 +11,9 @@
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/rect.h"
#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 {
@@ -47,15 +49,21 @@ class PluginInstance : public pp::Instance {
demo_->InitWindowSize(size_.width(), size_.height());
if (context_.is_null()) {
- context_ = pp::Graphics3D_Dev(*this, 0, pp::Graphics3D_Dev(), NULL);
+ context_ = pp::Context3D_Dev(*this, 0, pp::Context3D_Dev(), NULL);
if (context_.is_null())
return;
- pp::Instance::BindGraphics(context_);
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_);
Paint();
}
@@ -69,7 +77,7 @@ class PluginInstance : public pp::Instance {
glSetCurrentContextPPAPI(context_.pp_resource());
demo_->Draw();
swap_pending_ = true;
- context_.SwapBuffers(
+ surface_.SwapBuffers(
callback_factory_.NewCallback(&PluginInstance::OnSwap));
glSetCurrentContextPPAPI(0);
}
@@ -85,7 +93,8 @@ class PluginInstance : public pp::Instance {
pp::Module* module_;
Demo* demo_;
- pp::Graphics3D_Dev context_;
+ pp::Context3D_Dev context_;
+ pp::Surface3D_Dev surface_;
pp::Size size_;
bool swap_pending_;
bool paint_needed_;