Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file is auto-generated. DO NOT EDIT! | 5 // This file is auto-generated. DO NOT EDIT! |
| 6 | 6 |
| 7 #include "ppapi/proxy/ppb_opengles2_proxy.h" | 7 #include "ppapi/proxy/ppb_opengles2_proxy.h" |
| 8 | 8 |
| 9 #include "gpu/command_buffer/client/gles2_implementation.h" | 9 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| 11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
| 12 #include "ppapi/c/dev/ppb_opengles_dev.h" | 12 #include "ppapi/c/dev/ppb_opengles_dev.h" |
| 13 #include "ppapi/proxy/plugin_dispatcher.h" | 13 #include "ppapi/proxy/plugin_dispatcher.h" |
| 14 #include "ppapi/proxy/plugin_resource.h" | 14 #include "ppapi/proxy/plugin_resource.h" |
| 15 #include "ppapi/proxy/ppb_context_3d_proxy.h" | 15 #include "ppapi/proxy/ppb_context_3d_proxy.h" |
| 16 #include "ppapi/shared_impl/resource_object_base.h" | |
|
alokp
2011/06/20 16:36:03
This file is supposed to be auto-generated. Not a
brettw
2011/06/20 19:31:03
I searched for a while and couldn't find the origi
alokp
2011/06/20 19:50:46
It is generated using gpu/command_buffer/build_gle
| |
| 17 #include "ppapi/shared_impl/tracker_base.h" | |
| 16 | 18 |
| 17 namespace pp { | 19 namespace pp { |
| 18 namespace proxy { | 20 namespace proxy { |
| 19 | 21 |
| 20 namespace { | 22 namespace { |
| 21 | 23 |
| 24 gpu::gles2::GLES2Implementation* GetGLES(PP_Resource context) { | |
| 25 ppapi::ResourceObjectBase* base = | |
| 26 ppapi::TrackerBase::Get()->GetResourceAPI(context); | |
| 27 DCHECK(base->AsPPB_Context3D_API()); | |
| 28 return static_cast<Context3D*>(base)->gles2_impl(); | |
| 29 } | |
| 30 | |
| 22 void ActiveTexture(PP_Resource context_id, GLenum texture) { | 31 void ActiveTexture(PP_Resource context_id, GLenum texture) { |
| 23 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 32 GetGLES(context_id)->ActiveTexture(texture); |
| 24 context->gles2_impl()->ActiveTexture(texture); | |
| 25 } | 33 } |
| 26 | 34 |
| 27 void AttachShader(PP_Resource context_id, GLuint program, GLuint shader) { | 35 void AttachShader(PP_Resource context_id, GLuint program, GLuint shader) { |
| 28 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 36 GetGLES(context_id)->AttachShader(program, shader); |
| 29 context->gles2_impl()->AttachShader(program, shader); | |
| 30 } | 37 } |
| 31 | 38 |
| 32 void BindAttribLocation( | 39 void BindAttribLocation( |
| 33 PP_Resource context_id, GLuint program, GLuint index, const char* name) { | 40 PP_Resource context_id, GLuint program, GLuint index, const char* name) { |
| 34 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 41 GetGLES(context_id)->BindAttribLocation(program, index, name); |
| 35 context->gles2_impl()->BindAttribLocation(program, index, name); | |
| 36 } | 42 } |
| 37 | 43 |
| 38 void BindBuffer(PP_Resource context_id, GLenum target, GLuint buffer) { | 44 void BindBuffer(PP_Resource context_id, GLenum target, GLuint buffer) { |
| 39 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 45 GetGLES(context_id)->BindBuffer(target, buffer); |
| 40 context->gles2_impl()->BindBuffer(target, buffer); | |
| 41 } | 46 } |
| 42 | 47 |
| 43 void BindFramebuffer( | 48 void BindFramebuffer( |
| 44 PP_Resource context_id, GLenum target, GLuint framebuffer) { | 49 PP_Resource context_id, GLenum target, GLuint framebuffer) { |
| 45 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 50 GetGLES(context_id)->BindFramebuffer(target, framebuffer); |
| 46 context->gles2_impl()->BindFramebuffer(target, framebuffer); | |
| 47 } | 51 } |
| 48 | 52 |
| 49 void BindRenderbuffer( | 53 void BindRenderbuffer( |
| 50 PP_Resource context_id, GLenum target, GLuint renderbuffer) { | 54 PP_Resource context_id, GLenum target, GLuint renderbuffer) { |
| 51 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 55 GetGLES(context_id)->BindRenderbuffer(target, renderbuffer); |
| 52 context->gles2_impl()->BindRenderbuffer(target, renderbuffer); | |
| 53 } | 56 } |
| 54 | 57 |
| 55 void BindTexture(PP_Resource context_id, GLenum target, GLuint texture) { | 58 void BindTexture(PP_Resource context_id, GLenum target, GLuint texture) { |
| 56 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 59 GetGLES(context_id)->BindTexture(target, texture); |
| 57 context->gles2_impl()->BindTexture(target, texture); | |
| 58 } | 60 } |
| 59 | 61 |
| 60 void BlendColor( | 62 void BlendColor( |
| 61 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue, | 63 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue, |
| 62 GLclampf alpha) { | 64 GLclampf alpha) { |
| 63 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 65 GetGLES(context_id)->BlendColor(red, green, blue, alpha); |
| 64 context->gles2_impl()->BlendColor(red, green, blue, alpha); | |
| 65 } | 66 } |
| 66 | 67 |
| 67 void BlendEquation(PP_Resource context_id, GLenum mode) { | 68 void BlendEquation(PP_Resource context_id, GLenum mode) { |
| 68 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 69 GetGLES(context_id)->BlendEquation(mode); |
| 69 context->gles2_impl()->BlendEquation(mode); | |
| 70 } | 70 } |
| 71 | 71 |
| 72 void BlendEquationSeparate( | 72 void BlendEquationSeparate( |
| 73 PP_Resource context_id, GLenum modeRGB, GLenum modeAlpha) { | 73 PP_Resource context_id, GLenum modeRGB, GLenum modeAlpha) { |
| 74 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 74 GetGLES(context_id)->BlendEquationSeparate(modeRGB, modeAlpha); |
| 75 context->gles2_impl()->BlendEquationSeparate(modeRGB, modeAlpha); | |
| 76 } | 75 } |
| 77 | 76 |
| 78 void BlendFunc(PP_Resource context_id, GLenum sfactor, GLenum dfactor) { | 77 void BlendFunc(PP_Resource context_id, GLenum sfactor, GLenum dfactor) { |
| 79 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 78 GetGLES(context_id)->BlendFunc(sfactor, dfactor); |
| 80 context->gles2_impl()->BlendFunc(sfactor, dfactor); | |
| 81 } | 79 } |
| 82 | 80 |
| 83 void BlendFuncSeparate( | 81 void BlendFuncSeparate( |
| 84 PP_Resource context_id, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, | 82 PP_Resource context_id, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, |
| 85 GLenum dstAlpha) { | 83 GLenum dstAlpha) { |
| 86 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 84 GetGLES(context_id)->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
| 87 context->gles2_impl()->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); | |
| 88 } | 85 } |
| 89 | 86 |
| 90 void BufferData( | 87 void BufferData( |
| 91 PP_Resource context_id, GLenum target, GLsizeiptr size, const void* data, | 88 PP_Resource context_id, GLenum target, GLsizeiptr size, const void* data, |
| 92 GLenum usage) { | 89 GLenum usage) { |
| 93 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 90 GetGLES(context_id)->BufferData(target, size, data, usage); |
| 94 context->gles2_impl()->BufferData(target, size, data, usage); | |
| 95 } | 91 } |
| 96 | 92 |
| 97 void BufferSubData( | 93 void BufferSubData( |
| 98 PP_Resource context_id, GLenum target, GLintptr offset, GLsizeiptr size, | 94 PP_Resource context_id, GLenum target, GLintptr offset, GLsizeiptr size, |
| 99 const void* data) { | 95 const void* data) { |
| 100 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 96 GetGLES(context_id)->BufferSubData(target, offset, size, data); |
| 101 context->gles2_impl()->BufferSubData(target, offset, size, data); | |
| 102 } | 97 } |
| 103 | 98 |
| 104 GLenum CheckFramebufferStatus(PP_Resource context_id, GLenum target) { | 99 GLenum CheckFramebufferStatus(PP_Resource context_id, GLenum target) { |
| 105 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 100 return GetGLES(context_id)->CheckFramebufferStatus(target); |
| 106 return context->gles2_impl()->CheckFramebufferStatus(target); | |
| 107 } | 101 } |
| 108 | 102 |
| 109 void Clear(PP_Resource context_id, GLbitfield mask) { | 103 void Clear(PP_Resource context_id, GLbitfield mask) { |
| 110 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 104 GetGLES(context_id)->Clear(mask); |
| 111 context->gles2_impl()->Clear(mask); | |
| 112 } | 105 } |
| 113 | 106 |
| 114 void ClearColor( | 107 void ClearColor( |
| 115 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue, | 108 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue, |
| 116 GLclampf alpha) { | 109 GLclampf alpha) { |
| 117 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 110 GetGLES(context_id)->ClearColor(red, green, blue, alpha); |
| 118 context->gles2_impl()->ClearColor(red, green, blue, alpha); | |
| 119 } | 111 } |
| 120 | 112 |
| 121 void ClearDepthf(PP_Resource context_id, GLclampf depth) { | 113 void ClearDepthf(PP_Resource context_id, GLclampf depth) { |
| 122 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 114 GetGLES(context_id)->ClearDepthf(depth); |
| 123 context->gles2_impl()->ClearDepthf(depth); | |
| 124 } | 115 } |
| 125 | 116 |
| 126 void ClearStencil(PP_Resource context_id, GLint s) { | 117 void ClearStencil(PP_Resource context_id, GLint s) { |
| 127 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 118 GetGLES(context_id)->ClearStencil(s); |
| 128 context->gles2_impl()->ClearStencil(s); | |
| 129 } | 119 } |
| 130 | 120 |
| 131 void ColorMask( | 121 void ColorMask( |
| 132 PP_Resource context_id, GLboolean red, GLboolean green, GLboolean blue, | 122 PP_Resource context_id, GLboolean red, GLboolean green, GLboolean blue, |
| 133 GLboolean alpha) { | 123 GLboolean alpha) { |
| 134 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 124 GetGLES(context_id)->ColorMask(red, green, blue, alpha); |
| 135 context->gles2_impl()->ColorMask(red, green, blue, alpha); | |
| 136 } | 125 } |
| 137 | 126 |
| 138 void CompileShader(PP_Resource context_id, GLuint shader) { | 127 void CompileShader(PP_Resource context_id, GLuint shader) { |
| 139 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 128 GetGLES(context_id)->CompileShader(shader); |
| 140 context->gles2_impl()->CompileShader(shader); | |
| 141 } | 129 } |
| 142 | 130 |
| 143 void CompressedTexImage2D( | 131 void CompressedTexImage2D( |
| 144 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat, | 132 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat, |
| 145 GLsizei width, GLsizei height, GLint border, GLsizei imageSize, | 133 GLsizei width, GLsizei height, GLint border, GLsizei imageSize, |
| 146 const void* data) { | 134 const void* data) { |
| 147 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 135 GetGLES(context_id)->CompressedTexImage2D( |
| 148 context->gles2_impl()->CompressedTexImage2D( | |
| 149 target, level, internalformat, width, height, border, imageSize, data); | 136 target, level, internalformat, width, height, border, imageSize, data); |
| 150 } | 137 } |
| 151 | 138 |
| 152 void CompressedTexSubImage2D( | 139 void CompressedTexSubImage2D( |
| 153 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, | 140 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, |
| 154 GLint yoffset, GLsizei width, GLsizei height, GLenum format, | 141 GLint yoffset, GLsizei width, GLsizei height, GLenum format, |
| 155 GLsizei imageSize, const void* data) { | 142 GLsizei imageSize, const void* data) { |
| 156 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 143 GetGLES(context_id)->CompressedTexSubImage2D( |
| 157 context->gles2_impl()->CompressedTexSubImage2D( | |
| 158 target, level, xoffset, yoffset, width, height, format, imageSize, data); | 144 target, level, xoffset, yoffset, width, height, format, imageSize, data); |
| 159 } | 145 } |
| 160 | 146 |
| 161 void CopyTexImage2D( | 147 void CopyTexImage2D( |
| 162 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat, | 148 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat, |
| 163 GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { | 149 GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { |
| 164 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 150 GetGLES(context_id)->CopyTexImage2D( |
| 165 context->gles2_impl()->CopyTexImage2D( | |
| 166 target, level, internalformat, x, y, width, height, border); | 151 target, level, internalformat, x, y, width, height, border); |
| 167 } | 152 } |
| 168 | 153 |
| 169 void CopyTexSubImage2D( | 154 void CopyTexSubImage2D( |
| 170 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, | 155 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, |
| 171 GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { | 156 GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { |
| 172 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 157 GetGLES(context_id)->CopyTexSubImage2D( |
| 173 context->gles2_impl()->CopyTexSubImage2D( | |
| 174 target, level, xoffset, yoffset, x, y, width, height); | 158 target, level, xoffset, yoffset, x, y, width, height); |
| 175 } | 159 } |
| 176 | 160 |
| 177 GLuint CreateProgram(PP_Resource context_id) { | 161 GLuint CreateProgram(PP_Resource context_id) { |
| 178 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 162 return GetGLES(context_id)->CreateProgram(); |
| 179 return context->gles2_impl()->CreateProgram(); | |
| 180 } | 163 } |
| 181 | 164 |
| 182 GLuint CreateShader(PP_Resource context_id, GLenum type) { | 165 GLuint CreateShader(PP_Resource context_id, GLenum type) { |
| 183 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 166 return GetGLES(context_id)->CreateShader(type); |
| 184 return context->gles2_impl()->CreateShader(type); | |
| 185 } | 167 } |
| 186 | 168 |
| 187 void CullFace(PP_Resource context_id, GLenum mode) { | 169 void CullFace(PP_Resource context_id, GLenum mode) { |
| 188 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 170 GetGLES(context_id)->CullFace(mode); |
| 189 context->gles2_impl()->CullFace(mode); | |
| 190 } | 171 } |
| 191 | 172 |
| 192 void DeleteBuffers(PP_Resource context_id, GLsizei n, const GLuint* buffers) { | 173 void DeleteBuffers(PP_Resource context_id, GLsizei n, const GLuint* buffers) { |
| 193 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 174 GetGLES(context_id)->DeleteBuffers(n, buffers); |
| 194 context->gles2_impl()->DeleteBuffers(n, buffers); | |
| 195 } | 175 } |
| 196 | 176 |
| 197 void DeleteFramebuffers( | 177 void DeleteFramebuffers( |
| 198 PP_Resource context_id, GLsizei n, const GLuint* framebuffers) { | 178 PP_Resource context_id, GLsizei n, const GLuint* framebuffers) { |
| 199 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 179 GetGLES(context_id)->DeleteFramebuffers(n, framebuffers); |
| 200 context->gles2_impl()->DeleteFramebuffers(n, framebuffers); | |
| 201 } | 180 } |
| 202 | 181 |
| 203 void DeleteProgram(PP_Resource context_id, GLuint program) { | 182 void DeleteProgram(PP_Resource context_id, GLuint program) { |
| 204 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 183 GetGLES(context_id)->DeleteProgram(program); |
| 205 context->gles2_impl()->DeleteProgram(program); | |
| 206 } | 184 } |
| 207 | 185 |
| 208 void DeleteRenderbuffers( | 186 void DeleteRenderbuffers( |
| 209 PP_Resource context_id, GLsizei n, const GLuint* renderbuffers) { | 187 PP_Resource context_id, GLsizei n, const GLuint* renderbuffers) { |
| 210 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 188 GetGLES(context_id)->DeleteRenderbuffers(n, renderbuffers); |
| 211 context->gles2_impl()->DeleteRenderbuffers(n, renderbuffers); | |
| 212 } | 189 } |
| 213 | 190 |
| 214 void DeleteShader(PP_Resource context_id, GLuint shader) { | 191 void DeleteShader(PP_Resource context_id, GLuint shader) { |
| 215 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 192 GetGLES(context_id)->DeleteShader(shader); |
| 216 context->gles2_impl()->DeleteShader(shader); | |
| 217 } | 193 } |
| 218 | 194 |
| 219 void DeleteTextures( | 195 void DeleteTextures( |
| 220 PP_Resource context_id, GLsizei n, const GLuint* textures) { | 196 PP_Resource context_id, GLsizei n, const GLuint* textures) { |
| 221 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 197 GetGLES(context_id)->DeleteTextures(n, textures); |
| 222 context->gles2_impl()->DeleteTextures(n, textures); | |
| 223 } | 198 } |
| 224 | 199 |
| 225 void DepthFunc(PP_Resource context_id, GLenum func) { | 200 void DepthFunc(PP_Resource context_id, GLenum func) { |
| 226 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 201 GetGLES(context_id)->DepthFunc(func); |
| 227 context->gles2_impl()->DepthFunc(func); | |
| 228 } | 202 } |
| 229 | 203 |
| 230 void DepthMask(PP_Resource context_id, GLboolean flag) { | 204 void DepthMask(PP_Resource context_id, GLboolean flag) { |
| 231 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 205 GetGLES(context_id)->DepthMask(flag); |
| 232 context->gles2_impl()->DepthMask(flag); | |
| 233 } | 206 } |
| 234 | 207 |
| 235 void DepthRangef(PP_Resource context_id, GLclampf zNear, GLclampf zFar) { | 208 void DepthRangef(PP_Resource context_id, GLclampf zNear, GLclampf zFar) { |
| 236 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 209 GetGLES(context_id)->DepthRangef(zNear, zFar); |
| 237 context->gles2_impl()->DepthRangef(zNear, zFar); | |
| 238 } | 210 } |
| 239 | 211 |
| 240 void DetachShader(PP_Resource context_id, GLuint program, GLuint shader) { | 212 void DetachShader(PP_Resource context_id, GLuint program, GLuint shader) { |
| 241 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 213 GetGLES(context_id)->DetachShader(program, shader); |
| 242 context->gles2_impl()->DetachShader(program, shader); | |
| 243 } | 214 } |
| 244 | 215 |
| 245 void Disable(PP_Resource context_id, GLenum cap) { | 216 void Disable(PP_Resource context_id, GLenum cap) { |
| 246 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 217 GetGLES(context_id)->Disable(cap); |
| 247 context->gles2_impl()->Disable(cap); | |
| 248 } | 218 } |
| 249 | 219 |
| 250 void DisableVertexAttribArray(PP_Resource context_id, GLuint index) { | 220 void DisableVertexAttribArray(PP_Resource context_id, GLuint index) { |
| 251 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 221 GetGLES(context_id)->DisableVertexAttribArray(index); |
| 252 context->gles2_impl()->DisableVertexAttribArray(index); | |
| 253 } | 222 } |
| 254 | 223 |
| 255 void DrawArrays( | 224 void DrawArrays( |
| 256 PP_Resource context_id, GLenum mode, GLint first, GLsizei count) { | 225 PP_Resource context_id, GLenum mode, GLint first, GLsizei count) { |
| 257 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 226 GetGLES(context_id)->DrawArrays(mode, first, count); |
| 258 context->gles2_impl()->DrawArrays(mode, first, count); | |
| 259 } | 227 } |
| 260 | 228 |
| 261 void DrawElements( | 229 void DrawElements( |
| 262 PP_Resource context_id, GLenum mode, GLsizei count, GLenum type, | 230 PP_Resource context_id, GLenum mode, GLsizei count, GLenum type, |
| 263 const void* indices) { | 231 const void* indices) { |
| 264 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 232 GetGLES(context_id)->DrawElements(mode, count, type, indices); |
| 265 context->gles2_impl()->DrawElements(mode, count, type, indices); | |
| 266 } | 233 } |
| 267 | 234 |
| 268 void Enable(PP_Resource context_id, GLenum cap) { | 235 void Enable(PP_Resource context_id, GLenum cap) { |
| 269 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 236 GetGLES(context_id)->Enable(cap); |
| 270 context->gles2_impl()->Enable(cap); | |
| 271 } | 237 } |
| 272 | 238 |
| 273 void EnableVertexAttribArray(PP_Resource context_id, GLuint index) { | 239 void EnableVertexAttribArray(PP_Resource context_id, GLuint index) { |
| 274 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 240 GetGLES(context_id)->EnableVertexAttribArray(index); |
| 275 context->gles2_impl()->EnableVertexAttribArray(index); | |
| 276 } | 241 } |
| 277 | 242 |
| 278 void Finish(PP_Resource context_id) { | 243 void Finish(PP_Resource context_id) { |
| 279 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 244 GetGLES(context_id)->Finish(); |
| 280 context->gles2_impl()->Finish(); | |
| 281 } | 245 } |
| 282 | 246 |
| 283 void Flush(PP_Resource context_id) { | 247 void Flush(PP_Resource context_id) { |
| 284 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 248 GetGLES(context_id)->Flush(); |
| 285 context->gles2_impl()->Flush(); | |
| 286 } | 249 } |
| 287 | 250 |
| 288 void FramebufferRenderbuffer( | 251 void FramebufferRenderbuffer( |
| 289 PP_Resource context_id, GLenum target, GLenum attachment, | 252 PP_Resource context_id, GLenum target, GLenum attachment, |
| 290 GLenum renderbuffertarget, GLuint renderbuffer) { | 253 GLenum renderbuffertarget, GLuint renderbuffer) { |
| 291 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 254 GetGLES(context_id)->FramebufferRenderbuffer( |
| 292 context->gles2_impl()->FramebufferRenderbuffer( | |
| 293 target, attachment, renderbuffertarget, renderbuffer); | 255 target, attachment, renderbuffertarget, renderbuffer); |
| 294 } | 256 } |
| 295 | 257 |
| 296 void FramebufferTexture2D( | 258 void FramebufferTexture2D( |
| 297 PP_Resource context_id, GLenum target, GLenum attachment, GLenum textarget, | 259 PP_Resource context_id, GLenum target, GLenum attachment, GLenum textarget, |
| 298 GLuint texture, GLint level) { | 260 GLuint texture, GLint level) { |
| 299 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 261 GetGLES(context_id)->FramebufferTexture2D( |
| 300 context->gles2_impl()->FramebufferTexture2D( | |
| 301 target, attachment, textarget, texture, level); | 262 target, attachment, textarget, texture, level); |
| 302 } | 263 } |
| 303 | 264 |
| 304 void FrontFace(PP_Resource context_id, GLenum mode) { | 265 void FrontFace(PP_Resource context_id, GLenum mode) { |
| 305 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 266 GetGLES(context_id)->FrontFace(mode); |
| 306 context->gles2_impl()->FrontFace(mode); | |
| 307 } | 267 } |
| 308 | 268 |
| 309 void GenBuffers(PP_Resource context_id, GLsizei n, GLuint* buffers) { | 269 void GenBuffers(PP_Resource context_id, GLsizei n, GLuint* buffers) { |
| 310 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 270 GetGLES(context_id)->GenBuffers(n, buffers); |
| 311 context->gles2_impl()->GenBuffers(n, buffers); | |
| 312 } | 271 } |
| 313 | 272 |
| 314 void GenerateMipmap(PP_Resource context_id, GLenum target) { | 273 void GenerateMipmap(PP_Resource context_id, GLenum target) { |
| 315 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 274 GetGLES(context_id)->GenerateMipmap(target); |
| 316 context->gles2_impl()->GenerateMipmap(target); | |
| 317 } | 275 } |
| 318 | 276 |
| 319 void GenFramebuffers(PP_Resource context_id, GLsizei n, GLuint* framebuffers) { | 277 void GenFramebuffers(PP_Resource context_id, GLsizei n, GLuint* framebuffers) { |
| 320 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 278 GetGLES(context_id)->GenFramebuffers(n, framebuffers); |
| 321 context->gles2_impl()->GenFramebuffers(n, framebuffers); | |
| 322 } | 279 } |
| 323 | 280 |
| 324 void GenRenderbuffers( | 281 void GenRenderbuffers( |
| 325 PP_Resource context_id, GLsizei n, GLuint* renderbuffers) { | 282 PP_Resource context_id, GLsizei n, GLuint* renderbuffers) { |
| 326 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 283 GetGLES(context_id)->GenRenderbuffers(n, renderbuffers); |
| 327 context->gles2_impl()->GenRenderbuffers(n, renderbuffers); | |
| 328 } | 284 } |
| 329 | 285 |
| 330 void GenTextures(PP_Resource context_id, GLsizei n, GLuint* textures) { | 286 void GenTextures(PP_Resource context_id, GLsizei n, GLuint* textures) { |
| 331 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 287 GetGLES(context_id)->GenTextures(n, textures); |
| 332 context->gles2_impl()->GenTextures(n, textures); | |
| 333 } | 288 } |
| 334 | 289 |
| 335 void GetActiveAttrib( | 290 void GetActiveAttrib( |
| 336 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize, | 291 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize, |
| 337 GLsizei* length, GLint* size, GLenum* type, char* name) { | 292 GLsizei* length, GLint* size, GLenum* type, char* name) { |
| 338 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 293 GetGLES(context_id)->GetActiveAttrib( |
| 339 context->gles2_impl()->GetActiveAttrib( | |
| 340 program, index, bufsize, length, size, type, name); | 294 program, index, bufsize, length, size, type, name); |
| 341 } | 295 } |
| 342 | 296 |
| 343 void GetActiveUniform( | 297 void GetActiveUniform( |
| 344 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize, | 298 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize, |
| 345 GLsizei* length, GLint* size, GLenum* type, char* name) { | 299 GLsizei* length, GLint* size, GLenum* type, char* name) { |
| 346 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 300 GetGLES(context_id)->GetActiveUniform( |
| 347 context->gles2_impl()->GetActiveUniform( | |
| 348 program, index, bufsize, length, size, type, name); | 301 program, index, bufsize, length, size, type, name); |
| 349 } | 302 } |
| 350 | 303 |
| 351 void GetAttachedShaders( | 304 void GetAttachedShaders( |
| 352 PP_Resource context_id, GLuint program, GLsizei maxcount, GLsizei* count, | 305 PP_Resource context_id, GLuint program, GLsizei maxcount, GLsizei* count, |
| 353 GLuint* shaders) { | 306 GLuint* shaders) { |
| 354 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 307 GetGLES(context_id)->GetAttachedShaders(program, maxcount, count, shaders); |
| 355 context->gles2_impl()->GetAttachedShaders(program, maxcount, count, shaders); | |
| 356 } | 308 } |
| 357 | 309 |
| 358 GLint GetAttribLocation( | 310 GLint GetAttribLocation( |
| 359 PP_Resource context_id, GLuint program, const char* name) { | 311 PP_Resource context_id, GLuint program, const char* name) { |
| 360 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 312 return GetGLES(context_id)->GetAttribLocation(program, name); |
| 361 return context->gles2_impl()->GetAttribLocation(program, name); | |
| 362 } | 313 } |
| 363 | 314 |
| 364 void GetBooleanv(PP_Resource context_id, GLenum pname, GLboolean* params) { | 315 void GetBooleanv(PP_Resource context_id, GLenum pname, GLboolean* params) { |
| 365 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 316 GetGLES(context_id)->GetBooleanv(pname, params); |
| 366 context->gles2_impl()->GetBooleanv(pname, params); | |
| 367 } | 317 } |
| 368 | 318 |
| 369 void GetBufferParameteriv( | 319 void GetBufferParameteriv( |
| 370 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { | 320 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { |
| 371 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 321 GetGLES(context_id)->GetBufferParameteriv(target, pname, params); |
| 372 context->gles2_impl()->GetBufferParameteriv(target, pname, params); | |
| 373 } | 322 } |
| 374 | 323 |
| 375 GLenum GetError(PP_Resource context_id) { | 324 GLenum GetError(PP_Resource context_id) { |
| 376 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 325 return GetGLES(context_id)->GetError(); |
| 377 return context->gles2_impl()->GetError(); | |
| 378 } | 326 } |
| 379 | 327 |
| 380 void GetFloatv(PP_Resource context_id, GLenum pname, GLfloat* params) { | 328 void GetFloatv(PP_Resource context_id, GLenum pname, GLfloat* params) { |
| 381 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 329 GetGLES(context_id)->GetFloatv(pname, params); |
| 382 context->gles2_impl()->GetFloatv(pname, params); | |
| 383 } | 330 } |
| 384 | 331 |
| 385 void GetFramebufferAttachmentParameteriv( | 332 void GetFramebufferAttachmentParameteriv( |
| 386 PP_Resource context_id, GLenum target, GLenum attachment, GLenum pname, | 333 PP_Resource context_id, GLenum target, GLenum attachment, GLenum pname, |
| 387 GLint* params) { | 334 GLint* params) { |
| 388 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 335 GetGLES(context_id)->GetFramebufferAttachmentParameteriv( |
| 389 context->gles2_impl()->GetFramebufferAttachmentParameteriv( | |
| 390 target, attachment, pname, params); | 336 target, attachment, pname, params); |
| 391 } | 337 } |
| 392 | 338 |
| 393 void GetIntegerv(PP_Resource context_id, GLenum pname, GLint* params) { | 339 void GetIntegerv(PP_Resource context_id, GLenum pname, GLint* params) { |
| 394 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 340 GetGLES(context_id)->GetIntegerv(pname, params); |
| 395 context->gles2_impl()->GetIntegerv(pname, params); | |
| 396 } | 341 } |
| 397 | 342 |
| 398 void GetProgramiv( | 343 void GetProgramiv( |
| 399 PP_Resource context_id, GLuint program, GLenum pname, GLint* params) { | 344 PP_Resource context_id, GLuint program, GLenum pname, GLint* params) { |
| 400 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 345 GetGLES(context_id)->GetProgramiv(program, pname, params); |
| 401 context->gles2_impl()->GetProgramiv(program, pname, params); | |
| 402 } | 346 } |
| 403 | 347 |
| 404 void GetProgramInfoLog( | 348 void GetProgramInfoLog( |
| 405 PP_Resource context_id, GLuint program, GLsizei bufsize, GLsizei* length, | 349 PP_Resource context_id, GLuint program, GLsizei bufsize, GLsizei* length, |
| 406 char* infolog) { | 350 char* infolog) { |
| 407 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 351 GetGLES(context_id)->GetProgramInfoLog(program, bufsize, length, infolog); |
| 408 context->gles2_impl()->GetProgramInfoLog(program, bufsize, length, infolog); | |
| 409 } | 352 } |
| 410 | 353 |
| 411 void GetRenderbufferParameteriv( | 354 void GetRenderbufferParameteriv( |
| 412 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { | 355 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { |
| 413 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 356 GetGLES(context_id)->GetRenderbufferParameteriv(target, pname, params); |
| 414 context->gles2_impl()->GetRenderbufferParameteriv(target, pname, params); | |
| 415 } | 357 } |
| 416 | 358 |
| 417 void GetShaderiv( | 359 void GetShaderiv( |
| 418 PP_Resource context_id, GLuint shader, GLenum pname, GLint* params) { | 360 PP_Resource context_id, GLuint shader, GLenum pname, GLint* params) { |
| 419 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 361 GetGLES(context_id)->GetShaderiv(shader, pname, params); |
| 420 context->gles2_impl()->GetShaderiv(shader, pname, params); | |
| 421 } | 362 } |
| 422 | 363 |
| 423 void GetShaderInfoLog( | 364 void GetShaderInfoLog( |
| 424 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length, | 365 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length, |
| 425 char* infolog) { | 366 char* infolog) { |
| 426 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 367 GetGLES(context_id)->GetShaderInfoLog(shader, bufsize, length, infolog); |
| 427 context->gles2_impl()->GetShaderInfoLog(shader, bufsize, length, infolog); | |
| 428 } | 368 } |
| 429 | 369 |
| 430 void GetShaderPrecisionFormat( | 370 void GetShaderPrecisionFormat( |
| 431 PP_Resource context_id, GLenum shadertype, GLenum precisiontype, | 371 PP_Resource context_id, GLenum shadertype, GLenum precisiontype, |
| 432 GLint* range, GLint* precision) { | 372 GLint* range, GLint* precision) { |
| 433 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 373 GetGLES(context_id)->GetShaderPrecisionFormat( |
| 434 context->gles2_impl()->GetShaderPrecisionFormat( | |
| 435 shadertype, precisiontype, range, precision); | 374 shadertype, precisiontype, range, precision); |
| 436 } | 375 } |
| 437 | 376 |
| 438 void GetShaderSource( | 377 void GetShaderSource( |
| 439 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length, | 378 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length, |
| 440 char* source) { | 379 char* source) { |
| 441 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 380 GetGLES(context_id)->GetShaderSource(shader, bufsize, length, source); |
| 442 context->gles2_impl()->GetShaderSource(shader, bufsize, length, source); | |
| 443 } | 381 } |
| 444 | 382 |
| 445 const GLubyte* GetString(PP_Resource context_id, GLenum name) { | 383 const GLubyte* GetString(PP_Resource context_id, GLenum name) { |
| 446 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 384 return GetGLES(context_id)->GetString(name); |
| 447 return context->gles2_impl()->GetString(name); | |
| 448 } | 385 } |
| 449 | 386 |
| 450 void GetTexParameterfv( | 387 void GetTexParameterfv( |
| 451 PP_Resource context_id, GLenum target, GLenum pname, GLfloat* params) { | 388 PP_Resource context_id, GLenum target, GLenum pname, GLfloat* params) { |
| 452 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 389 GetGLES(context_id)->GetTexParameterfv(target, pname, params); |
| 453 context->gles2_impl()->GetTexParameterfv(target, pname, params); | |
| 454 } | 390 } |
| 455 | 391 |
| 456 void GetTexParameteriv( | 392 void GetTexParameteriv( |
| 457 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { | 393 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { |
| 458 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 394 GetGLES(context_id)->GetTexParameteriv(target, pname, params); |
| 459 context->gles2_impl()->GetTexParameteriv(target, pname, params); | |
| 460 } | 395 } |
| 461 | 396 |
| 462 void GetUniformfv( | 397 void GetUniformfv( |
| 463 PP_Resource context_id, GLuint program, GLint location, GLfloat* params) { | 398 PP_Resource context_id, GLuint program, GLint location, GLfloat* params) { |
| 464 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 399 GetGLES(context_id)->GetUniformfv(program, location, params); |
| 465 context->gles2_impl()->GetUniformfv(program, location, params); | |
| 466 } | 400 } |
| 467 | 401 |
| 468 void GetUniformiv( | 402 void GetUniformiv( |
| 469 PP_Resource context_id, GLuint program, GLint location, GLint* params) { | 403 PP_Resource context_id, GLuint program, GLint location, GLint* params) { |
| 470 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 404 GetGLES(context_id)->GetUniformiv(program, location, params); |
| 471 context->gles2_impl()->GetUniformiv(program, location, params); | |
| 472 } | 405 } |
| 473 | 406 |
| 474 GLint GetUniformLocation( | 407 GLint GetUniformLocation( |
| 475 PP_Resource context_id, GLuint program, const char* name) { | 408 PP_Resource context_id, GLuint program, const char* name) { |
| 476 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 409 return GetGLES(context_id)->GetUniformLocation(program, name); |
| 477 return context->gles2_impl()->GetUniformLocation(program, name); | |
| 478 } | 410 } |
| 479 | 411 |
| 480 void GetVertexAttribfv( | 412 void GetVertexAttribfv( |
| 481 PP_Resource context_id, GLuint index, GLenum pname, GLfloat* params) { | 413 PP_Resource context_id, GLuint index, GLenum pname, GLfloat* params) { |
| 482 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 414 GetGLES(context_id)->GetVertexAttribfv(index, pname, params); |
| 483 context->gles2_impl()->GetVertexAttribfv(index, pname, params); | |
| 484 } | 415 } |
| 485 | 416 |
| 486 void GetVertexAttribiv( | 417 void GetVertexAttribiv( |
| 487 PP_Resource context_id, GLuint index, GLenum pname, GLint* params) { | 418 PP_Resource context_id, GLuint index, GLenum pname, GLint* params) { |
| 488 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 419 GetGLES(context_id)->GetVertexAttribiv(index, pname, params); |
| 489 context->gles2_impl()->GetVertexAttribiv(index, pname, params); | |
| 490 } | 420 } |
| 491 | 421 |
| 492 void GetVertexAttribPointerv( | 422 void GetVertexAttribPointerv( |
| 493 PP_Resource context_id, GLuint index, GLenum pname, void** pointer) { | 423 PP_Resource context_id, GLuint index, GLenum pname, void** pointer) { |
| 494 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 424 GetGLES(context_id)->GetVertexAttribPointerv(index, pname, pointer); |
| 495 context->gles2_impl()->GetVertexAttribPointerv(index, pname, pointer); | |
| 496 } | 425 } |
| 497 | 426 |
| 498 void Hint(PP_Resource context_id, GLenum target, GLenum mode) { | 427 void Hint(PP_Resource context_id, GLenum target, GLenum mode) { |
| 499 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 428 GetGLES(context_id)->Hint(target, mode); |
| 500 context->gles2_impl()->Hint(target, mode); | |
| 501 } | 429 } |
| 502 | 430 |
| 503 GLboolean IsBuffer(PP_Resource context_id, GLuint buffer) { | 431 GLboolean IsBuffer(PP_Resource context_id, GLuint buffer) { |
| 504 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 432 return GetGLES(context_id)->IsBuffer(buffer); |
| 505 return context->gles2_impl()->IsBuffer(buffer); | |
| 506 } | 433 } |
| 507 | 434 |
| 508 GLboolean IsEnabled(PP_Resource context_id, GLenum cap) { | 435 GLboolean IsEnabled(PP_Resource context_id, GLenum cap) { |
| 509 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 436 return GetGLES(context_id)->IsEnabled(cap); |
| 510 return context->gles2_impl()->IsEnabled(cap); | |
| 511 } | 437 } |
| 512 | 438 |
| 513 GLboolean IsFramebuffer(PP_Resource context_id, GLuint framebuffer) { | 439 GLboolean IsFramebuffer(PP_Resource context_id, GLuint framebuffer) { |
| 514 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 440 return GetGLES(context_id)->IsFramebuffer(framebuffer); |
| 515 return context->gles2_impl()->IsFramebuffer(framebuffer); | |
| 516 } | 441 } |
| 517 | 442 |
| 518 GLboolean IsProgram(PP_Resource context_id, GLuint program) { | 443 GLboolean IsProgram(PP_Resource context_id, GLuint program) { |
| 519 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 444 return GetGLES(context_id)->IsProgram(program); |
| 520 return context->gles2_impl()->IsProgram(program); | |
| 521 } | 445 } |
| 522 | 446 |
| 523 GLboolean IsRenderbuffer(PP_Resource context_id, GLuint renderbuffer) { | 447 GLboolean IsRenderbuffer(PP_Resource context_id, GLuint renderbuffer) { |
| 524 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 448 return GetGLES(context_id)->IsRenderbuffer(renderbuffer); |
| 525 return context->gles2_impl()->IsRenderbuffer(renderbuffer); | |
| 526 } | 449 } |
| 527 | 450 |
| 528 GLboolean IsShader(PP_Resource context_id, GLuint shader) { | 451 GLboolean IsShader(PP_Resource context_id, GLuint shader) { |
| 529 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 452 return GetGLES(context_id)->IsShader(shader); |
| 530 return context->gles2_impl()->IsShader(shader); | |
| 531 } | 453 } |
| 532 | 454 |
| 533 GLboolean IsTexture(PP_Resource context_id, GLuint texture) { | 455 GLboolean IsTexture(PP_Resource context_id, GLuint texture) { |
| 534 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 456 return GetGLES(context_id)->IsTexture(texture); |
| 535 return context->gles2_impl()->IsTexture(texture); | |
| 536 } | 457 } |
| 537 | 458 |
| 538 void LineWidth(PP_Resource context_id, GLfloat width) { | 459 void LineWidth(PP_Resource context_id, GLfloat width) { |
| 539 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 460 GetGLES(context_id)->LineWidth(width); |
| 540 context->gles2_impl()->LineWidth(width); | |
| 541 } | 461 } |
| 542 | 462 |
| 543 void LinkProgram(PP_Resource context_id, GLuint program) { | 463 void LinkProgram(PP_Resource context_id, GLuint program) { |
| 544 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 464 GetGLES(context_id)->LinkProgram(program); |
| 545 context->gles2_impl()->LinkProgram(program); | |
| 546 } | 465 } |
| 547 | 466 |
| 548 void PixelStorei(PP_Resource context_id, GLenum pname, GLint param) { | 467 void PixelStorei(PP_Resource context_id, GLenum pname, GLint param) { |
| 549 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 468 GetGLES(context_id)->PixelStorei(pname, param); |
| 550 context->gles2_impl()->PixelStorei(pname, param); | |
| 551 } | 469 } |
| 552 | 470 |
| 553 void PolygonOffset(PP_Resource context_id, GLfloat factor, GLfloat units) { | 471 void PolygonOffset(PP_Resource context_id, GLfloat factor, GLfloat units) { |
| 554 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 472 GetGLES(context_id)->PolygonOffset(factor, units); |
| 555 context->gles2_impl()->PolygonOffset(factor, units); | |
| 556 } | 473 } |
| 557 | 474 |
| 558 void ReadPixels( | 475 void ReadPixels( |
| 559 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height, | 476 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height, |
| 560 GLenum format, GLenum type, void* pixels) { | 477 GLenum format, GLenum type, void* pixels) { |
| 561 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 478 GetGLES(context_id)->ReadPixels(x, y, width, height, format, type, pixels); |
| 562 context->gles2_impl()->ReadPixels(x, y, width, height, format, type, pixels); | |
| 563 } | 479 } |
| 564 | 480 |
| 565 void ReleaseShaderCompiler(PP_Resource context_id) { | 481 void ReleaseShaderCompiler(PP_Resource context_id) { |
| 566 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 482 GetGLES(context_id)->ReleaseShaderCompiler(); |
| 567 context->gles2_impl()->ReleaseShaderCompiler(); | |
| 568 } | 483 } |
| 569 | 484 |
| 570 void RenderbufferStorage( | 485 void RenderbufferStorage( |
| 571 PP_Resource context_id, GLenum target, GLenum internalformat, GLsizei width, | 486 PP_Resource context_id, GLenum target, GLenum internalformat, GLsizei width, |
| 572 GLsizei height) { | 487 GLsizei height) { |
| 573 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 488 GetGLES(context_id)->RenderbufferStorage( |
| 574 context->gles2_impl()->RenderbufferStorage( | |
| 575 target, internalformat, width, height); | 489 target, internalformat, width, height); |
| 576 } | 490 } |
| 577 | 491 |
| 578 void SampleCoverage(PP_Resource context_id, GLclampf value, GLboolean invert) { | 492 void SampleCoverage(PP_Resource context_id, GLclampf value, GLboolean invert) { |
| 579 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 493 GetGLES(context_id)->SampleCoverage(value, invert); |
| 580 context->gles2_impl()->SampleCoverage(value, invert); | |
| 581 } | 494 } |
| 582 | 495 |
| 583 void Scissor( | 496 void Scissor( |
| 584 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) { | 497 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) { |
| 585 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 498 GetGLES(context_id)->Scissor(x, y, width, height); |
| 586 context->gles2_impl()->Scissor(x, y, width, height); | |
| 587 } | 499 } |
| 588 | 500 |
| 589 void ShaderBinary( | 501 void ShaderBinary( |
| 590 PP_Resource context_id, GLsizei n, const GLuint* shaders, | 502 PP_Resource context_id, GLsizei n, const GLuint* shaders, |
| 591 GLenum binaryformat, const void* binary, GLsizei length) { | 503 GLenum binaryformat, const void* binary, GLsizei length) { |
| 592 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 504 GetGLES(context_id)->ShaderBinary( |
| 593 context->gles2_impl()->ShaderBinary( | |
| 594 n, shaders, binaryformat, binary, length); | 505 n, shaders, binaryformat, binary, length); |
| 595 } | 506 } |
| 596 | 507 |
| 597 void ShaderSource( | 508 void ShaderSource( |
| 598 PP_Resource context_id, GLuint shader, GLsizei count, const char** str, | 509 PP_Resource context_id, GLuint shader, GLsizei count, const char** str, |
| 599 const GLint* length) { | 510 const GLint* length) { |
| 600 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 511 GetGLES(context_id)->ShaderSource(shader, count, str, length); |
| 601 context->gles2_impl()->ShaderSource(shader, count, str, length); | |
| 602 } | 512 } |
| 603 | 513 |
| 604 void StencilFunc(PP_Resource context_id, GLenum func, GLint ref, GLuint mask) { | 514 void StencilFunc(PP_Resource context_id, GLenum func, GLint ref, GLuint mask) { |
| 605 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 515 GetGLES(context_id)->StencilFunc(func, ref, mask); |
| 606 context->gles2_impl()->StencilFunc(func, ref, mask); | |
| 607 } | 516 } |
| 608 | 517 |
| 609 void StencilFuncSeparate( | 518 void StencilFuncSeparate( |
| 610 PP_Resource context_id, GLenum face, GLenum func, GLint ref, GLuint mask) { | 519 PP_Resource context_id, GLenum face, GLenum func, GLint ref, GLuint mask) { |
| 611 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 520 GetGLES(context_id)->StencilFuncSeparate(face, func, ref, mask); |
| 612 context->gles2_impl()->StencilFuncSeparate(face, func, ref, mask); | |
| 613 } | 521 } |
| 614 | 522 |
| 615 void StencilMask(PP_Resource context_id, GLuint mask) { | 523 void StencilMask(PP_Resource context_id, GLuint mask) { |
| 616 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 524 GetGLES(context_id)->StencilMask(mask); |
| 617 context->gles2_impl()->StencilMask(mask); | |
| 618 } | 525 } |
| 619 | 526 |
| 620 void StencilMaskSeparate(PP_Resource context_id, GLenum face, GLuint mask) { | 527 void StencilMaskSeparate(PP_Resource context_id, GLenum face, GLuint mask) { |
| 621 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 528 GetGLES(context_id)->StencilMaskSeparate(face, mask); |
| 622 context->gles2_impl()->StencilMaskSeparate(face, mask); | |
| 623 } | 529 } |
| 624 | 530 |
| 625 void StencilOp( | 531 void StencilOp( |
| 626 PP_Resource context_id, GLenum fail, GLenum zfail, GLenum zpass) { | 532 PP_Resource context_id, GLenum fail, GLenum zfail, GLenum zpass) { |
| 627 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 533 GetGLES(context_id)->StencilOp(fail, zfail, zpass); |
| 628 context->gles2_impl()->StencilOp(fail, zfail, zpass); | |
| 629 } | 534 } |
| 630 | 535 |
| 631 void StencilOpSeparate( | 536 void StencilOpSeparate( |
| 632 PP_Resource context_id, GLenum face, GLenum fail, GLenum zfail, | 537 PP_Resource context_id, GLenum face, GLenum fail, GLenum zfail, |
| 633 GLenum zpass) { | 538 GLenum zpass) { |
| 634 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 539 GetGLES(context_id)->StencilOpSeparate(face, fail, zfail, zpass); |
| 635 context->gles2_impl()->StencilOpSeparate(face, fail, zfail, zpass); | |
| 636 } | 540 } |
| 637 | 541 |
| 638 void TexImage2D( | 542 void TexImage2D( |
| 639 PP_Resource context_id, GLenum target, GLint level, GLint internalformat, | 543 PP_Resource context_id, GLenum target, GLint level, GLint internalformat, |
| 640 GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, | 544 GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, |
| 641 const void* pixels) { | 545 const void* pixels) { |
| 642 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 546 GetGLES(context_id)->TexImage2D( |
| 643 context->gles2_impl()->TexImage2D( | |
| 644 target, level, internalformat, width, height, border, format, type, | 547 target, level, internalformat, width, height, border, format, type, |
| 645 pixels); | 548 pixels); |
| 646 } | 549 } |
| 647 | 550 |
| 648 void TexParameterf( | 551 void TexParameterf( |
| 649 PP_Resource context_id, GLenum target, GLenum pname, GLfloat param) { | 552 PP_Resource context_id, GLenum target, GLenum pname, GLfloat param) { |
| 650 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 553 GetGLES(context_id)->TexParameterf(target, pname, param); |
| 651 context->gles2_impl()->TexParameterf(target, pname, param); | |
| 652 } | 554 } |
| 653 | 555 |
| 654 void TexParameterfv( | 556 void TexParameterfv( |
| 655 PP_Resource context_id, GLenum target, GLenum pname, | 557 PP_Resource context_id, GLenum target, GLenum pname, |
| 656 const GLfloat* params) { | 558 const GLfloat* params) { |
| 657 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 559 GetGLES(context_id)->TexParameterfv(target, pname, params); |
| 658 context->gles2_impl()->TexParameterfv(target, pname, params); | |
| 659 } | 560 } |
| 660 | 561 |
| 661 void TexParameteri( | 562 void TexParameteri( |
| 662 PP_Resource context_id, GLenum target, GLenum pname, GLint param) { | 563 PP_Resource context_id, GLenum target, GLenum pname, GLint param) { |
| 663 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 564 GetGLES(context_id)->TexParameteri(target, pname, param); |
| 664 context->gles2_impl()->TexParameteri(target, pname, param); | |
| 665 } | 565 } |
| 666 | 566 |
| 667 void TexParameteriv( | 567 void TexParameteriv( |
| 668 PP_Resource context_id, GLenum target, GLenum pname, const GLint* params) { | 568 PP_Resource context_id, GLenum target, GLenum pname, const GLint* params) { |
| 669 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 569 GetGLES(context_id)->TexParameteriv(target, pname, params); |
| 670 context->gles2_impl()->TexParameteriv(target, pname, params); | |
| 671 } | 570 } |
| 672 | 571 |
| 673 void TexSubImage2D( | 572 void TexSubImage2D( |
| 674 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, | 573 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, |
| 675 GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, | 574 GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, |
| 676 const void* pixels) { | 575 const void* pixels) { |
| 677 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 576 GetGLES(context_id)->TexSubImage2D( |
| 678 context->gles2_impl()->TexSubImage2D( | |
| 679 target, level, xoffset, yoffset, width, height, format, type, pixels); | 577 target, level, xoffset, yoffset, width, height, format, type, pixels); |
| 680 } | 578 } |
| 681 | 579 |
| 682 void Uniform1f(PP_Resource context_id, GLint location, GLfloat x) { | 580 void Uniform1f(PP_Resource context_id, GLint location, GLfloat x) { |
| 683 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 581 GetGLES(context_id)->Uniform1f(location, x); |
| 684 context->gles2_impl()->Uniform1f(location, x); | |
| 685 } | 582 } |
| 686 | 583 |
| 687 void Uniform1fv( | 584 void Uniform1fv( |
| 688 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { | 585 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { |
| 689 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 586 GetGLES(context_id)->Uniform1fv(location, count, v); |
| 690 context->gles2_impl()->Uniform1fv(location, count, v); | |
| 691 } | 587 } |
| 692 | 588 |
| 693 void Uniform1i(PP_Resource context_id, GLint location, GLint x) { | 589 void Uniform1i(PP_Resource context_id, GLint location, GLint x) { |
| 694 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 590 GetGLES(context_id)->Uniform1i(location, x); |
| 695 context->gles2_impl()->Uniform1i(location, x); | |
| 696 } | 591 } |
| 697 | 592 |
| 698 void Uniform1iv( | 593 void Uniform1iv( |
| 699 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { | 594 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { |
| 700 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 595 GetGLES(context_id)->Uniform1iv(location, count, v); |
| 701 context->gles2_impl()->Uniform1iv(location, count, v); | |
| 702 } | 596 } |
| 703 | 597 |
| 704 void Uniform2f(PP_Resource context_id, GLint location, GLfloat x, GLfloat y) { | 598 void Uniform2f(PP_Resource context_id, GLint location, GLfloat x, GLfloat y) { |
| 705 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 599 GetGLES(context_id)->Uniform2f(location, x, y); |
| 706 context->gles2_impl()->Uniform2f(location, x, y); | |
| 707 } | 600 } |
| 708 | 601 |
| 709 void Uniform2fv( | 602 void Uniform2fv( |
| 710 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { | 603 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { |
| 711 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 604 GetGLES(context_id)->Uniform2fv(location, count, v); |
| 712 context->gles2_impl()->Uniform2fv(location, count, v); | |
| 713 } | 605 } |
| 714 | 606 |
| 715 void Uniform2i(PP_Resource context_id, GLint location, GLint x, GLint y) { | 607 void Uniform2i(PP_Resource context_id, GLint location, GLint x, GLint y) { |
| 716 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 608 GetGLES(context_id)->Uniform2i(location, x, y); |
| 717 context->gles2_impl()->Uniform2i(location, x, y); | |
| 718 } | 609 } |
| 719 | 610 |
| 720 void Uniform2iv( | 611 void Uniform2iv( |
| 721 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { | 612 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { |
| 722 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 613 GetGLES(context_id)->Uniform2iv(location, count, v); |
| 723 context->gles2_impl()->Uniform2iv(location, count, v); | |
| 724 } | 614 } |
| 725 | 615 |
| 726 void Uniform3f( | 616 void Uniform3f( |
| 727 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z) { | 617 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z) { |
| 728 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 618 GetGLES(context_id)->Uniform3f(location, x, y, z); |
| 729 context->gles2_impl()->Uniform3f(location, x, y, z); | |
| 730 } | 619 } |
| 731 | 620 |
| 732 void Uniform3fv( | 621 void Uniform3fv( |
| 733 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { | 622 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { |
| 734 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 623 GetGLES(context_id)->Uniform3fv(location, count, v); |
| 735 context->gles2_impl()->Uniform3fv(location, count, v); | |
| 736 } | 624 } |
| 737 | 625 |
| 738 void Uniform3i( | 626 void Uniform3i( |
| 739 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z) { | 627 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z) { |
| 740 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 628 GetGLES(context_id)->Uniform3i(location, x, y, z); |
| 741 context->gles2_impl()->Uniform3i(location, x, y, z); | |
| 742 } | 629 } |
| 743 | 630 |
| 744 void Uniform3iv( | 631 void Uniform3iv( |
| 745 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { | 632 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { |
| 746 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 633 GetGLES(context_id)->Uniform3iv(location, count, v); |
| 747 context->gles2_impl()->Uniform3iv(location, count, v); | |
| 748 } | 634 } |
| 749 | 635 |
| 750 void Uniform4f( | 636 void Uniform4f( |
| 751 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z, | 637 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z, |
| 752 GLfloat w) { | 638 GLfloat w) { |
| 753 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 639 GetGLES(context_id)->Uniform4f(location, x, y, z, w); |
| 754 context->gles2_impl()->Uniform4f(location, x, y, z, w); | |
| 755 } | 640 } |
| 756 | 641 |
| 757 void Uniform4fv( | 642 void Uniform4fv( |
| 758 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { | 643 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { |
| 759 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 644 GetGLES(context_id)->Uniform4fv(location, count, v); |
| 760 context->gles2_impl()->Uniform4fv(location, count, v); | |
| 761 } | 645 } |
| 762 | 646 |
| 763 void Uniform4i( | 647 void Uniform4i( |
| 764 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z, | 648 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z, |
| 765 GLint w) { | 649 GLint w) { |
| 766 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 650 GetGLES(context_id)->Uniform4i(location, x, y, z, w); |
| 767 context->gles2_impl()->Uniform4i(location, x, y, z, w); | |
| 768 } | 651 } |
| 769 | 652 |
| 770 void Uniform4iv( | 653 void Uniform4iv( |
| 771 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { | 654 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { |
| 772 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 655 GetGLES(context_id)->Uniform4iv(location, count, v); |
| 773 context->gles2_impl()->Uniform4iv(location, count, v); | |
| 774 } | 656 } |
| 775 | 657 |
| 776 void UniformMatrix2fv( | 658 void UniformMatrix2fv( |
| 777 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, | 659 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, |
| 778 const GLfloat* value) { | 660 const GLfloat* value) { |
| 779 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 661 GetGLES(context_id)->UniformMatrix2fv(location, count, transpose, value); |
| 780 context->gles2_impl()->UniformMatrix2fv(location, count, transpose, value); | |
| 781 } | 662 } |
| 782 | 663 |
| 783 void UniformMatrix3fv( | 664 void UniformMatrix3fv( |
| 784 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, | 665 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, |
| 785 const GLfloat* value) { | 666 const GLfloat* value) { |
| 786 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 667 GetGLES(context_id)->UniformMatrix3fv(location, count, transpose, value); |
| 787 context->gles2_impl()->UniformMatrix3fv(location, count, transpose, value); | |
| 788 } | 668 } |
| 789 | 669 |
| 790 void UniformMatrix4fv( | 670 void UniformMatrix4fv( |
| 791 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, | 671 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, |
| 792 const GLfloat* value) { | 672 const GLfloat* value) { |
| 793 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 673 GetGLES(context_id)->UniformMatrix4fv(location, count, transpose, value); |
| 794 context->gles2_impl()->UniformMatrix4fv(location, count, transpose, value); | |
| 795 } | 674 } |
| 796 | 675 |
| 797 void UseProgram(PP_Resource context_id, GLuint program) { | 676 void UseProgram(PP_Resource context_id, GLuint program) { |
| 798 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 677 GetGLES(context_id)->UseProgram(program); |
| 799 context->gles2_impl()->UseProgram(program); | |
| 800 } | 678 } |
| 801 | 679 |
| 802 void ValidateProgram(PP_Resource context_id, GLuint program) { | 680 void ValidateProgram(PP_Resource context_id, GLuint program) { |
| 803 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 681 GetGLES(context_id)->ValidateProgram(program); |
| 804 context->gles2_impl()->ValidateProgram(program); | |
| 805 } | 682 } |
| 806 | 683 |
| 807 void VertexAttrib1f(PP_Resource context_id, GLuint indx, GLfloat x) { | 684 void VertexAttrib1f(PP_Resource context_id, GLuint indx, GLfloat x) { |
| 808 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 685 GetGLES(context_id)->VertexAttrib1f(indx, x); |
| 809 context->gles2_impl()->VertexAttrib1f(indx, x); | |
| 810 } | 686 } |
| 811 | 687 |
| 812 void VertexAttrib1fv( | 688 void VertexAttrib1fv( |
| 813 PP_Resource context_id, GLuint indx, const GLfloat* values) { | 689 PP_Resource context_id, GLuint indx, const GLfloat* values) { |
| 814 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 690 GetGLES(context_id)->VertexAttrib1fv(indx, values); |
| 815 context->gles2_impl()->VertexAttrib1fv(indx, values); | |
| 816 } | 691 } |
| 817 | 692 |
| 818 void VertexAttrib2f( | 693 void VertexAttrib2f( |
| 819 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y) { | 694 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y) { |
| 820 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 695 GetGLES(context_id)->VertexAttrib2f(indx, x, y); |
| 821 context->gles2_impl()->VertexAttrib2f(indx, x, y); | |
| 822 } | 696 } |
| 823 | 697 |
| 824 void VertexAttrib2fv( | 698 void VertexAttrib2fv( |
| 825 PP_Resource context_id, GLuint indx, const GLfloat* values) { | 699 PP_Resource context_id, GLuint indx, const GLfloat* values) { |
| 826 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 700 GetGLES(context_id)->VertexAttrib2fv(indx, values); |
| 827 context->gles2_impl()->VertexAttrib2fv(indx, values); | |
| 828 } | 701 } |
| 829 | 702 |
| 830 void VertexAttrib3f( | 703 void VertexAttrib3f( |
| 831 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z) { | 704 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z) { |
| 832 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 705 GetGLES(context_id)->VertexAttrib3f(indx, x, y, z); |
| 833 context->gles2_impl()->VertexAttrib3f(indx, x, y, z); | |
| 834 } | 706 } |
| 835 | 707 |
| 836 void VertexAttrib3fv( | 708 void VertexAttrib3fv( |
| 837 PP_Resource context_id, GLuint indx, const GLfloat* values) { | 709 PP_Resource context_id, GLuint indx, const GLfloat* values) { |
| 838 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 710 GetGLES(context_id)->VertexAttrib3fv(indx, values); |
| 839 context->gles2_impl()->VertexAttrib3fv(indx, values); | |
| 840 } | 711 } |
| 841 | 712 |
| 842 void VertexAttrib4f( | 713 void VertexAttrib4f( |
| 843 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z, | 714 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z, |
| 844 GLfloat w) { | 715 GLfloat w) { |
| 845 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 716 GetGLES(context_id)->VertexAttrib4f(indx, x, y, z, w); |
| 846 context->gles2_impl()->VertexAttrib4f(indx, x, y, z, w); | |
| 847 } | 717 } |
| 848 | 718 |
| 849 void VertexAttrib4fv( | 719 void VertexAttrib4fv( |
| 850 PP_Resource context_id, GLuint indx, const GLfloat* values) { | 720 PP_Resource context_id, GLuint indx, const GLfloat* values) { |
| 851 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 721 GetGLES(context_id)->VertexAttrib4fv(indx, values); |
| 852 context->gles2_impl()->VertexAttrib4fv(indx, values); | |
| 853 } | 722 } |
| 854 | 723 |
| 855 void VertexAttribPointer( | 724 void VertexAttribPointer( |
| 856 PP_Resource context_id, GLuint indx, GLint size, GLenum type, | 725 PP_Resource context_id, GLuint indx, GLint size, GLenum type, |
| 857 GLboolean normalized, GLsizei stride, const void* ptr) { | 726 GLboolean normalized, GLsizei stride, const void* ptr) { |
| 858 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 727 GetGLES(context_id)->VertexAttribPointer( |
| 859 context->gles2_impl()->VertexAttribPointer( | |
| 860 indx, size, type, normalized, stride, ptr); | 728 indx, size, type, normalized, stride, ptr); |
| 861 } | 729 } |
| 862 | 730 |
| 863 void Viewport( | 731 void Viewport( |
| 864 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) { | 732 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) { |
| 865 Context3D* context = PluginResource::GetAs<Context3D>(context_id); | 733 GetGLES(context_id)->Viewport(x, y, width, height); |
| 866 context->gles2_impl()->Viewport(x, y, width, height); | |
| 867 } | 734 } |
| 868 | 735 |
| 869 const struct PPB_OpenGLES2_Dev opengles2_interface = { | 736 const struct PPB_OpenGLES2_Dev opengles2_interface = { |
| 870 &ActiveTexture, | 737 &ActiveTexture, |
| 871 &AttachShader, | 738 &AttachShader, |
| 872 &BindAttribLocation, | 739 &BindAttribLocation, |
| 873 &BindBuffer, | 740 &BindBuffer, |
| 874 &BindFramebuffer, | 741 &BindFramebuffer, |
| 875 &BindRenderbuffer, | 742 &BindRenderbuffer, |
| 876 &BindTexture, | 743 &BindTexture, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1038 }; | 905 }; |
| 1039 return &info; | 906 return &info; |
| 1040 } | 907 } |
| 1041 | 908 |
| 1042 bool PPB_OpenGLES2_Proxy::OnMessageReceived(const IPC::Message& msg) { | 909 bool PPB_OpenGLES2_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 1043 return false; | 910 return false; |
| 1044 } | 911 } |
| 1045 | 912 |
| 1046 } // namespace proxy | 913 } // namespace proxy |
| 1047 } // namespace pp | 914 } // namespace pp |
| OLD | NEW |