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

Unified Diff: ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc

Issue 7763007: Make PPB_GLESChromiumTextureMapping_Dev work with PPB_Graphics3D_Dev (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 months 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/shared_impl/graphics_3d_impl.cc ('k') | ppapi/thunk/ppb_graphics_3d_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc
diff --git a/ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc b/ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc
index 295190a39e5f03b9d73137d4bd26695945654ff4..6e8e7c5aa10f1f8820c599a215d4e268fc74a782 100644
--- a/ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc
+++ b/ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc
@@ -5,6 +5,7 @@
#include "ppapi/thunk/thunk.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_context_3d_api.h"
+#include "ppapi/thunk/ppb_graphics_3d_api.h"
#include "ppapi/thunk/resource_creation_api.h"
namespace ppapi {
@@ -13,6 +14,7 @@ namespace thunk {
namespace {
typedef EnterResource<PPB_Context3D_API> EnterContext3D;
+typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D;
void* MapTexSubImage2DCHROMIUM(PP_Resource context,
GLenum target,
@@ -24,17 +26,38 @@ void* MapTexSubImage2DCHROMIUM(PP_Resource context,
GLenum format,
GLenum type,
GLenum access) {
- EnterContext3D enter(context, true);
- if (enter.failed())
- return NULL;
- return enter.object()->MapTexSubImage2DCHROMIUM(
- target, level, xoffset, yoffset, width, height, format, type, access);
+ {
+ EnterContext3D enter(context, false);
+ if (enter.succeeded()) {
+ return enter.object()->MapTexSubImage2DCHROMIUM(
+ target, level, xoffset, yoffset, width, height, format, type, access);
+ }
+ }
+ {
+ EnterGraphics3D enter(context, true);
+ if (enter.succeeded()) {
+ return enter.object()->MapTexSubImage2DCHROMIUM(
+ target, level, xoffset, yoffset, width, height, format, type, access);
+ }
+ }
+ return NULL;
}
void UnmapTexSubImage2DCHROMIUM(PP_Resource context, const void* mem) {
- EnterContext3D enter(context, true);
- if (enter.succeeded())
- enter.object()->UnmapTexSubImage2DCHROMIUM(mem);
+ {
+ EnterContext3D enter(context, false);
+ if (enter.succeeded()) {
+ enter.object()->UnmapTexSubImage2DCHROMIUM(mem);
+ return;
+ }
+ }
+ {
+ EnterGraphics3D enter(context, true);
+ if (enter.succeeded()) {
+ enter.object()->UnmapTexSubImage2DCHROMIUM(mem);
+ return;
+ }
+ }
}
const PPB_GLESChromiumTextureMapping_Dev
« no previous file with comments | « ppapi/shared_impl/graphics_3d_impl.cc ('k') | ppapi/thunk/ppb_graphics_3d_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698