Commit 36152635 authored by alhaad's avatar alhaad Committed by Commit bot

Remove all usages of MojoGLES2GetGLES2Interface().

All html_viewer entry points now have Mojo C thunks.

R=piman@chromium.org
BUG=453591

Review URL: https://codereview.chromium.org/1035813002

Cr-Commit-Position: refs/heads/master@{#322275}
parent e6281120
...@@ -4220,20 +4220,9 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { ...@@ -4220,20 +4220,9 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
file.Write("%s MojoGLES2Impl::%s(%s) {\n" % file.Write("%s MojoGLES2Impl::%s(%s) {\n" %
(func.return_type, func.original_name, (func.return_type, func.original_name,
func.MakeTypedOriginalArgString(""))) func.MakeTypedOriginalArgString("")))
# TODO(alhaad): Add Mojo C thunk for each of the following methods and extensions = ["CHROMIUM_sync_point", "CHROMIUM_texture_mailbox",
# remove this. "CHROMIUM_sub_image", "CHROMIUM_miscellaneous",
func_list = ["GenQueriesEXT", "BeginQueryEXT", "MapTexSubImage2DCHROMIUM", "occlusion_query_EXT"]
"UnmapTexSubImage2DCHROMIUM", "DeleteQueriesEXT",
"EndQueryEXT", "GetQueryObjectuivEXT", "ShallowFlushCHROMIUM"]
if func.original_name in func_list:
file.Write("return static_cast<gpu::gles2::GLES2Interface*>"
"(MojoGLES2GetGLES2Interface(context_))->" +
func.original_name + "(" + func.MakeOriginalArgString("") +
");")
file.Write("}")
return
extensions = ["CHROMIUM_sync_point", "CHROMIUM_texture_mailbox"]
if func.IsCoreGLFunction() or func.GetInfo("extension") in extensions: if func.IsCoreGLFunction() or func.GetInfo("extension") in extensions:
file.Write("MojoGLES2MakeCurrent(context_);"); file.Write("MojoGLES2MakeCurrent(context_);");
func_return = "gl" + func.original_name + "(" + \ func_return = "gl" + func.original_name + "(" + \
...@@ -10055,9 +10044,12 @@ class MojoGLES2Impl : public gpu::gles2::GLES2Interface { ...@@ -10055,9 +10044,12 @@ class MojoGLES2Impl : public gpu::gles2::GLES2Interface {
#include "mojo/gpu/mojo_gles2_impl_autogen.h" #include "mojo/gpu/mojo_gles2_impl_autogen.h"
#include "base/logging.h" #include "base/logging.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_miscellaneous.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_sub_image.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_sync_point.h" #include "third_party/mojo/src/mojo/public/c/gles2/chromium_sync_point.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_texture_mailbox.h" #include "third_party/mojo/src/mojo/public/c/gles2/chromium_texture_mailbox.h"
#include "third_party/mojo/src/mojo/public/c/gles2/gles2.h" #include "third_party/mojo/src/mojo/public/c/gles2/gles2.h"
#include "third_party/mojo/src/mojo/public/c/gles2/occlusion_query_ext.h"
namespace mojo { namespace mojo {
......
...@@ -11,9 +11,12 @@ ...@@ -11,9 +11,12 @@
#include "mojo/gpu/mojo_gles2_impl_autogen.h" #include "mojo/gpu/mojo_gles2_impl_autogen.h"
#include "base/logging.h" #include "base/logging.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_miscellaneous.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_sub_image.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_sync_point.h" #include "third_party/mojo/src/mojo/public/c/gles2/chromium_sync_point.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_texture_mailbox.h" #include "third_party/mojo/src/mojo/public/c/gles2/chromium_texture_mailbox.h"
#include "third_party/mojo/src/mojo/public/c/gles2/gles2.h" #include "third_party/mojo/src/mojo/public/c/gles2/gles2.h"
#include "third_party/mojo/src/mojo/public/c/gles2/occlusion_query_ext.h"
namespace mojo { namespace mojo {
...@@ -762,8 +765,8 @@ void MojoGLES2Impl::ShallowFinishCHROMIUM() { ...@@ -762,8 +765,8 @@ void MojoGLES2Impl::ShallowFinishCHROMIUM() {
NOTREACHED() << "Unimplemented ShallowFinishCHROMIUM."; NOTREACHED() << "Unimplemented ShallowFinishCHROMIUM.";
} }
void MojoGLES2Impl::ShallowFlushCHROMIUM() { void MojoGLES2Impl::ShallowFlushCHROMIUM() {
return static_cast<gpu::gles2::GLES2Interface*>( MojoGLES2MakeCurrent(context_);
MojoGLES2GetGLES2Interface(context_))->ShallowFlushCHROMIUM(); glShallowFlushCHROMIUM();
} }
void MojoGLES2Impl::OrderingBarrierCHROMIUM() { void MojoGLES2Impl::OrderingBarrierCHROMIUM() {
NOTREACHED() << "Unimplemented OrderingBarrierCHROMIUM."; NOTREACHED() << "Unimplemented OrderingBarrierCHROMIUM.";
...@@ -1194,41 +1197,40 @@ void MojoGLES2Impl::TexStorage2DEXT(GLenum target, ...@@ -1194,41 +1197,40 @@ void MojoGLES2Impl::TexStorage2DEXT(GLenum target,
NOTREACHED() << "Unimplemented TexStorage2DEXT."; NOTREACHED() << "Unimplemented TexStorage2DEXT.";
} }
void MojoGLES2Impl::GenQueriesEXT(GLsizei n, GLuint* queries) { void MojoGLES2Impl::GenQueriesEXT(GLsizei n, GLuint* queries) {
return static_cast<gpu::gles2::GLES2Interface*>( MojoGLES2MakeCurrent(context_);
MojoGLES2GetGLES2Interface(context_))->GenQueriesEXT(n, queries); glGenQueriesEXT(n, queries);
} }
void MojoGLES2Impl::DeleteQueriesEXT(GLsizei n, const GLuint* queries) { void MojoGLES2Impl::DeleteQueriesEXT(GLsizei n, const GLuint* queries) {
return static_cast<gpu::gles2::GLES2Interface*>( MojoGLES2MakeCurrent(context_);
MojoGLES2GetGLES2Interface(context_)) glDeleteQueriesEXT(n, queries);
->DeleteQueriesEXT(n, queries);
} }
GLboolean MojoGLES2Impl::IsQueryEXT(GLuint id) { GLboolean MojoGLES2Impl::IsQueryEXT(GLuint id) {
NOTREACHED() << "Unimplemented IsQueryEXT."; MojoGLES2MakeCurrent(context_);
return 0; return glIsQueryEXT(id);
} }
void MojoGLES2Impl::BeginQueryEXT(GLenum target, GLuint id) { void MojoGLES2Impl::BeginQueryEXT(GLenum target, GLuint id) {
return static_cast<gpu::gles2::GLES2Interface*>( MojoGLES2MakeCurrent(context_);
MojoGLES2GetGLES2Interface(context_))->BeginQueryEXT(target, id); glBeginQueryEXT(target, id);
} }
void MojoGLES2Impl::BeginTransformFeedback(GLenum primitivemode) { void MojoGLES2Impl::BeginTransformFeedback(GLenum primitivemode) {
NOTREACHED() << "Unimplemented BeginTransformFeedback."; NOTREACHED() << "Unimplemented BeginTransformFeedback.";
} }
void MojoGLES2Impl::EndQueryEXT(GLenum target) { void MojoGLES2Impl::EndQueryEXT(GLenum target) {
return static_cast<gpu::gles2::GLES2Interface*>( MojoGLES2MakeCurrent(context_);
MojoGLES2GetGLES2Interface(context_))->EndQueryEXT(target); glEndQueryEXT(target);
} }
void MojoGLES2Impl::EndTransformFeedback() { void MojoGLES2Impl::EndTransformFeedback() {
NOTREACHED() << "Unimplemented EndTransformFeedback."; NOTREACHED() << "Unimplemented EndTransformFeedback.";
} }
void MojoGLES2Impl::GetQueryivEXT(GLenum target, GLenum pname, GLint* params) { void MojoGLES2Impl::GetQueryivEXT(GLenum target, GLenum pname, GLint* params) {
NOTREACHED() << "Unimplemented GetQueryivEXT."; MojoGLES2MakeCurrent(context_);
glGetQueryivEXT(target, pname, params);
} }
void MojoGLES2Impl::GetQueryObjectuivEXT(GLuint id, void MojoGLES2Impl::GetQueryObjectuivEXT(GLuint id,
GLenum pname, GLenum pname,
GLuint* params) { GLuint* params) {
return static_cast<gpu::gles2::GLES2Interface*>( MojoGLES2MakeCurrent(context_);
MojoGLES2GetGLES2Interface(context_)) glGetQueryObjectuivEXT(id, pname, params);
->GetQueryObjectuivEXT(id, pname, params);
} }
void MojoGLES2Impl::InsertEventMarkerEXT(GLsizei length, const GLchar* marker) { void MojoGLES2Impl::InsertEventMarkerEXT(GLsizei length, const GLchar* marker) {
NOTREACHED() << "Unimplemented InsertEventMarkerEXT."; NOTREACHED() << "Unimplemented InsertEventMarkerEXT.";
...@@ -1304,15 +1306,13 @@ void* MojoGLES2Impl::MapTexSubImage2DCHROMIUM(GLenum target, ...@@ -1304,15 +1306,13 @@ void* MojoGLES2Impl::MapTexSubImage2DCHROMIUM(GLenum target,
GLenum format, GLenum format,
GLenum type, GLenum type,
GLenum access) { GLenum access) {
return static_cast<gpu::gles2::GLES2Interface*>( MojoGLES2MakeCurrent(context_);
MojoGLES2GetGLES2Interface(context_)) return glMapTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width,
->MapTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width, height, height, format, type, access);
format, type, access);
} }
void MojoGLES2Impl::UnmapTexSubImage2DCHROMIUM(const void* mem) { void MojoGLES2Impl::UnmapTexSubImage2DCHROMIUM(const void* mem) {
return static_cast<gpu::gles2::GLES2Interface*>( MojoGLES2MakeCurrent(context_);
MojoGLES2GetGLES2Interface(context_)) glUnmapTexSubImage2DCHROMIUM(mem);
->UnmapTexSubImage2DCHROMIUM(mem);
} }
void MojoGLES2Impl::ResizeCHROMIUM(GLuint width, void MojoGLES2Impl::ResizeCHROMIUM(GLuint width,
GLuint height, GLuint height,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment