Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2444813002: Remove unsafe mode to enable es3 api by default for WebGL2 and ES3 context (Closed)
Patch Set: fix a bug Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index bd7bed5278f045b9e79c7fbbed2eba291918d3fc..8fd39902ebd3672fac5fe4a2d3d203213a02823d 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -479,7 +479,7 @@ GLES2Decoder::GLES2Decoder()
: initialized_(false),
debug_(false),
log_commands_(false),
- unsafe_es3_apis_enabled_(false) {
+ es3_apis_enabled_(false) {
}
GLES2Decoder::~GLES2Decoder() {
@@ -3096,7 +3096,7 @@ bool GLES2DecoderImpl::Initialize(
return false;
}
feature_info_->EnableES3Validators();
- set_unsafe_es3_apis_enabled(true);
+ set_es3_apis_enabled(true);
frag_depth_explicitly_enabled_ = true;
draw_buffers_explicitly_enabled_ = true;
@@ -3535,7 +3535,7 @@ Capabilities GLES2DecoderImpl::GetCapabilities() {
1);
DoGetIntegerv(GL_BIND_GENERATES_RESOURCE_CHROMIUM,
&caps.bind_generates_resource_chromium, 1);
- if (unsafe_es3_apis_enabled()) {
+ if (es3_apis_enabled()) {
// TODO(zmo): Note that some parameter values could be more than 32-bit,
// but for now we clamp them to 32-bit max.
DoGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &caps.max_3d_texture_size, 1);
@@ -3597,7 +3597,7 @@ Capabilities GLES2DecoderImpl::GetCapabilities() {
}
if (feature_info_->feature_flags().multisampled_render_to_texture ||
feature_info_->feature_flags().chromium_framebuffer_multisample ||
- unsafe_es3_apis_enabled()) {
+ es3_apis_enabled()) {
DoGetIntegerv(GL_MAX_SAMPLES, &caps.max_samples, 1);
}
@@ -6223,7 +6223,7 @@ bool GLES2DecoderImpl::GetHelper(
return true;
}
}
- if (unsafe_es3_apis_enabled()) {
+ if (es3_apis_enabled()) {
switch (pname) {
case GL_MAX_VARYING_COMPONENTS: {
if (gl_version_info().is_es) {
@@ -6815,7 +6815,7 @@ void GLES2DecoderImpl::DoGetInteger64v(GLenum pname,
GLint64* params,
GLsizei params_size) {
DCHECK(params);
- if (unsafe_es3_apis_enabled()) {
+ if (es3_apis_enabled()) {
switch (pname) {
case GL_MAX_ELEMENT_INDEX: {
DCHECK_EQ(params_size, 1);
@@ -7697,7 +7697,7 @@ void GLES2DecoderImpl::DoGetFramebufferAttachmentParameteriv(
const char kFunctionName[] = "glGetFramebufferAttachmentParameteriv";
Framebuffer* framebuffer = GetFramebufferInfoForTarget(target);
if (!framebuffer) {
- if (!unsafe_es3_apis_enabled()) {
+ if (!es3_apis_enabled()) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
"no framebuffer bound");
return;
@@ -9037,7 +9037,7 @@ void GLES2DecoderImpl::DoUniformMatrix2fv(GLint fake_location,
const volatile GLfloat* value) {
GLenum type = 0;
GLint real_location = -1;
- if (transpose && !unsafe_es3_apis_enabled()) {
+ if (transpose && !es3_apis_enabled()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, "glUniformMatrix2fv", "transpose not FALSE");
return;
@@ -9060,7 +9060,7 @@ void GLES2DecoderImpl::DoUniformMatrix3fv(GLint fake_location,
const volatile GLfloat* value) {
GLenum type = 0;
GLint real_location = -1;
- if (transpose && !unsafe_es3_apis_enabled()) {
+ if (transpose && !es3_apis_enabled()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, "glUniformMatrix3fv", "transpose not FALSE");
return;
@@ -9083,7 +9083,7 @@ void GLES2DecoderImpl::DoUniformMatrix4fv(GLint fake_location,
const volatile GLfloat* value) {
GLenum type = 0;
GLint real_location = -1;
- if (transpose && !unsafe_es3_apis_enabled()) {
+ if (transpose && !es3_apis_enabled()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, "glUniformMatrix4fv", "transpose not FALSE");
return;
@@ -10703,7 +10703,7 @@ void GLES2DecoderImpl::DoVertexAttribI4uiv(GLuint index,
error::Error GLES2DecoderImpl::HandleVertexAttribIPointer(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::VertexAttribIPointer& c =
*static_cast<const volatile gles2::cmds::VertexAttribIPointer*>(cmd_data);
@@ -11763,7 +11763,7 @@ error::Error GLES2DecoderImpl::HandleGetAttribLocation(
error::Error GLES2DecoderImpl::HandleGetBufferSubDataAsyncCHROMIUM(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled()) {
+ if (!es3_apis_enabled()) {
return error::kUnknownCommand;
}
const volatile gles2::cmds::GetBufferSubDataAsyncCHROMIUM& c =
@@ -11865,7 +11865,7 @@ error::Error GLES2DecoderImpl::HandleGetUniformLocation(
error::Error GLES2DecoderImpl::HandleGetUniformIndices(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetUniformIndices& c =
*static_cast<const volatile gles2::cmds::GetUniformIndices*>(cmd_data);
@@ -11946,7 +11946,7 @@ error::Error GLES2DecoderImpl::GetFragDataLocationHelper(
error::Error GLES2DecoderImpl::HandleGetFragDataLocation(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetFragDataLocation& c =
*static_cast<const volatile gles2::cmds::GetFragDataLocation*>(cmd_data);
@@ -12014,7 +12014,7 @@ error::Error GLES2DecoderImpl::HandleGetFragDataIndexEXT(
error::Error GLES2DecoderImpl::HandleGetUniformBlockIndex(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetUniformBlockIndex& c =
*static_cast<const volatile gles2::cmds::GetUniformBlockIndex*>(cmd_data);
@@ -12058,13 +12058,13 @@ error::Error GLES2DecoderImpl::HandleGetString(uint32_t immediate_data_size,
std::string extensions;
switch (name) {
case GL_VERSION:
- if (unsafe_es3_apis_enabled())
+ if (es3_apis_enabled())
str = "OpenGL ES 3.0 Chromium";
else
str = "OpenGL ES 2.0 Chromium";
break;
case GL_SHADING_LANGUAGE_VERSION:
- if (unsafe_es3_apis_enabled())
+ if (es3_apis_enabled())
str = "OpenGL ES GLSL ES 3.0 Chromium";
else
str = "OpenGL ES GLSL ES 1.0 Chromium";
@@ -13076,7 +13076,7 @@ error::Error GLES2DecoderImpl::HandleCompressedTexImage2D(
error::Error GLES2DecoderImpl::HandleCompressedTexImage3DBucket(
uint32_t immediate_data_size, const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::CompressedTexImage3DBucket& c =
*static_cast<const volatile gles2::cmds::CompressedTexImage3DBucket*>(
@@ -13106,7 +13106,7 @@ error::Error GLES2DecoderImpl::HandleCompressedTexImage3DBucket(
error::Error GLES2DecoderImpl::HandleCompressedTexImage3D(
uint32_t immediate_data_size, const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::CompressedTexImage3D& c =
*static_cast<const volatile gles2::cmds::CompressedTexImage3D*>(cmd_data);
@@ -13141,7 +13141,7 @@ error::Error GLES2DecoderImpl::HandleCompressedTexImage3D(
error::Error GLES2DecoderImpl::HandleCompressedTexSubImage3DBucket(
uint32_t immediate_data_size, const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::CompressedTexSubImage3DBucket& c =
*static_cast<const volatile gles2::cmds::CompressedTexSubImage3DBucket*>(
@@ -13173,7 +13173,7 @@ error::Error GLES2DecoderImpl::HandleCompressedTexSubImage3DBucket(
error::Error GLES2DecoderImpl::HandleCompressedTexSubImage3D(
uint32_t immediate_data_size, const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::CompressedTexSubImage3D& c =
*static_cast<const volatile gles2::cmds::CompressedTexSubImage3D*>(
@@ -13422,7 +13422,7 @@ error::Error GLES2DecoderImpl::HandleTexImage2D(uint32_t immediate_data_size,
error::Error GLES2DecoderImpl::HandleTexImage3D(uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const char* func_name = "glTexImage3D";
@@ -14264,7 +14264,7 @@ error::Error GLES2DecoderImpl::HandleTexSubImage2D(
error::Error GLES2DecoderImpl::HandleTexSubImage3D(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const char* func_name = "glTexSubImage3D";
@@ -14480,7 +14480,7 @@ error::Error GLES2DecoderImpl::HandleGetUniformiv(
error::Error GLES2DecoderImpl::HandleGetUniformuiv(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetUniformuiv& c =
@@ -14657,7 +14657,7 @@ error::Error GLES2DecoderImpl::HandleGetActiveUniform(
error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockiv(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetActiveUniformBlockiv& c =
*static_cast<const volatile gles2::cmds::GetActiveUniformBlockiv*>(
@@ -14716,7 +14716,7 @@ error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockiv(
error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockName(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetActiveUniformBlockName& c =
*static_cast<const volatile gles2::cmds::GetActiveUniformBlockName*>(
@@ -14771,7 +14771,7 @@ error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockName(
error::Error GLES2DecoderImpl::HandleGetActiveUniformsiv(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetActiveUniformsiv& c =
*static_cast<const volatile gles2::cmds::GetActiveUniformsiv*>(cmd_data);
@@ -15215,7 +15215,7 @@ error::Error GLES2DecoderImpl::HandleGetProgramInfoCHROMIUM(
error::Error GLES2DecoderImpl::HandleGetUniformBlocksCHROMIUM(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetUniformBlocksCHROMIUM& c =
*static_cast<const volatile gles2::cmds::GetUniformBlocksCHROMIUM*>(
@@ -15236,7 +15236,7 @@ error::Error GLES2DecoderImpl::HandleGetUniformBlocksCHROMIUM(
error::Error GLES2DecoderImpl::HandleGetUniformsES3CHROMIUM(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetUniformsES3CHROMIUM& c =
*static_cast<const volatile gles2::cmds::GetUniformsES3CHROMIUM*>(
@@ -15257,7 +15257,7 @@ error::Error GLES2DecoderImpl::HandleGetUniformsES3CHROMIUM(
error::Error GLES2DecoderImpl::HandleGetTransformFeedbackVarying(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetTransformFeedbackVarying& c =
*static_cast<const volatile gles2::cmds::GetTransformFeedbackVarying*>(
@@ -15317,7 +15317,7 @@ error::Error GLES2DecoderImpl::HandleGetTransformFeedbackVarying(
error::Error GLES2DecoderImpl::HandleGetTransformFeedbackVaryingsCHROMIUM(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetTransformFeedbackVaryingsCHROMIUM& c =
*static_cast<
@@ -17146,7 +17146,7 @@ error::Error GLES2DecoderImpl::HandleUniformBlockBinding(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
const char* func_name = "glUniformBlockBinding";
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::UniformBlockBinding& c =
*static_cast<const volatile gles2::cmds::UniformBlockBinding*>(cmd_data);
@@ -17177,7 +17177,7 @@ error::Error GLES2DecoderImpl::HandleClientWaitSync(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
const char* function_name = "glClientWaitSync";
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::ClientWaitSync& c =
*static_cast<const volatile gles2::cmds::ClientWaitSync*>(cmd_data);
@@ -17226,7 +17226,7 @@ error::Error GLES2DecoderImpl::HandleClientWaitSync(
error::Error GLES2DecoderImpl::HandleWaitSync(uint32_t immediate_data_size,
const volatile void* cmd_data) {
const char* function_name = "glWaitSync";
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::WaitSync& c =
*static_cast<const volatile gles2::cmds::WaitSync*>(cmd_data);
@@ -17266,7 +17266,7 @@ GLsync GLES2DecoderImpl::DoFenceSync(GLenum condition, GLbitfield flags) {
error::Error GLES2DecoderImpl::HandleGetInternalformativ(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled())
+ if (!es3_apis_enabled())
return error::kUnknownCommand;
const volatile gles2::cmds::GetInternalformativ& c =
*static_cast<const volatile gles2::cmds::GetInternalformativ*>(cmd_data);
@@ -17360,7 +17360,7 @@ error::Error GLES2DecoderImpl::HandleGetInternalformativ(
error::Error GLES2DecoderImpl::HandleMapBufferRange(
uint32_t immediate_data_size, const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled()) {
+ if (!es3_apis_enabled()) {
return error::kUnknownCommand;
}
@@ -17471,7 +17471,7 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange(
error::Error GLES2DecoderImpl::HandleUnmapBuffer(
uint32_t immediate_data_size, const volatile void* cmd_data) {
- if (!unsafe_es3_apis_enabled()) {
+ if (!es3_apis_enabled()) {
return error::kUnknownCommand;
}
const char* func_name = "glUnmapBuffer";
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698