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

Unified Diff: ppapi/cpp/dev/graphics_3d_dev.cc

Issue 5927002: Moved the logic of maintaining the current context to gles2 helper library. (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
Index: ppapi/cpp/dev/graphics_3d_dev.cc
===================================================================
--- ppapi/cpp/dev/graphics_3d_dev.cc (revision 69442)
+++ ppapi/cpp/dev/graphics_3d_dev.cc (working copy)
@@ -10,20 +10,11 @@
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
-extern "C" {
-const PPB_OpenGLES_Dev* pepper_opengl_interface = NULL;
-}
-
namespace {
DeviceFuncs<PPB_Graphics3D_Dev> graphics_3d_f(PPB_GRAPHICS_3D_DEV_INTERFACE);
-DeviceFuncs<PPB_OpenGLES_Dev> opengles_f(PPB_OPENGLES_DEV_INTERFACE);
+DeviceFuncs<PPB_OpenGLES2_Dev> opengles_f(PPB_OPENGLES2_DEV_INTERFACE);
-inline void InitializeOpenGLCInterface() {
- if (!pepper_opengl_interface)
- pepper_opengl_interface = &(*opengles_f);
-}
-
} // namespace
namespace pp {
@@ -82,23 +73,13 @@
return Graphics3D_Dev();
}
-bool Graphics3D_Dev::ResetCurrent() {
- return graphics_3d_f && graphics_3d_f->MakeCurent(0);
-}
-
-Graphics3D_Dev Graphics3D_Dev::GetCurrentContext() {
- if (graphics_3d_f)
- return FromResource(graphics_3d_f->GetCurrentContext());
- return Graphics3D_Dev();
-}
-
uint32_t Graphics3D_Dev::GetError() {
if (graphics_3d_f)
return graphics_3d_f->GetError();
return PP_GRAPHICS_3D_ERROR_NOT_INITIALIZED;
}
-const PPB_OpenGLES_Dev* Graphics3D_Dev::GetImplementation() {
+const PPB_OpenGLES2_Dev* Graphics3D_Dev::GetImplementation() {
return &(*opengles_f);
}
@@ -107,18 +88,12 @@
int32_t share_context,
const int32_t* attrib_list) {
if (graphics_3d_f && opengles_f) {
- InitializeOpenGLCInterface();
PassRefFromConstructor(graphics_3d_f->CreateContext(instance.pp_instance(),
config, share_context,
attrib_list));
}
}
-bool Graphics3D_Dev::MakeCurrent() const {
- InitializeOpenGLCInterface();
- return graphics_3d_f && graphics_3d_f->MakeCurent(pp_resource());
-}
-
bool Graphics3D_Dev::SwapBuffers() const {
return graphics_3d_f && graphics_3d_f->SwapBuffers(pp_resource());
}

Powered by Google App Engine
This is Rietveld 408576698