OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 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 "webkit/plugins/ppapi/ppb_gles_chromium_texture_mapping_impl.h" | |
6 | |
7 #include "gpu/command_buffer/client/gles2_implementation.h" | |
8 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h" | |
9 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h" | |
10 | |
11 namespace webkit { | |
12 namespace ppapi { | |
13 | |
14 namespace { | |
15 | |
16 void* MapTexSubImage2DCHROMIUM( | |
17 PP_Resource context_id, | |
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 scoped_refptr<PPB_Context3D_Impl> context = | |
28 Resource::GetAs<PPB_Context3D_Impl>(context_id); | |
29 return context->gles2_impl()->MapTexSubImage2DCHROMIUM( | |
30 target, level, xoffset, yoffset, width, height, format, type, access); | |
31 } | |
32 | |
33 void UnmapTexSubImage2DCHROMIUM(PP_Resource context_id, const void* mem) { | |
34 scoped_refptr<PPB_Context3D_Impl> context = | |
35 Resource::GetAs<PPB_Context3D_Impl>(context_id); | |
36 context->gles2_impl()->UnmapTexSubImage2DCHROMIUM(mem); | |
37 } | |
38 | |
39 const struct PPB_GLESChromiumTextureMapping_Dev ppb_gles_chromium_extension = { | |
40 &MapTexSubImage2DCHROMIUM, | |
41 &UnmapTexSubImage2DCHROMIUM | |
42 }; | |
43 | |
44 } // namespace | |
45 | |
46 const PPB_GLESChromiumTextureMapping_Dev* | |
47 PPB_GLESChromiumTextureMapping_Impl::GetInterface() { | |
48 return &ppb_gles_chromium_extension; | |
49 } | |
50 | |
51 } // namespace ppapi | |
52 } // namespace webkit | |
53 | |
OLD | NEW |