summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-26 19:05:20 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-26 19:05:20 +0000
commit94653576aefb53eb73c86e67f4044c4d1bf01221 (patch)
treefa14971f3b30742b05946ab0346c63736fac8168 /ppapi/shared_impl
parent6965d7dcbce91c55c492ff34983a8a3a35f14740 (diff)
downloadchromium_src-94653576aefb53eb73c86e67f4044c4d1bf01221.zip
chromium_src-94653576aefb53eb73c86e67f4044c4d1bf01221.tar.gz
chromium_src-94653576aefb53eb73c86e67f4044c4d1bf01221.tar.bz2
Revert 123696 - Add Pepper support for several GL extensions
Add support to the command buffer code generator to generate multiple pepper interfaces, and use that to generate interfaces for ANGLE_instanced_arrays, ANGLE_framebuffer_blit, ANGLE_framebuffer_multisample, CHROMIUM_enable_feature, and CHROMIUM_map_sub. BUG=93148 TEST= Review URL: https://chromiumcodereview.appspot.com/9420017 TBR=jbauman@chromium.org Review URL: https://chromiumcodereview.appspot.com/9466042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123697 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl')
-rw-r--r--ppapi/shared_impl/ppb_graphics_3d_shared.cc17
-rw-r--r--ppapi/shared_impl/ppb_graphics_3d_shared.h10
-rw-r--r--ppapi/shared_impl/ppb_opengles2_shared.cc396
-rw-r--r--ppapi/shared_impl/ppb_opengles2_shared.h10
4 files changed, 175 insertions, 258 deletions
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
index 2b8b205..13184eb 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
@@ -71,6 +71,23 @@ int32_t PPB_Graphics3D_Shared::SwapBuffers(PP_CompletionCallback callback) {
return DoSwapBuffers();
}
+void* PPB_Graphics3D_Shared::MapTexSubImage2DCHROMIUM(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access) {
+ return gles2_impl_->MapTexSubImage2DCHROMIUM(
+ target, level, xoffset, yoffset, width, height, format, type, access);
+}
+
+void PPB_Graphics3D_Shared::UnmapTexSubImage2DCHROMIUM(const void* mem) {
+ gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem);
+}
+
void PPB_Graphics3D_Shared::SwapBuffersACK(int32_t pp_error) {
DCHECK(HasPendingSwap());
TrackedCallback::ClearAndRun(&swap_callback_, pp_error);
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.h b/ppapi/shared_impl/ppb_graphics_3d_shared.h
index 92a2b20..ee72144 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.h
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.h
@@ -37,6 +37,16 @@ class PPAPI_SHARED_EXPORT PPB_Graphics3D_Shared
virtual int32_t GetError() OVERRIDE;
virtual int32_t ResizeBuffers(int32_t width, int32_t height) OVERRIDE;
virtual int32_t SwapBuffers(PP_CompletionCallback callback) OVERRIDE;
+ virtual void* MapTexSubImage2DCHROMIUM(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access) OVERRIDE;
+ virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) OVERRIDE;
gpu::gles2::GLES2Implementation* gles2_impl() {
return gles2_impl_.get();
diff --git a/ppapi/shared_impl/ppb_opengles2_shared.cc b/ppapi/shared_impl/ppb_opengles2_shared.cc
index 52a297f..635ea41 100644
--- a/ppapi/shared_impl/ppb_opengles2_shared.cc
+++ b/ppapi/shared_impl/ppb_opengles2_shared.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -743,258 +743,156 @@ void Viewport(
GetGLES(context_id)->Viewport(x, y, width, height);
}
-void BlitFramebufferEXT(
- PP_Resource context_id, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask,
- GLenum filter) {
- GetGLES(
- context_id)->BlitFramebufferEXT(
- srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
- filter);
-}
-
-void RenderbufferStorageMultisampleEXT(
- PP_Resource context_id, GLenum target, GLsizei samples,
- GLenum internalformat, GLsizei width, GLsizei height) {
- GetGLES(
- context_id)->RenderbufferStorageMultisampleEXT(
- target, samples, internalformat, width, height);
-}
-GLboolean EnableFeatureCHROMIUM(PP_Resource context_id, const char* feature) {
- return GetGLES(context_id)->EnableFeatureCHROMIUM(feature);
-}
-
-void* MapBufferSubDataCHROMIUM(
- PP_Resource context_id, GLuint target, GLintptr offset, GLsizeiptr size,
- GLenum access) {
- return GetGLES(
- context_id)->MapBufferSubDataCHROMIUM(target, offset, size, access);
-}
-
-void UnmapBufferSubDataCHROMIUM(PP_Resource context_id, const void* mem) {
- GetGLES(context_id)->UnmapBufferSubDataCHROMIUM(mem);
-}
-
-void* MapTexSubImage2DCHROMIUM(
- PP_Resource context_id, GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
- GLenum access) {
- return GetGLES(
- context_id)->MapTexSubImage2DCHROMIUM(
- target, level, xoffset, yoffset, width, height, format, type,
- access);
-}
-
-void UnmapTexSubImage2DCHROMIUM(PP_Resource context_id, const void* mem) {
- GetGLES(context_id)->UnmapTexSubImage2DCHROMIUM(mem);
-}
-
-void DrawArraysInstancedANGLE(
- PP_Resource context_id, GLenum mode, GLint first, GLsizei count,
- GLsizei primcount) {
- GetGLES(context_id)->DrawArraysInstancedANGLE(mode, first, count, primcount);
-}
-
-void DrawElementsInstancedANGLE(
- PP_Resource context_id, GLenum mode, GLsizei count, GLenum type,
- const void* indices, GLsizei primcount) {
- GetGLES(
- context_id)->DrawElementsInstancedANGLE(
- mode, count, type, indices, primcount);
-}
-
-void VertexAttribDivisorANGLE(
- PP_Resource context_id, GLuint index, GLuint divisor) {
- GetGLES(context_id)->VertexAttribDivisorANGLE(index, divisor);
-}
+const struct PPB_OpenGLES2 ppb_opengles2 = {
+ &ActiveTexture,
+ &AttachShader,
+ &BindAttribLocation,
+ &BindBuffer,
+ &BindFramebuffer,
+ &BindRenderbuffer,
+ &BindTexture,
+ &BlendColor,
+ &BlendEquation,
+ &BlendEquationSeparate,
+ &BlendFunc,
+ &BlendFuncSeparate,
+ &BufferData,
+ &BufferSubData,
+ &CheckFramebufferStatus,
+ &Clear,
+ &ClearColor,
+ &ClearDepthf,
+ &ClearStencil,
+ &ColorMask,
+ &CompileShader,
+ &CompressedTexImage2D,
+ &CompressedTexSubImage2D,
+ &CopyTexImage2D,
+ &CopyTexSubImage2D,
+ &CreateProgram,
+ &CreateShader,
+ &CullFace,
+ &DeleteBuffers,
+ &DeleteFramebuffers,
+ &DeleteProgram,
+ &DeleteRenderbuffers,
+ &DeleteShader,
+ &DeleteTextures,
+ &DepthFunc,
+ &DepthMask,
+ &DepthRangef,
+ &DetachShader,
+ &Disable,
+ &DisableVertexAttribArray,
+ &DrawArrays,
+ &DrawElements,
+ &Enable,
+ &EnableVertexAttribArray,
+ &Finish,
+ &Flush,
+ &FramebufferRenderbuffer,
+ &FramebufferTexture2D,
+ &FrontFace,
+ &GenBuffers,
+ &GenerateMipmap,
+ &GenFramebuffers,
+ &GenRenderbuffers,
+ &GenTextures,
+ &GetActiveAttrib,
+ &GetActiveUniform,
+ &GetAttachedShaders,
+ &GetAttribLocation,
+ &GetBooleanv,
+ &GetBufferParameteriv,
+ &GetError,
+ &GetFloatv,
+ &GetFramebufferAttachmentParameteriv,
+ &GetIntegerv,
+ &GetProgramiv,
+ &GetProgramInfoLog,
+ &GetRenderbufferParameteriv,
+ &GetShaderiv,
+ &GetShaderInfoLog,
+ &GetShaderPrecisionFormat,
+ &GetShaderSource,
+ &GetString,
+ &GetTexParameterfv,
+ &GetTexParameteriv,
+ &GetUniformfv,
+ &GetUniformiv,
+ &GetUniformLocation,
+ &GetVertexAttribfv,
+ &GetVertexAttribiv,
+ &GetVertexAttribPointerv,
+ &Hint,
+ &IsBuffer,
+ &IsEnabled,
+ &IsFramebuffer,
+ &IsProgram,
+ &IsRenderbuffer,
+ &IsShader,
+ &IsTexture,
+ &LineWidth,
+ &LinkProgram,
+ &PixelStorei,
+ &PolygonOffset,
+ &ReadPixels,
+ &ReleaseShaderCompiler,
+ &RenderbufferStorage,
+ &SampleCoverage,
+ &Scissor,
+ &ShaderBinary,
+ &ShaderSource,
+ &StencilFunc,
+ &StencilFuncSeparate,
+ &StencilMask,
+ &StencilMaskSeparate,
+ &StencilOp,
+ &StencilOpSeparate,
+ &TexImage2D,
+ &TexParameterf,
+ &TexParameterfv,
+ &TexParameteri,
+ &TexParameteriv,
+ &TexSubImage2D,
+ &Uniform1f,
+ &Uniform1fv,
+ &Uniform1i,
+ &Uniform1iv,
+ &Uniform2f,
+ &Uniform2fv,
+ &Uniform2i,
+ &Uniform2iv,
+ &Uniform3f,
+ &Uniform3fv,
+ &Uniform3i,
+ &Uniform3iv,
+ &Uniform4f,
+ &Uniform4fv,
+ &Uniform4i,
+ &Uniform4iv,
+ &UniformMatrix2fv,
+ &UniformMatrix3fv,
+ &UniformMatrix4fv,
+ &UseProgram,
+ &ValidateProgram,
+ &VertexAttrib1f,
+ &VertexAttrib1fv,
+ &VertexAttrib2f,
+ &VertexAttrib2fv,
+ &VertexAttrib3f,
+ &VertexAttrib3fv,
+ &VertexAttrib4f,
+ &VertexAttrib4fv,
+ &VertexAttribPointer,
+ &Viewport
+};
} // namespace
+
const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() {
- static const struct PPB_OpenGLES2 ppb_opengles2 = {
- &ActiveTexture,
- &AttachShader,
- &BindAttribLocation,
- &BindBuffer,
- &BindFramebuffer,
- &BindRenderbuffer,
- &BindTexture,
- &BlendColor,
- &BlendEquation,
- &BlendEquationSeparate,
- &BlendFunc,
- &BlendFuncSeparate,
- &BufferData,
- &BufferSubData,
- &CheckFramebufferStatus,
- &Clear,
- &ClearColor,
- &ClearDepthf,
- &ClearStencil,
- &ColorMask,
- &CompileShader,
- &CompressedTexImage2D,
- &CompressedTexSubImage2D,
- &CopyTexImage2D,
- &CopyTexSubImage2D,
- &CreateProgram,
- &CreateShader,
- &CullFace,
- &DeleteBuffers,
- &DeleteFramebuffers,
- &DeleteProgram,
- &DeleteRenderbuffers,
- &DeleteShader,
- &DeleteTextures,
- &DepthFunc,
- &DepthMask,
- &DepthRangef,
- &DetachShader,
- &Disable,
- &DisableVertexAttribArray,
- &DrawArrays,
- &DrawElements,
- &Enable,
- &EnableVertexAttribArray,
- &Finish,
- &Flush,
- &FramebufferRenderbuffer,
- &FramebufferTexture2D,
- &FrontFace,
- &GenBuffers,
- &GenerateMipmap,
- &GenFramebuffers,
- &GenRenderbuffers,
- &GenTextures,
- &GetActiveAttrib,
- &GetActiveUniform,
- &GetAttachedShaders,
- &GetAttribLocation,
- &GetBooleanv,
- &GetBufferParameteriv,
- &GetError,
- &GetFloatv,
- &GetFramebufferAttachmentParameteriv,
- &GetIntegerv,
- &GetProgramiv,
- &GetProgramInfoLog,
- &GetRenderbufferParameteriv,
- &GetShaderiv,
- &GetShaderInfoLog,
- &GetShaderPrecisionFormat,
- &GetShaderSource,
- &GetString,
- &GetTexParameterfv,
- &GetTexParameteriv,
- &GetUniformfv,
- &GetUniformiv,
- &GetUniformLocation,
- &GetVertexAttribfv,
- &GetVertexAttribiv,
- &GetVertexAttribPointerv,
- &Hint,
- &IsBuffer,
- &IsEnabled,
- &IsFramebuffer,
- &IsProgram,
- &IsRenderbuffer,
- &IsShader,
- &IsTexture,
- &LineWidth,
- &LinkProgram,
- &PixelStorei,
- &PolygonOffset,
- &ReadPixels,
- &ReleaseShaderCompiler,
- &RenderbufferStorage,
- &SampleCoverage,
- &Scissor,
- &ShaderBinary,
- &ShaderSource,
- &StencilFunc,
- &StencilFuncSeparate,
- &StencilMask,
- &StencilMaskSeparate,
- &StencilOp,
- &StencilOpSeparate,
- &TexImage2D,
- &TexParameterf,
- &TexParameterfv,
- &TexParameteri,
- &TexParameteriv,
- &TexSubImage2D,
- &Uniform1f,
- &Uniform1fv,
- &Uniform1i,
- &Uniform1iv,
- &Uniform2f,
- &Uniform2fv,
- &Uniform2i,
- &Uniform2iv,
- &Uniform3f,
- &Uniform3fv,
- &Uniform3i,
- &Uniform3iv,
- &Uniform4f,
- &Uniform4fv,
- &Uniform4i,
- &Uniform4iv,
- &UniformMatrix2fv,
- &UniformMatrix3fv,
- &UniformMatrix4fv,
- &UseProgram,
- &ValidateProgram,
- &VertexAttrib1f,
- &VertexAttrib1fv,
- &VertexAttrib2f,
- &VertexAttrib2fv,
- &VertexAttrib3f,
- &VertexAttrib3fv,
- &VertexAttrib4f,
- &VertexAttrib4fv,
- &VertexAttribPointer,
- &Viewport
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2InstancedArrays_Dev*
- PPB_OpenGLES2_Shared::GetInstancedArraysInterface() {
- static const struct PPB_OpenGLES2InstancedArrays_Dev ppb_opengles2 = {
- &DrawArraysInstancedANGLE,
- &DrawElementsInstancedANGLE,
- &VertexAttribDivisorANGLE
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2FramebufferBlit_Dev*
- PPB_OpenGLES2_Shared::GetFramebufferBlitInterface() {
- static const struct PPB_OpenGLES2FramebufferBlit_Dev ppb_opengles2 = {
- &BlitFramebufferEXT
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2FramebufferMultisample_Dev*
- PPB_OpenGLES2_Shared::GetFramebufferMultisampleInterface() {
- static const struct PPB_OpenGLES2FramebufferMultisample_Dev ppb_opengles2 = {
- &RenderbufferStorageMultisampleEXT
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2ChromiumEnableFeature_Dev*
- PPB_OpenGLES2_Shared::GetChromiumEnableFeatureInterface() {
- static const struct PPB_OpenGLES2ChromiumEnableFeature_Dev ppb_opengles2 = {
- &EnableFeatureCHROMIUM
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2ChromiumMapSub_Dev*
- PPB_OpenGLES2_Shared::GetChromiumMapSubInterface() {
- static const struct PPB_OpenGLES2ChromiumMapSub_Dev ppb_opengles2 = {
- &MapBufferSubDataCHROMIUM,
- &UnmapBufferSubDataCHROMIUM,
- &MapTexSubImage2DCHROMIUM,
- &UnmapTexSubImage2DCHROMIUM
- };
return &ppb_opengles2;
}
+
} // namespace ppapi
diff --git a/ppapi/shared_impl/ppb_opengles2_shared.h b/ppapi/shared_impl/ppb_opengles2_shared.h
index 672133c..2b4c9f9 100644
--- a/ppapi/shared_impl/ppb_opengles2_shared.h
+++ b/ppapi/shared_impl/ppb_opengles2_shared.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,7 +6,6 @@
#define PPAPI_SHARED_IMPL_PPB_OPENGLES2_SHARED_H_
#include "ppapi/c/ppb_opengles2.h"
-#include "ppapi/c/dev/ppb_opengles2ext_dev.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
namespace ppapi {
@@ -14,13 +13,6 @@ namespace ppapi {
class PPAPI_SHARED_EXPORT PPB_OpenGLES2_Shared {
public:
static const PPB_OpenGLES2* GetInterface();
- static const PPB_OpenGLES2InstancedArrays_Dev* GetInstancedArraysInterface();
- static const PPB_OpenGLES2FramebufferBlit_Dev* GetFramebufferBlitInterface();
- static const PPB_OpenGLES2FramebufferMultisample_Dev*
- GetFramebufferMultisampleInterface();
- static const PPB_OpenGLES2ChromiumEnableFeature_Dev*
- GetChromiumEnableFeatureInterface();
- static const PPB_OpenGLES2ChromiumMapSub_Dev* GetChromiumMapSubInterface();
};
} // namespace ppapi