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

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

Issue 2470663003: Revert of command buffer: audit validation of ES3 commands (part 1) (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1c0e9aea451dd6e3a061c77e62b06f28b2b83f42..bd7bed5278f045b9e79c7fbbed2eba291918d3fc 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3535,7 +3535,7 @@
1);
DoGetIntegerv(GL_BIND_GENERATES_RESOURCE_CHROMIUM,
&caps.bind_generates_resource_chromium, 1);
- if (feature_info_->IsWebGL2OrES3Context()) {
+ if (unsafe_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 @@
}
if (feature_info_->feature_flags().multisampled_render_to_texture ||
feature_info_->feature_flags().chromium_framebuffer_multisample ||
- feature_info_->IsWebGL2OrES3Context()) {
+ unsafe_es3_apis_enabled()) {
DoGetIntegerv(GL_MAX_SAMPLES, &caps.max_samples, 1);
}
@@ -6223,7 +6223,7 @@
return true;
}
}
- if (feature_info_->IsWebGL2OrES3Context()) {
+ if (unsafe_es3_apis_enabled()) {
switch (pname) {
case GL_MAX_VARYING_COMPONENTS: {
if (gl_version_info().is_es) {
@@ -6815,7 +6815,7 @@
GLint64* params,
GLsizei params_size) {
DCHECK(params);
- if (feature_info_->IsWebGL2OrES3Context()) {
+ if (unsafe_es3_apis_enabled()) {
switch (pname) {
case GL_MAX_ELEMENT_INDEX: {
DCHECK_EQ(params_size, 1);
@@ -7697,7 +7697,7 @@
const char kFunctionName[] = "glGetFramebufferAttachmentParameteriv";
Framebuffer* framebuffer = GetFramebufferInfoForTarget(target);
if (!framebuffer) {
- if (!feature_info_->IsWebGL2OrES3Context()) {
+ if (!unsafe_es3_apis_enabled()) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
"no framebuffer bound");
return;
@@ -9037,7 +9037,7 @@
const volatile GLfloat* value) {
GLenum type = 0;
GLint real_location = -1;
- if (transpose && !feature_info_->IsWebGL2OrES3Context()) {
+ if (transpose && !unsafe_es3_apis_enabled()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, "glUniformMatrix2fv", "transpose not FALSE");
return;
@@ -9060,7 +9060,7 @@
const volatile GLfloat* value) {
GLenum type = 0;
GLint real_location = -1;
- if (transpose && !feature_info_->IsWebGL2OrES3Context()) {
+ if (transpose && !unsafe_es3_apis_enabled()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, "glUniformMatrix3fv", "transpose not FALSE");
return;
@@ -9083,7 +9083,7 @@
const volatile GLfloat* value) {
GLenum type = 0;
GLint real_location = -1;
- if (transpose && !feature_info_->IsWebGL2OrES3Context()) {
+ if (transpose && !unsafe_es3_apis_enabled()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, "glUniformMatrix4fv", "transpose not FALSE");
return;
@@ -10703,7 +10703,7 @@
error::Error GLES2DecoderImpl::HandleVertexAttribIPointer(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!feature_info_->IsWebGL2OrES3Context())
+ if (!unsafe_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::HandleGetBufferSubDataAsyncCHROMIUM(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!feature_info_->IsWebGL2OrES3Context()) {
+ if (!unsafe_es3_apis_enabled()) {
return error::kUnknownCommand;
}
const volatile gles2::cmds::GetBufferSubDataAsyncCHROMIUM& c =
@@ -11865,7 +11865,7 @@
error::Error GLES2DecoderImpl::HandleGetUniformIndices(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!feature_info_->IsWebGL2OrES3Context())
+ if (!unsafe_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::HandleGetFragDataLocation(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!feature_info_->IsWebGL2OrES3Context())
+ if (!unsafe_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::HandleGetUniformBlockIndex(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
- if (!feature_info_->IsWebGL2OrES3Context())
+ if (!unsafe_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 @@
std::string extensions;
switch (name) {
case GL_VERSION:
- if (feature_info_->IsWebGL2OrES3Context())
+ if (unsafe_es3_apis_enabled())
str = "OpenGL ES 3.0 Chromium";
else
str = "OpenGL ES 2.0 Chromium";
break;
case GL_SHADING_LANGUAGE_VERSION:
- if (feature_info_->IsWebGL2OrES3Context())
+ if (unsafe_es3_apis_enabled())
str = "OpenGL ES GLSL ES 3.0 Chromium";
else
str = "OpenGL ES GLSL ES 1.0 Chromium";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698