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) {
file.Write("%s MojoGLES2Impl::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
# TODO(alhaad): Add Mojo C thunk for each of the following methods and
# remove this.
func_list = ["GenQueriesEXT", "BeginQueryEXT", "MapTexSubImage2DCHROMIUM",
"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"]
extensions = ["CHROMIUM_sync_point", "CHROMIUM_texture_mailbox",
"CHROMIUM_sub_image", "CHROMIUM_miscellaneous",
"occlusion_query_EXT"]
if func.IsCoreGLFunction() or func.GetInfo("extension") in extensions:
file.Write("MojoGLES2MakeCurrent(context_);");
func_return = "gl" + func.original_name + "(" + \
......@@ -10055,9 +10044,12 @@ class MojoGLES2Impl : public gpu::gles2::GLES2Interface {
#include "mojo/gpu/mojo_gles2_impl_autogen.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_texture_mailbox.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 {
......
......@@ -11,9 +11,12 @@
#include "mojo/gpu/mojo_gles2_impl_autogen.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_texture_mailbox.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 {
......@@ -762,8 +765,8 @@ void MojoGLES2Impl::ShallowFinishCHROMIUM() {
NOTREACHED() << "Unimplemented ShallowFinishCHROMIUM.";
}
void MojoGLES2Impl::ShallowFlushCHROMIUM() {
return static_cast<gpu::gles2::GLES2Interface*>(
MojoGLES2GetGLES2Interface(context_))->ShallowFlushCHROMIUM();
MojoGLES2MakeCurrent(context_);
glShallowFlushCHROMIUM();
}
void MojoGLES2Impl::OrderingBarrierCHROMIUM() {
NOTREACHED() << "Unimplemented OrderingBarrierCHROMIUM.";
......@@ -1194,41 +1197,40 @@ void MojoGLES2Impl::TexStorage2DEXT(GLenum target,
NOTREACHED() << "Unimplemented TexStorage2DEXT.";
}
void MojoGLES2Impl::GenQueriesEXT(GLsizei n, GLuint* queries) {
return static_cast<gpu::gles2::GLES2Interface*>(
MojoGLES2GetGLES2Interface(context_))->GenQueriesEXT(n, queries);
MojoGLES2MakeCurrent(context_);
glGenQueriesEXT(n, queries);
}
void MojoGLES2Impl::DeleteQueriesEXT(GLsizei n, const GLuint* queries) {
return static_cast<gpu::gles2::GLES2Interface*>(
MojoGLES2GetGLES2Interface(context_))
->DeleteQueriesEXT(n, queries);
MojoGLES2MakeCurrent(context_);
glDeleteQueriesEXT(n, queries);
}
GLboolean MojoGLES2Impl::IsQueryEXT(GLuint id) {
NOTREACHED() << "Unimplemented IsQueryEXT.";
return 0;
MojoGLES2MakeCurrent(context_);
return glIsQueryEXT(id);
}
void MojoGLES2Impl::BeginQueryEXT(GLenum target, GLuint id) {
return static_cast<gpu::gles2::GLES2Interface*>(
MojoGLES2GetGLES2Interface(context_))->BeginQueryEXT(target, id);
MojoGLES2MakeCurrent(context_);
glBeginQueryEXT(target, id);
}
void MojoGLES2Impl::BeginTransformFeedback(GLenum primitivemode) {
NOTREACHED() << "Unimplemented BeginTransformFeedback.";
}
void MojoGLES2Impl::EndQueryEXT(GLenum target) {
return static_cast<gpu::gles2::GLES2Interface*>(
MojoGLES2GetGLES2Interface(context_))->EndQueryEXT(target);
MojoGLES2MakeCurrent(context_);
glEndQueryEXT(target);
}
void MojoGLES2Impl::EndTransformFeedback() {
NOTREACHED() << "Unimplemented EndTransformFeedback.";
}
void MojoGLES2Impl::GetQueryivEXT(GLenum target, GLenum pname, GLint* params) {
NOTREACHED() << "Unimplemented GetQueryivEXT.";
MojoGLES2MakeCurrent(context_);
glGetQueryivEXT(target, pname, params);
}
void MojoGLES2Impl::GetQueryObjectuivEXT(GLuint id,
GLenum pname,
GLuint* params) {
return static_cast<gpu::gles2::GLES2Interface*>(
MojoGLES2GetGLES2Interface(context_))
->GetQueryObjectuivEXT(id, pname, params);
MojoGLES2MakeCurrent(context_);
glGetQueryObjectuivEXT(id, pname, params);
}
void MojoGLES2Impl::InsertEventMarkerEXT(GLsizei length, const GLchar* marker) {
NOTREACHED() << "Unimplemented InsertEventMarkerEXT.";
......@@ -1304,15 +1306,13 @@ void* MojoGLES2Impl::MapTexSubImage2DCHROMIUM(GLenum target,
GLenum format,
GLenum type,
GLenum access) {
return static_cast<gpu::gles2::GLES2Interface*>(
MojoGLES2GetGLES2Interface(context_))
->MapTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width, height,
format, type, access);
MojoGLES2MakeCurrent(context_);
return glMapTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width,
height, format, type, access);
}
void MojoGLES2Impl::UnmapTexSubImage2DCHROMIUM(const void* mem) {
return static_cast<gpu::gles2::GLES2Interface*>(
MojoGLES2GetGLES2Interface(context_))
->UnmapTexSubImage2DCHROMIUM(mem);
MojoGLES2MakeCurrent(context_);
glUnmapTexSubImage2DCHROMIUM(mem);
}
void MojoGLES2Impl::ResizeCHROMIUM(GLuint width,
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