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

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
« no previous file with comments | « ppapi/cpp/dev/graphics_3d_dev.h ('k') | ppapi/lib/gl/gles2/gl2ext_ppapi.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/graphics_3d_dev.cc
===================================================================
--- ppapi/cpp/dev/graphics_3d_dev.cc (revision 69835)
+++ ppapi/cpp/dev/graphics_3d_dev.cc (working copy)
@@ -10,10 +10,6 @@
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
-extern "C" {
-const PPB_OpenGLES_Dev* pepper_opengl_interface = NULL;
-}
-
namespace pp {
namespace {
@@ -22,15 +18,10 @@
return PPB_GRAPHICS_3D_DEV_INTERFACE;
}
-template <> const char* interface_name<PPB_OpenGLES_Dev>() {
- return PPB_OPENGLES_DEV_INTERFACE;
+template <> const char* interface_name<PPB_OpenGLES2_Dev>() {
+ return PPB_OPENGLES2_DEV_INTERFACE;
}
-inline void InitializeOpenGLCInterface() {
- if (!pepper_opengl_interface)
- pepper_opengl_interface = get_interface<PPB_OpenGLES_Dev>();
-}
-
} // namespace
// static
@@ -84,26 +75,14 @@
return Graphics3D_Dev();
}
-bool Graphics3D_Dev::ResetCurrent() {
- return has_interface<PPB_Graphics3D_Dev>() &&
- get_interface<PPB_Graphics3D_Dev>()->MakeCurent(0);
-}
-
-Graphics3D_Dev Graphics3D_Dev::GetCurrentContext() {
- if (has_interface<PPB_Graphics3D_Dev>())
- return FromResource(
- get_interface<PPB_Graphics3D_Dev>()->GetCurrentContext());
- return Graphics3D_Dev();
-}
-
uint32_t Graphics3D_Dev::GetError() {
if (has_interface<PPB_Graphics3D_Dev>())
return get_interface<PPB_Graphics3D_Dev>()->GetError();
return PP_GRAPHICS_3D_ERROR_NOT_INITIALIZED;
}
-const PPB_OpenGLES_Dev* Graphics3D_Dev::GetImplementation() {
- return get_interface<PPB_OpenGLES_Dev>();
+const PPB_OpenGLES2_Dev* Graphics3D_Dev::GetImplementation() {
+ return get_interface<PPB_OpenGLES2_Dev>();
}
Graphics3D_Dev::Graphics3D_Dev(const Instance& instance,
@@ -111,19 +90,12 @@
int32_t share_context,
const int32_t* attrib_list) {
if (has_interface<PPB_Graphics3D_Dev>() &&
- has_interface<PPB_OpenGLES_Dev>()) {
- InitializeOpenGLCInterface();
+ has_interface<PPB_OpenGLES2_Dev>()) {
PassRefFromConstructor(get_interface<PPB_Graphics3D_Dev>()->CreateContext(
instance.pp_instance(), config, share_context, attrib_list));
}
}
-bool Graphics3D_Dev::MakeCurrent() const {
- InitializeOpenGLCInterface();
- return has_interface<PPB_Graphics3D_Dev>() &&
- get_interface<PPB_Graphics3D_Dev>()->MakeCurent(pp_resource());
-}
-
bool Graphics3D_Dev::SwapBuffers() const {
return has_interface<PPB_Graphics3D_Dev>() &&
get_interface<PPB_Graphics3D_Dev>()->SwapBuffers(pp_resource());
« no previous file with comments | « ppapi/cpp/dev/graphics_3d_dev.h ('k') | ppapi/lib/gl/gles2/gl2ext_ppapi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698