• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "ppapi/thunk/thunk.h"
6 #include "ppapi/thunk/enter.h"
7 #include "ppapi/thunk/ppb_graphics_3d_api.h"
8 #include "ppapi/thunk/resource_creation_api.h"
9 
10 namespace ppapi {
11 namespace thunk {
12 
13 namespace {
14 
15 typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D;
16 
MapTexSubImage2DCHROMIUM(PP_Resource context,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,GLenum access)17 void* MapTexSubImage2DCHROMIUM(PP_Resource context,
18                                GLenum target,
19                                GLint level,
20                                GLint xoffset,
21                                GLint yoffset,
22                                GLsizei width,
23                                GLsizei height,
24                                GLenum format,
25                                GLenum type,
26                                GLenum access) {
27   EnterGraphics3D enter(context, true);
28   if (enter.succeeded()) {
29     return enter.object()->MapTexSubImage2DCHROMIUM(
30         target, level, xoffset, yoffset, width, height, format, type, access);
31   }
32   return NULL;
33 }
34 
UnmapTexSubImage2DCHROMIUM(PP_Resource context,const void * mem)35 void UnmapTexSubImage2DCHROMIUM(PP_Resource context, const void* mem) {
36   EnterGraphics3D enter(context, true);
37   if (enter.succeeded())
38     enter.object()->UnmapTexSubImage2DCHROMIUM(mem);
39 }
40 
41 const PPB_GLESChromiumTextureMapping_Dev
42 g_ppb_gles_chromium_texture_mapping_thunk = {
43   &MapTexSubImage2DCHROMIUM,
44   &UnmapTexSubImage2DCHROMIUM
45 };
46 
47 }  // namespace
48 
49 const PPB_GLESChromiumTextureMapping_Dev_0_1*
GetPPB_GLESChromiumTextureMapping_Dev_0_1_Thunk()50 GetPPB_GLESChromiumTextureMapping_Dev_0_1_Thunk() {
51   return &g_ppb_gles_chromium_texture_mapping_thunk;
52 }
53 
54 }  // namespace thunk
55 }  // namespace ppapi
56