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

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: remove runtime flag unsafeES3APIs from blink webgl module 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 1a3618342c873b69c496fa5ea82b2f561917922b..0a7878e2ccfb1db12b1cfc4f5a2a6d4c94fb660a 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() {
@@ -3117,7 +3117,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;
@@ -3556,7 +3556,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);
@@ -3618,7 +3618,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);
}
@@ -6244,7 +6244,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) {
@@ -6836,7 +6836,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);
@@ -7718,7 +7718,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;
@@ -9058,7 +9058,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;
@@ -9081,7 +9081,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;
@@ -9104,7 +9104,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;
@@ -10724,7 +10724,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);
@@ -11784,7 +11784,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 =
@@ -11886,7 +11886,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);
@@ -11967,7 +11967,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);
@@ -12035,7 +12035,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);
@@ -12079,13 +12079,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";
@@ -13402,7 +13402,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";
@@ -14164,7 +14164,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";
@@ -14380,7 +14380,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 =
@@ -14557,7 +14557,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*>(
@@ -14616,7 +14616,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*>(
@@ -14671,7 +14671,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);
@@ -15115,7 +15115,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*>(
@@ -15136,7 +15136,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*>(
@@ -15157,7 +15157,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*>(
@@ -15217,7 +15217,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<
@@ -17034,7 +17034,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);
@@ -17065,7 +17065,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);
@@ -17114,7 +17114,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);
@@ -17154,7 +17154,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);
@@ -17248,7 +17248,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;
}
@@ -17359,7 +17359,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";

Powered by Google App Engine
This is Rietveld 408576698