diff options
author | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-27 20:23:39 +0000 |
---|---|---|
committer | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-27 20:23:39 +0000 |
commit | 319a26e52a0858088d2cc45a82b1e80d419af4a1 (patch) | |
tree | e4615913874baa805e3f0ae21e411e49c3236a08 /gpu/demos | |
parent | 9b62ecf0edb34df19a8bc2458f13d6cd4ac2b356 (diff) | |
download | chromium_src-319a26e52a0858088d2cc45a82b1e80d419af4a1.zip chromium_src-319a26e52a0858088d2cc45a82b1e80d419af4a1.tar.gz chromium_src-319a26e52a0858088d2cc45a82b1e80d419af4a1.tar.bz2 |
Reland r93090, which was reverted in r93104.
Ported pepper 3d demos to use the new graphics3d interface instead of context3d and surface3d.
BUG=86370
TBR=piman
Review URL: http://codereview.chromium.org/7470031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/demos')
-rw-r--r-- | gpu/demos/framework/pepper.cc | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/gpu/demos/framework/pepper.cc b/gpu/demos/framework/pepper.cc index c6f6e1f..84aa672 100644 --- a/gpu/demos/framework/pepper.cc +++ b/gpu/demos/framework/pepper.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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,9 +11,7 @@ #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 { @@ -49,21 +47,15 @@ class PluginInstance : public pp::Instance { demo_->InitWindowSize(size_.width(), size_.height()); if (context_.is_null()) { - context_ = pp::Context3D_Dev(*this, 0, pp::Context3D_Dev(), NULL); + context_ = pp::Graphics3D_Dev(*this, 0, pp::Graphics3D_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(); } @@ -77,7 +69,7 @@ class PluginInstance : public pp::Instance { glSetCurrentContextPPAPI(context_.pp_resource()); demo_->Draw(); swap_pending_ = true; - surface_.SwapBuffers( + context_.SwapBuffers( callback_factory_.NewCallback(&PluginInstance::OnSwap)); glSetCurrentContextPPAPI(0); } @@ -93,8 +85,7 @@ class PluginInstance : public pp::Instance { pp::Module* module_; Demo* demo_; - pp::Context3D_Dev context_; - pp::Surface3D_Dev surface_; + pp::Graphics3D_Dev context_; pp::Size size_; bool swap_pending_; bool paint_needed_; |