| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 GLint layer); | 1291 GLint layer); |
| 1292 | 1292 |
| 1293 // Check if a framebuffer meets our requirements. | 1293 // Check if a framebuffer meets our requirements. |
| 1294 // Generates |gl_error| if the framebuffer is incomplete. | 1294 // Generates |gl_error| if the framebuffer is incomplete. |
| 1295 bool CheckFramebufferValid( | 1295 bool CheckFramebufferValid( |
| 1296 Framebuffer* framebuffer, | 1296 Framebuffer* framebuffer, |
| 1297 GLenum target, | 1297 GLenum target, |
| 1298 GLenum gl_error, | 1298 GLenum gl_error, |
| 1299 const char* func_name); | 1299 const char* func_name); |
| 1300 | 1300 |
| 1301 bool CheckBoundDrawFramebufferValid(const char* func_name); | 1301 bool CheckBoundDrawFramebufferValid( |
| 1302 const char* func_name, |
| 1303 bool may_need_workaround); |
| 1302 // Generates |gl_error| if the bound read fbo is incomplete. | 1304 // Generates |gl_error| if the bound read fbo is incomplete. |
| 1303 bool CheckBoundReadFramebufferValid(const char* func_name, GLenum gl_error); | 1305 bool CheckBoundReadFramebufferValid( |
| 1306 const char* func_name, |
| 1307 GLenum gl_error, |
| 1308 bool may_need_workaround); |
| 1304 // This is only used by DoBlitFramebufferCHROMIUM which operates read/draw | 1309 // This is only used by DoBlitFramebufferCHROMIUM which operates read/draw |
| 1305 // framebuffer at the same time. | 1310 // framebuffer at the same time. |
| 1306 bool CheckBoundFramebufferValid(const char* func_name); | 1311 bool CheckBoundFramebufferValid(const char* func_name); |
| 1307 | 1312 |
| 1308 // Checks if the current program exists and is valid. If not generates the | 1313 // Checks if the current program exists and is valid. If not generates the |
| 1309 // appropriate GL error. Returns true if the current program is in a usable | 1314 // appropriate GL error. Returns true if the current program is in a usable |
| 1310 // state. | 1315 // state. |
| 1311 bool CheckCurrentProgram(const char* function_name); | 1316 bool CheckCurrentProgram(const char* function_name); |
| 1312 | 1317 |
| 1313 // Checks if the current program exists and is valid and that location is not | 1318 // Checks if the current program exists and is valid and that location is not |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1424 // Wrapper for glBlitFramebufferCHROMIUM. | 1429 // Wrapper for glBlitFramebufferCHROMIUM. |
| 1425 void DoBlitFramebufferCHROMIUM( | 1430 void DoBlitFramebufferCHROMIUM( |
| 1426 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, | 1431 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, |
| 1427 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, | 1432 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, |
| 1428 GLbitfield mask, GLenum filter); | 1433 GLbitfield mask, GLenum filter); |
| 1429 | 1434 |
| 1430 // Wrapper for glBufferSubData. | 1435 // Wrapper for glBufferSubData. |
| 1431 void DoBufferSubData( | 1436 void DoBufferSubData( |
| 1432 GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data); | 1437 GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data); |
| 1433 | 1438 |
| 1439 // If the specified draw buffer have no image, return true. |
| 1440 // Otherwise, return false. |
| 1441 bool SpecifiedDrawBufferHasNoImage(GLint ii); |
| 1442 |
| 1443 // A workaround to adjust read buffer and draw buffers to GL_NONE |
| 1444 // if the specified read buffer or draw buffers have missing images. |
| 1445 // Return false if read buffer has no image or all of the draw buffers |
| 1446 // have no image after adjustment. Then we can generate |
| 1447 // INVALID_OPERATION or return directly in the callers accordingly. |
| 1448 bool AdjustColorBufferAttachmentsIfNecessary( |
| 1449 bool read, bool draw); |
| 1450 |
| 1434 // Wrapper for glCheckFramebufferStatus | 1451 // Wrapper for glCheckFramebufferStatus |
| 1435 GLenum DoCheckFramebufferStatus(GLenum target); | 1452 GLenum DoCheckFramebufferStatus(GLenum target); |
| 1436 | 1453 |
| 1437 // Wrapper for glClear*() | 1454 // Wrapper for glClear*() |
| 1438 error::Error DoClear(GLbitfield mask); | 1455 error::Error DoClear(GLbitfield mask); |
| 1439 void DoClearBufferiv(GLenum buffer, | 1456 void DoClearBufferiv(GLenum buffer, |
| 1440 GLint drawbuffer, | 1457 GLint drawbuffer, |
| 1441 const volatile GLint* value); | 1458 const volatile GLint* value); |
| 1442 void DoClearBufferuiv(GLenum buffer, | 1459 void DoClearBufferuiv(GLenum buffer, |
| 1443 GLint drawbuffer, | 1460 GLint drawbuffer, |
| (...skipping 2823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4267 // Are all the attachments cleared? | 4284 // Are all the attachments cleared? |
| 4268 if (renderbuffer_manager()->HaveUnclearedRenderbuffers() || | 4285 if (renderbuffer_manager()->HaveUnclearedRenderbuffers() || |
| 4269 texture_manager()->HaveUnclearedMips()) { | 4286 texture_manager()->HaveUnclearedMips()) { |
| 4270 if (!framebuffer->IsCleared()) { | 4287 if (!framebuffer->IsCleared()) { |
| 4271 ClearUnclearedAttachments(target, framebuffer); | 4288 ClearUnclearedAttachments(target, framebuffer); |
| 4272 } | 4289 } |
| 4273 } | 4290 } |
| 4274 return true; | 4291 return true; |
| 4275 } | 4292 } |
| 4276 | 4293 |
| 4277 bool GLES2DecoderImpl::CheckBoundDrawFramebufferValid(const char* func_name) { | 4294 bool GLES2DecoderImpl::CheckBoundDrawFramebufferValid( |
| 4295 const char* func_name, bool may_need_workaround) { |
| 4296 if (may_need_workaround && |
| 4297 workarounds().read_draw_buffers_missing_image && |
| 4298 SupportsDrawBuffers() && |
| 4299 framebuffer_state_.clear_state_dirty) { |
| 4300 if (!AdjustColorBufferAttachmentsIfNecessary(false, true)) { |
| 4301 return false; |
| 4302 } |
| 4303 } |
| 4278 GLenum target = features().chromium_framebuffer_multisample ? | 4304 GLenum target = features().chromium_framebuffer_multisample ? |
| 4279 GL_DRAW_FRAMEBUFFER : GL_FRAMEBUFFER; | 4305 GL_DRAW_FRAMEBUFFER : GL_FRAMEBUFFER; |
| 4280 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); | 4306 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); |
| 4281 bool valid = CheckFramebufferValid( | 4307 bool valid = CheckFramebufferValid( |
| 4282 framebuffer, target, GL_INVALID_FRAMEBUFFER_OPERATION, func_name); | 4308 framebuffer, target, GL_INVALID_FRAMEBUFFER_OPERATION, func_name); |
| 4283 if (valid && !features().chromium_framebuffer_multisample) | 4309 if (valid && !features().chromium_framebuffer_multisample) |
| 4284 OnUseFramebuffer(); | 4310 OnUseFramebuffer(); |
| 4285 if (valid && feature_info_->feature_flags().desktop_srgb_support) { | 4311 if (valid && feature_info_->feature_flags().desktop_srgb_support) { |
| 4286 // If framebuffer contains sRGB images, then enable FRAMEBUFFER_SRGB. | 4312 // If framebuffer contains sRGB images, then enable FRAMEBUFFER_SRGB. |
| 4287 // Otherwise, disable FRAMEBUFFER_SRGB. Assume default fbo does not have | 4313 // Otherwise, disable FRAMEBUFFER_SRGB. Assume default fbo does not have |
| 4288 // sRGB image. | 4314 // sRGB image. |
| 4289 // In theory, we can just leave FRAMEBUFFER_SRGB on. However, many drivers | 4315 // In theory, we can just leave FRAMEBUFFER_SRGB on. However, many drivers |
| 4290 // behave incorrectly when all images are linear encoding, they still apply | 4316 // behave incorrectly when all images are linear encoding, they still apply |
| 4291 // the sRGB conversion, but when at least one image is sRGB, then they | 4317 // the sRGB conversion, but when at least one image is sRGB, then they |
| 4292 // behave correctly. | 4318 // behave correctly. |
| 4293 bool enable_framebuffer_srgb = | 4319 bool enable_framebuffer_srgb = |
| 4294 framebuffer && framebuffer->HasSRGBAttachments(); | 4320 framebuffer && framebuffer->HasSRGBAttachments(); |
| 4295 state_.EnableDisableFramebufferSRGB(enable_framebuffer_srgb); | 4321 state_.EnableDisableFramebufferSRGB(enable_framebuffer_srgb); |
| 4296 } | 4322 } |
| 4297 return valid; | 4323 return valid; |
| 4298 } | 4324 } |
| 4299 | 4325 |
| 4300 bool GLES2DecoderImpl::CheckBoundReadFramebufferValid( | 4326 bool GLES2DecoderImpl::CheckBoundReadFramebufferValid( |
| 4301 const char* func_name, GLenum gl_error) { | 4327 const char* func_name, GLenum gl_error, bool may_need_workaround) { |
| 4328 if (may_need_workaround && |
| 4329 workarounds().read_draw_buffers_missing_image && |
| 4330 SupportsDrawBuffers() && |
| 4331 framebuffer_state_.clear_state_dirty) { |
| 4332 if (!AdjustColorBufferAttachmentsIfNecessary(true, false)) { |
| 4333 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| 4334 "no valid color image"); |
| 4335 return false; |
| 4336 } |
| 4337 } |
| 4302 GLenum target = features().chromium_framebuffer_multisample ? | 4338 GLenum target = features().chromium_framebuffer_multisample ? |
| 4303 GL_READ_FRAMEBUFFER : GL_FRAMEBUFFER; | 4339 GL_READ_FRAMEBUFFER : GL_FRAMEBUFFER; |
| 4304 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); | 4340 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); |
| 4305 bool valid = CheckFramebufferValid( | 4341 bool valid = CheckFramebufferValid( |
| 4306 framebuffer, target, gl_error, func_name); | 4342 framebuffer, target, gl_error, func_name); |
| 4307 return valid; | 4343 return valid; |
| 4308 } | 4344 } |
| 4309 | 4345 |
| 4310 bool GLES2DecoderImpl::CheckBoundFramebufferValid(const char* func_name) { | 4346 bool GLES2DecoderImpl::CheckBoundFramebufferValid(const char* func_name) { |
| 4311 GLenum target = features().chromium_framebuffer_multisample ? | 4347 GLenum target = features().chromium_framebuffer_multisample ? |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6160 case GL_IMPLEMENTATION_COLOR_READ_FORMAT: | 6196 case GL_IMPLEMENTATION_COLOR_READ_FORMAT: |
| 6161 case GL_IMPLEMENTATION_COLOR_READ_TYPE: | 6197 case GL_IMPLEMENTATION_COLOR_READ_TYPE: |
| 6162 // They are not supported on Desktop GL until 4.1, but could be exposed | 6198 // They are not supported on Desktop GL until 4.1, but could be exposed |
| 6163 // through GL_OES_read_format extension. However, a conflicting extension | 6199 // through GL_OES_read_format extension. However, a conflicting extension |
| 6164 // GL_ARB_ES2_compatibility specifies an error case when requested on | 6200 // GL_ARB_ES2_compatibility specifies an error case when requested on |
| 6165 // integer/floating point buffers. | 6201 // integer/floating point buffers. |
| 6166 // To simpify the handling, we just query and check for GL errors. If an | 6202 // To simpify the handling, we just query and check for GL errors. If an |
| 6167 // GL error occur, we fall back to our internal implementation. | 6203 // GL error occur, we fall back to our internal implementation. |
| 6168 *num_written = 1; | 6204 *num_written = 1; |
| 6169 if (!CheckBoundReadFramebufferValid("glGetIntegerv", | 6205 if (!CheckBoundReadFramebufferValid("glGetIntegerv", |
| 6170 GL_INVALID_OPERATION)) { | 6206 GL_INVALID_OPERATION, |
| 6207 false)) { |
| 6171 if (params) { | 6208 if (params) { |
| 6172 *params = 0; | 6209 *params = 0; |
| 6173 } | 6210 } |
| 6174 return true; | 6211 return true; |
| 6175 } | 6212 } |
| 6176 if (params) { | 6213 if (params) { |
| 6177 ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::GetHelper", | 6214 ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::GetHelper", |
| 6178 GetErrorState()); | 6215 GetErrorState()); |
| 6179 glGetIntegerv(pname, params); | 6216 glGetIntegerv(pname, params); |
| 6180 bool is_valid = glGetError() == GL_NO_ERROR; | 6217 bool is_valid = glGetError() == GL_NO_ERROR; |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7206 LOCAL_SET_GL_ERROR( | 7243 LOCAL_SET_GL_ERROR( |
| 7207 GL_INVALID_VALUE, "glDeleteProgram", "unknown program"); | 7244 GL_INVALID_VALUE, "glDeleteProgram", "unknown program"); |
| 7208 } | 7245 } |
| 7209 } | 7246 } |
| 7210 return error::kNoError; | 7247 return error::kNoError; |
| 7211 } | 7248 } |
| 7212 | 7249 |
| 7213 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) { | 7250 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) { |
| 7214 const char* func_name = "glClear"; | 7251 const char* func_name = "glClear"; |
| 7215 DCHECK(!ShouldDeferDraws()); | 7252 DCHECK(!ShouldDeferDraws()); |
| 7216 if (CheckBoundDrawFramebufferValid(func_name)) { | 7253 if ((mask & GL_COLOR_BUFFER_BIT) != 0 && |
| 7254 workarounds().read_draw_buffers_missing_image && |
| 7255 SupportsDrawBuffers() && |
| 7256 framebuffer_state_.clear_state_dirty) { |
| 7257 if (!AdjustColorBufferAttachmentsIfNecessary(false, true)) { |
| 7258 if ((mask & GL_DEPTH_BUFFER_BIT) == 0 && |
| 7259 (mask & GL_STENCIL_BUFFER_BIT) == 0) { |
| 7260 return error::kNoError; |
| 7261 } else { |
| 7262 mask &= ~GL_COLOR_BUFFER_BIT; |
| 7263 } |
| 7264 } |
| 7265 } |
| 7266 if (CheckBoundDrawFramebufferValid(func_name, false)) { |
| 7217 ApplyDirtyState(); | 7267 ApplyDirtyState(); |
| 7218 if (workarounds().gl_clear_broken) { | 7268 if (workarounds().gl_clear_broken) { |
| 7219 if (!BoundFramebufferHasDepthAttachment()) | 7269 if (!BoundFramebufferHasDepthAttachment()) |
| 7220 mask &= ~GL_DEPTH_BUFFER_BIT; | 7270 mask &= ~GL_DEPTH_BUFFER_BIT; |
| 7221 if (!BoundFramebufferHasStencilAttachment()) | 7271 if (!BoundFramebufferHasStencilAttachment()) |
| 7222 mask &= ~GL_STENCIL_BUFFER_BIT; | 7272 mask &= ~GL_STENCIL_BUFFER_BIT; |
| 7223 ClearFramebufferForWorkaround(mask); | 7273 ClearFramebufferForWorkaround(mask); |
| 7224 return error::kNoError; | 7274 return error::kNoError; |
| 7225 } | 7275 } |
| 7226 if (mask & GL_COLOR_BUFFER_BIT) { | 7276 if (mask & GL_COLOR_BUFFER_BIT) { |
| 7227 Framebuffer* framebuffer = | 7277 Framebuffer* framebuffer = |
| 7228 framebuffer_state_.bound_draw_framebuffer.get(); | 7278 framebuffer_state_.bound_draw_framebuffer.get(); |
| 7229 if (framebuffer && framebuffer->ContainsActiveIntegerAttachments()) { | 7279 if (framebuffer && framebuffer->ContainsActiveIntegerAttachments()) { |
| 7230 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, | 7280 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| 7231 "can't be called on integer buffers"); | 7281 "can't be called on integer buffers"); |
| 7232 return error::kNoError; | 7282 return error::kNoError; |
| 7233 } | 7283 } |
| 7234 } | 7284 } |
| 7235 glClear(mask); | 7285 glClear(mask); |
| 7236 } | 7286 } |
| 7237 return error::kNoError; | 7287 return error::kNoError; |
| 7238 } | 7288 } |
| 7239 | 7289 |
| 7240 void GLES2DecoderImpl::DoClearBufferiv(GLenum buffer, | 7290 void GLES2DecoderImpl::DoClearBufferiv(GLenum buffer, |
| 7241 GLint drawbuffer, | 7291 GLint drawbuffer, |
| 7242 const volatile GLint* value) { | 7292 const volatile GLint* value) { |
| 7293 if (workarounds().read_draw_buffers_missing_image && |
| 7294 buffer == GL_COLOR && |
| 7295 framebuffer_state_.clear_state_dirty) { |
| 7296 if (SpecifiedDrawBufferHasNoImage(drawbuffer)) |
| 7297 return; |
| 7298 } |
| 7243 const char* func_name = "glClearBufferiv"; | 7299 const char* func_name = "glClearBufferiv"; |
| 7244 if (!CheckBoundDrawFramebufferValid(func_name)) | 7300 if (!CheckBoundDrawFramebufferValid(func_name, false)) |
| 7245 return; | 7301 return; |
| 7246 ApplyDirtyState(); | 7302 ApplyDirtyState(); |
| 7247 | 7303 |
| 7248 if (buffer == GL_COLOR) { | 7304 if (buffer == GL_COLOR) { |
| 7249 if (drawbuffer < 0 || | 7305 if (drawbuffer < 0 || |
| 7250 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { | 7306 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { |
| 7251 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); | 7307 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); |
| 7252 return; | 7308 return; |
| 7253 } | 7309 } |
| 7254 GLenum internal_format = | 7310 GLenum internal_format = |
| (...skipping 13 matching lines...) Expand all Loading... |
| 7268 return; | 7324 return; |
| 7269 } | 7325 } |
| 7270 } | 7326 } |
| 7271 MarkDrawBufferAsCleared(buffer, drawbuffer); | 7327 MarkDrawBufferAsCleared(buffer, drawbuffer); |
| 7272 glClearBufferiv(buffer, drawbuffer, const_cast<const GLint*>(value)); | 7328 glClearBufferiv(buffer, drawbuffer, const_cast<const GLint*>(value)); |
| 7273 } | 7329 } |
| 7274 | 7330 |
| 7275 void GLES2DecoderImpl::DoClearBufferuiv(GLenum buffer, | 7331 void GLES2DecoderImpl::DoClearBufferuiv(GLenum buffer, |
| 7276 GLint drawbuffer, | 7332 GLint drawbuffer, |
| 7277 const volatile GLuint* value) { | 7333 const volatile GLuint* value) { |
| 7334 if (workarounds().read_draw_buffers_missing_image && |
| 7335 buffer == GL_COLOR && |
| 7336 framebuffer_state_.clear_state_dirty) { |
| 7337 if (SpecifiedDrawBufferHasNoImage(drawbuffer)) |
| 7338 return; |
| 7339 } |
| 7278 const char* func_name = "glClearBufferuiv"; | 7340 const char* func_name = "glClearBufferuiv"; |
| 7279 if (!CheckBoundDrawFramebufferValid(func_name)) | 7341 if (!CheckBoundDrawFramebufferValid(func_name, false)) |
| 7280 return; | 7342 return; |
| 7281 ApplyDirtyState(); | 7343 ApplyDirtyState(); |
| 7282 | 7344 |
| 7283 if (drawbuffer < 0 || | 7345 if (drawbuffer < 0 || |
| 7284 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { | 7346 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { |
| 7285 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); | 7347 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); |
| 7286 return; | 7348 return; |
| 7287 } | 7349 } |
| 7288 GLenum internal_format = | 7350 GLenum internal_format = |
| 7289 GetBoundColorDrawBufferInternalFormat(drawbuffer); | 7351 GetBoundColorDrawBufferInternalFormat(drawbuffer); |
| 7290 if (!GLES2Util::IsUnsignedIntegerFormat(internal_format)) { | 7352 if (!GLES2Util::IsUnsignedIntegerFormat(internal_format)) { |
| 7291 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, | 7353 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| 7292 "can only be called on unsigned integer buffers"); | 7354 "can only be called on unsigned integer buffers"); |
| 7293 return; | 7355 return; |
| 7294 } | 7356 } |
| 7295 MarkDrawBufferAsCleared(buffer, drawbuffer); | 7357 MarkDrawBufferAsCleared(buffer, drawbuffer); |
| 7296 glClearBufferuiv(buffer, drawbuffer, const_cast<const GLuint*>(value)); | 7358 glClearBufferuiv(buffer, drawbuffer, const_cast<const GLuint*>(value)); |
| 7297 } | 7359 } |
| 7298 | 7360 |
| 7299 void GLES2DecoderImpl::DoClearBufferfv(GLenum buffer, | 7361 void GLES2DecoderImpl::DoClearBufferfv(GLenum buffer, |
| 7300 GLint drawbuffer, | 7362 GLint drawbuffer, |
| 7301 const volatile GLfloat* value) { | 7363 const volatile GLfloat* value) { |
| 7364 if (workarounds().read_draw_buffers_missing_image && |
| 7365 buffer == GL_COLOR && |
| 7366 framebuffer_state_.clear_state_dirty) { |
| 7367 if (SpecifiedDrawBufferHasNoImage(drawbuffer)) |
| 7368 return; |
| 7369 } |
| 7302 const char* func_name = "glClearBufferfv"; | 7370 const char* func_name = "glClearBufferfv"; |
| 7303 if (!CheckBoundDrawFramebufferValid(func_name)) | 7371 if (!CheckBoundDrawFramebufferValid(func_name, false)) |
| 7304 return; | 7372 return; |
| 7305 ApplyDirtyState(); | 7373 ApplyDirtyState(); |
| 7306 | 7374 |
| 7307 if (buffer == GL_COLOR) { | 7375 if (buffer == GL_COLOR) { |
| 7308 if (drawbuffer < 0 || | 7376 if (drawbuffer < 0 || |
| 7309 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { | 7377 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { |
| 7310 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); | 7378 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); |
| 7311 return; | 7379 return; |
| 7312 } | 7380 } |
| 7313 GLenum internal_format = | 7381 GLenum internal_format = |
| (...skipping 13 matching lines...) Expand all Loading... |
| 7327 return; | 7395 return; |
| 7328 } | 7396 } |
| 7329 } | 7397 } |
| 7330 MarkDrawBufferAsCleared(buffer, drawbuffer); | 7398 MarkDrawBufferAsCleared(buffer, drawbuffer); |
| 7331 glClearBufferfv(buffer, drawbuffer, const_cast<const GLfloat*>(value)); | 7399 glClearBufferfv(buffer, drawbuffer, const_cast<const GLfloat*>(value)); |
| 7332 } | 7400 } |
| 7333 | 7401 |
| 7334 void GLES2DecoderImpl::DoClearBufferfi( | 7402 void GLES2DecoderImpl::DoClearBufferfi( |
| 7335 GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) { | 7403 GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) { |
| 7336 const char* func_name = "glClearBufferfi"; | 7404 const char* func_name = "glClearBufferfi"; |
| 7337 if (!CheckBoundDrawFramebufferValid(func_name)) | 7405 if (!CheckBoundDrawFramebufferValid(func_name, false)) |
| 7338 return; | 7406 return; |
| 7339 ApplyDirtyState(); | 7407 ApplyDirtyState(); |
| 7340 | 7408 |
| 7341 if (drawbuffer != 0) { | 7409 if (drawbuffer != 0) { |
| 7342 LOCAL_SET_GL_ERROR( | 7410 LOCAL_SET_GL_ERROR( |
| 7343 GL_INVALID_VALUE, func_name, "invalid drawBuffer"); | 7411 GL_INVALID_VALUE, func_name, "invalid drawBuffer"); |
| 7344 return; | 7412 return; |
| 7345 } | 7413 } |
| 7346 if (!BoundFramebufferHasDepthAttachment() && | 7414 if (!BoundFramebufferHasDepthAttachment() && |
| 7347 !BoundFramebufferHasStencilAttachment()) { | 7415 !BoundFramebufferHasStencilAttachment()) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7525 state_.color_clear_red, state_.color_clear_green, state_.color_clear_blue, | 7593 state_.color_clear_red, state_.color_clear_green, state_.color_clear_blue, |
| 7526 state_.color_clear_alpha); | 7594 state_.color_clear_alpha); |
| 7527 glClearStencil(state_.stencil_clear); | 7595 glClearStencil(state_.stencil_clear); |
| 7528 glClearDepth(state_.depth_clear); | 7596 glClearDepth(state_.depth_clear); |
| 7529 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, | 7597 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, |
| 7530 state_.enable_flags.scissor_test); | 7598 state_.enable_flags.scissor_test); |
| 7531 glScissor(state_.scissor_x, state_.scissor_y, state_.scissor_width, | 7599 glScissor(state_.scissor_x, state_.scissor_y, state_.scissor_width, |
| 7532 state_.scissor_height); | 7600 state_.scissor_height); |
| 7533 } | 7601 } |
| 7534 | 7602 |
| 7603 bool GLES2DecoderImpl::SpecifiedDrawBufferHasNoImage(GLint ii) { |
| 7604 if (ii < 0 || ii >= static_cast<GLint>(group_->max_draw_buffers())) |
| 7605 return false; |
| 7606 const Framebuffer* framebuffer = |
| 7607 GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER); |
| 7608 if (!framebuffer) |
| 7609 return false; |
| 7610 GLenum attachment = static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + ii); |
| 7611 if (!(framebuffer->GetAttachment(attachment)) && |
| 7612 framebuffer->ColorBuffersHaveImage()) { |
| 7613 return true; |
| 7614 } |
| 7615 return false; |
| 7616 } |
| 7617 |
| 7618 bool GLES2DecoderImpl::AdjustColorBufferAttachmentsIfNecessary( |
| 7619 bool read, bool draw) { |
| 7620 DCHECK(workarounds().read_draw_buffers_missing_image && |
| 7621 SupportsDrawBuffers() && |
| 7622 framebuffer_state_.clear_state_dirty); |
| 7623 if (read) { |
| 7624 const Framebuffer* framebuffer = |
| 7625 GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER); |
| 7626 if (framebuffer && |
| 7627 framebuffer->ReadBufferHasNoImage() && |
| 7628 framebuffer->ColorBuffersHaveImage()) { |
| 7629 glReadBuffer(GL_NONE); |
| 7630 return false; |
| 7631 } |
| 7632 } else { |
| 7633 GLsizei num = 0; |
| 7634 GLsizei total = group_->max_draw_buffers(); |
| 7635 GLenum safe_bufs[16]; |
| 7636 for (int i = 0; i < 16; ++i) |
| 7637 safe_bufs[i] = GL_NONE; |
| 7638 const Framebuffer* framebuffer = |
| 7639 GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER); |
| 7640 if (framebuffer && |
| 7641 framebuffer->DrawBuffersHaveMissingImage(&num, safe_bufs) && |
| 7642 framebuffer->ColorBuffersHaveImage()) { |
| 7643 glDrawBuffersARB(total, safe_bufs); |
| 7644 if (num == 0) { |
| 7645 return false; |
| 7646 } |
| 7647 } |
| 7648 } |
| 7649 return true; |
| 7650 } |
| 7651 |
| 7535 GLenum GLES2DecoderImpl::DoCheckFramebufferStatus(GLenum target) { | 7652 GLenum GLES2DecoderImpl::DoCheckFramebufferStatus(GLenum target) { |
| 7536 Framebuffer* framebuffer = | 7653 Framebuffer* framebuffer = |
| 7537 GetFramebufferInfoForTarget(target); | 7654 GetFramebufferInfoForTarget(target); |
| 7538 if (!framebuffer) { | 7655 if (!framebuffer) { |
| 7539 return GL_FRAMEBUFFER_COMPLETE; | 7656 return GL_FRAMEBUFFER_COMPLETE; |
| 7540 } | 7657 } |
| 7541 GLenum completeness = framebuffer->IsPossiblyComplete(feature_info_.get()); | 7658 GLenum completeness = framebuffer->IsPossiblyComplete(feature_info_.get()); |
| 7542 if (completeness != GL_FRAMEBUFFER_COMPLETE) { | 7659 if (completeness != GL_FRAMEBUFFER_COMPLETE) { |
| 7543 return completeness; | 7660 return completeness; |
| 7544 } | 7661 } |
| 7662 |
| 7663 bool has_image = true; |
| 7664 if (workarounds().read_draw_buffers_missing_image && |
| 7665 SupportsDrawBuffers() && |
| 7666 framebuffer_state_.clear_state_dirty) { |
| 7667 if (target == GL_READ_FRAMEBUFFER) { |
| 7668 has_image = AdjustColorBufferAttachmentsIfNecessary(true, false); |
| 7669 } else { |
| 7670 has_image = AdjustColorBufferAttachmentsIfNecessary(false, true); |
| 7671 } |
| 7672 if (!has_image) { |
| 7673 return GL_FRAMEBUFFER_COMPLETE; |
| 7674 } |
| 7675 } |
| 7676 |
| 7545 return framebuffer->GetStatus(texture_manager(), target); | 7677 return framebuffer->GetStatus(texture_manager(), target); |
| 7546 } | 7678 } |
| 7547 | 7679 |
| 7548 void GLES2DecoderImpl::DoFramebufferTexture2D( | 7680 void GLES2DecoderImpl::DoFramebufferTexture2D( |
| 7549 GLenum target, GLenum attachment, GLenum textarget, | 7681 GLenum target, GLenum attachment, GLenum textarget, |
| 7550 GLuint client_texture_id, GLint level) { | 7682 GLuint client_texture_id, GLint level) { |
| 7551 DoFramebufferTexture2DCommon( | 7683 DoFramebufferTexture2DCommon( |
| 7552 "glFramebufferTexture2D", target, attachment, | 7684 "glFramebufferTexture2D", target, attachment, |
| 7553 textarget, client_texture_id, level, 0); | 7685 textarget, client_texture_id, level, 0); |
| 7554 } | 7686 } |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7825 } | 7957 } |
| 7826 } | 7958 } |
| 7827 | 7959 |
| 7828 void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM( | 7960 void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM( |
| 7829 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, | 7961 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, |
| 7830 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, | 7962 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, |
| 7831 GLbitfield mask, GLenum filter) { | 7963 GLbitfield mask, GLenum filter) { |
| 7832 const char* func_name = "glBlitFramebufferCHROMIUM"; | 7964 const char* func_name = "glBlitFramebufferCHROMIUM"; |
| 7833 DCHECK(!ShouldDeferReads() && !ShouldDeferDraws()); | 7965 DCHECK(!ShouldDeferReads() && !ShouldDeferDraws()); |
| 7834 | 7966 |
| 7967 if (workarounds().read_draw_buffers_missing_image && |
| 7968 (mask & GL_COLOR_BUFFER_BIT) != 0 && |
| 7969 SupportsDrawBuffers() && |
| 7970 framebuffer_state_.clear_state_dirty) { |
| 7971 if (!AdjustColorBufferAttachmentsIfNecessary(false, true)) { |
| 7972 return; |
| 7973 } |
| 7974 if (!AdjustColorBufferAttachmentsIfNecessary(true, false)) { |
| 7975 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| 7976 "no valid color image"); |
| 7977 return; |
| 7978 } |
| 7979 } |
| 7835 if (!CheckBoundFramebufferValid(func_name)) { | 7980 if (!CheckBoundFramebufferValid(func_name)) { |
| 7836 return; | 7981 return; |
| 7837 } | 7982 } |
| 7838 | 7983 |
| 7839 if (GetBoundFramebufferSamples(GL_DRAW_FRAMEBUFFER) > 0) { | 7984 if (GetBoundFramebufferSamples(GL_DRAW_FRAMEBUFFER) > 0) { |
| 7840 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, | 7985 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| 7841 "destination framebuffer is multisampled"); | 7986 "destination framebuffer is multisampled"); |
| 7842 return; | 7987 return; |
| 7843 } | 7988 } |
| 7844 | 7989 |
| (...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9799 return error::kNoError; | 9944 return error::kNoError; |
| 9800 } | 9945 } |
| 9801 if (count < 0) { | 9946 if (count < 0) { |
| 9802 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "count < 0"); | 9947 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "count < 0"); |
| 9803 return error::kNoError; | 9948 return error::kNoError; |
| 9804 } | 9949 } |
| 9805 if (primcount < 0) { | 9950 if (primcount < 0) { |
| 9806 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); | 9951 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); |
| 9807 return error::kNoError; | 9952 return error::kNoError; |
| 9808 } | 9953 } |
| 9809 if (!CheckBoundDrawFramebufferValid(function_name)) { | 9954 if (!CheckBoundDrawFramebufferValid(function_name, true)) { |
| 9810 return error::kNoError; | 9955 return error::kNoError; |
| 9811 } | 9956 } |
| 9812 // We have to check this here because the prototype for glDrawArrays | 9957 // We have to check this here because the prototype for glDrawArrays |
| 9813 // is GLint not GLsizei. | 9958 // is GLint not GLsizei. |
| 9814 if (first < 0) { | 9959 if (first < 0) { |
| 9815 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "first < 0"); | 9960 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "first < 0"); |
| 9816 return error::kNoError; | 9961 return error::kNoError; |
| 9817 } | 9962 } |
| 9818 | 9963 |
| 9819 if (feature_info_->IsWebGL2OrES3Context()) { | 9964 if (feature_info_->IsWebGL2OrES3Context()) { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9963 if (primcount < 0) { | 10108 if (primcount < 0) { |
| 9964 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); | 10109 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); |
| 9965 return error::kNoError; | 10110 return error::kNoError; |
| 9966 } | 10111 } |
| 9967 Buffer* element_array_buffer = buffer_manager()->RequestBufferAccess( | 10112 Buffer* element_array_buffer = buffer_manager()->RequestBufferAccess( |
| 9968 &state_, GL_ELEMENT_ARRAY_BUFFER, function_name); | 10113 &state_, GL_ELEMENT_ARRAY_BUFFER, function_name); |
| 9969 if (!element_array_buffer) { | 10114 if (!element_array_buffer) { |
| 9970 return error::kNoError; | 10115 return error::kNoError; |
| 9971 } | 10116 } |
| 9972 | 10117 |
| 9973 if (!CheckBoundDrawFramebufferValid(function_name)) { | 10118 if (!CheckBoundDrawFramebufferValid(function_name, true)) { |
| 9974 return error::kNoError; | 10119 return error::kNoError; |
| 9975 } | 10120 } |
| 9976 | 10121 |
| 9977 if (state_.bound_transform_feedback.get() && | 10122 if (state_.bound_transform_feedback.get() && |
| 9978 state_.bound_transform_feedback->active() && | 10123 state_.bound_transform_feedback->active() && |
| 9979 !state_.bound_transform_feedback->paused()) { | 10124 !state_.bound_transform_feedback->paused()) { |
| 9980 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 10125 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
| 9981 "transformfeedback is active and not paused"); | 10126 "transformfeedback is active and not paused"); |
| 9982 return error::kNoError; | 10127 return error::kNoError; |
| 9983 } | 10128 } |
| (...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11188 | 11333 |
| 11189 if (!validators_->read_pixel_format.IsValid(format)) { | 11334 if (!validators_->read_pixel_format.IsValid(format)) { |
| 11190 LOCAL_SET_GL_ERROR_INVALID_ENUM(func_name, format, "format"); | 11335 LOCAL_SET_GL_ERROR_INVALID_ENUM(func_name, format, "format"); |
| 11191 return error::kNoError; | 11336 return error::kNoError; |
| 11192 } | 11337 } |
| 11193 if (!validators_->read_pixel_type.IsValid(type)) { | 11338 if (!validators_->read_pixel_type.IsValid(type)) { |
| 11194 LOCAL_SET_GL_ERROR_INVALID_ENUM(func_name, type, "type"); | 11339 LOCAL_SET_GL_ERROR_INVALID_ENUM(func_name, type, "type"); |
| 11195 return error::kNoError; | 11340 return error::kNoError; |
| 11196 } | 11341 } |
| 11197 | 11342 |
| 11198 if (!CheckBoundReadFramebufferValid( | 11343 if (!CheckBoundReadFramebufferValid(func_name, |
| 11199 func_name, GL_INVALID_FRAMEBUFFER_OPERATION)) { | 11344 GL_INVALID_FRAMEBUFFER_OPERATION, |
| 11345 true)) { |
| 11200 return error::kNoError; | 11346 return error::kNoError; |
| 11201 } | 11347 } |
| 11202 GLenum src_internal_format = GetBoundReadFramebufferInternalFormat(); | 11348 GLenum src_internal_format = GetBoundReadFramebufferInternalFormat(); |
| 11203 if (src_internal_format == 0) { | 11349 if (src_internal_format == 0) { |
| 11204 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, "no valid color image"); | 11350 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, "no valid color image"); |
| 11205 return error::kNoError; | 11351 return error::kNoError; |
| 11206 } | 11352 } |
| 11207 std::vector<GLenum> accepted_formats; | 11353 std::vector<GLenum> accepted_formats; |
| 11208 std::vector<GLenum> accepted_types; | 11354 std::vector<GLenum> accepted_types; |
| 11209 switch (src_internal_format) { | 11355 switch (src_internal_format) { |
| (...skipping 2604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13814 return; | 13960 return; |
| 13815 } | 13961 } |
| 13816 if (!texture_manager()->ValidForTarget(target, level, width, height, 1) || | 13962 if (!texture_manager()->ValidForTarget(target, level, width, height, 1) || |
| 13817 border != 0) { | 13963 border != 0) { |
| 13818 LOCAL_SET_GL_ERROR( | 13964 LOCAL_SET_GL_ERROR( |
| 13819 GL_INVALID_VALUE, func_name, "dimensions out of range"); | 13965 GL_INVALID_VALUE, func_name, "dimensions out of range"); |
| 13820 return; | 13966 return; |
| 13821 } | 13967 } |
| 13822 | 13968 |
| 13823 if (!CheckBoundReadFramebufferValid(func_name, | 13969 if (!CheckBoundReadFramebufferValid(func_name, |
| 13824 GL_INVALID_FRAMEBUFFER_OPERATION)) { | 13970 GL_INVALID_FRAMEBUFFER_OPERATION, |
| 13971 true)) { |
| 13825 return; | 13972 return; |
| 13826 } | 13973 } |
| 13827 | 13974 |
| 13828 GLenum read_format = GetBoundReadFramebufferInternalFormat(); | 13975 GLenum read_format = GetBoundReadFramebufferInternalFormat(); |
| 13829 GLenum read_type = GetBoundReadFramebufferTextureType(); | 13976 GLenum read_type = GetBoundReadFramebufferTextureType(); |
| 13830 if (!ValidateCopyTexFormat(func_name, internal_format, | 13977 if (!ValidateCopyTexFormat(func_name, internal_format, |
| 13831 read_format, read_type)) { | 13978 read_format, read_type)) { |
| 13832 return; | 13979 return; |
| 13833 } | 13980 } |
| 13834 | 13981 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14061 GLenum type = 0; | 14208 GLenum type = 0; |
| 14062 GLenum internal_format = 0; | 14209 GLenum internal_format = 0; |
| 14063 if (!texture->GetLevelType(target, level, &type, &internal_format) || | 14210 if (!texture->GetLevelType(target, level, &type, &internal_format) || |
| 14064 !texture->ValidForTexture( | 14211 !texture->ValidForTexture( |
| 14065 target, level, xoffset, yoffset, 0, width, height, 1)) { | 14212 target, level, xoffset, yoffset, 0, width, height, 1)) { |
| 14066 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "bad dimensions."); | 14213 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "bad dimensions."); |
| 14067 return; | 14214 return; |
| 14068 } | 14215 } |
| 14069 | 14216 |
| 14070 if (!CheckBoundReadFramebufferValid(func_name, | 14217 if (!CheckBoundReadFramebufferValid(func_name, |
| 14071 GL_INVALID_FRAMEBUFFER_OPERATION)) { | 14218 GL_INVALID_FRAMEBUFFER_OPERATION, |
| 14219 true)) { |
| 14072 return; | 14220 return; |
| 14073 } | 14221 } |
| 14074 | 14222 |
| 14075 GLenum read_format = GetBoundReadFramebufferInternalFormat(); | 14223 GLenum read_format = GetBoundReadFramebufferInternalFormat(); |
| 14076 GLenum read_type = GetBoundReadFramebufferTextureType(); | 14224 GLenum read_type = GetBoundReadFramebufferTextureType(); |
| 14077 if (!ValidateCopyTexFormat(func_name, internal_format, | 14225 if (!ValidateCopyTexFormat(func_name, internal_format, |
| 14078 read_format, read_type)) { | 14226 read_format, read_type)) { |
| 14079 return; | 14227 return; |
| 14080 } | 14228 } |
| 14081 | 14229 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14177 GLenum type = 0; | 14325 GLenum type = 0; |
| 14178 GLenum internal_format = 0; | 14326 GLenum internal_format = 0; |
| 14179 if (!texture->GetLevelType(target, level, &type, &internal_format) || | 14327 if (!texture->GetLevelType(target, level, &type, &internal_format) || |
| 14180 !texture->ValidForTexture( | 14328 !texture->ValidForTexture( |
| 14181 target, level, xoffset, yoffset, zoffset, width, height, 1)) { | 14329 target, level, xoffset, yoffset, zoffset, width, height, 1)) { |
| 14182 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "bad dimensions."); | 14330 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "bad dimensions."); |
| 14183 return; | 14331 return; |
| 14184 } | 14332 } |
| 14185 | 14333 |
| 14186 if (!CheckBoundReadFramebufferValid(func_name, | 14334 if (!CheckBoundReadFramebufferValid(func_name, |
| 14187 GL_INVALID_FRAMEBUFFER_OPERATION)) { | 14335 GL_INVALID_FRAMEBUFFER_OPERATION, |
| 14336 true)) { |
| 14188 return; | 14337 return; |
| 14189 } | 14338 } |
| 14190 | 14339 |
| 14191 GLenum read_format = GetBoundReadFramebufferInternalFormat(); | 14340 GLenum read_format = GetBoundReadFramebufferInternalFormat(); |
| 14192 GLenum read_type = GetBoundReadFramebufferTextureType(); | 14341 GLenum read_type = GetBoundReadFramebufferTextureType(); |
| 14193 if (!ValidateCopyTexFormat(func_name, internal_format, | 14342 if (!ValidateCopyTexFormat(func_name, internal_format, |
| 14194 read_format, read_type)) { | 14343 read_format, read_type)) { |
| 14195 return; | 14344 return; |
| 14196 } | 14345 } |
| 14197 | 14346 |
| (...skipping 3992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18190 GLuint mask = 0; | 18339 GLuint mask = 0; |
| 18191 if (!v.GetFillModeAndMask(c, &fill_mode, &mask)) | 18340 if (!v.GetFillModeAndMask(c, &fill_mode, &mask)) |
| 18192 return v.error(); | 18341 return v.error(); |
| 18193 GLuint service_id = 0; | 18342 GLuint service_id = 0; |
| 18194 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { | 18343 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { |
| 18195 // "If /path/ does not name an existing path object, the command does | 18344 // "If /path/ does not name an existing path object, the command does |
| 18196 // nothing (and no error is generated)." | 18345 // nothing (and no error is generated)." |
| 18197 // This holds for other rendering functions, too. | 18346 // This holds for other rendering functions, too. |
| 18198 return error::kNoError; | 18347 return error::kNoError; |
| 18199 } | 18348 } |
| 18200 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18349 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18201 return error::kNoError; | 18350 return error::kNoError; |
| 18202 ApplyDirtyState(); | 18351 ApplyDirtyState(); |
| 18203 glStencilFillPathNV(service_id, fill_mode, mask); | 18352 glStencilFillPathNV(service_id, fill_mode, mask); |
| 18204 return error::kNoError; | 18353 return error::kNoError; |
| 18205 } | 18354 } |
| 18206 | 18355 |
| 18207 error::Error GLES2DecoderImpl::HandleStencilStrokePathCHROMIUM( | 18356 error::Error GLES2DecoderImpl::HandleStencilStrokePathCHROMIUM( |
| 18208 uint32_t immediate_data_size, | 18357 uint32_t immediate_data_size, |
| 18209 const volatile void* cmd_data) { | 18358 const volatile void* cmd_data) { |
| 18210 static const char kFunctionName[] = "glStencilStrokePathCHROMIUM"; | 18359 static const char kFunctionName[] = "glStencilStrokePathCHROMIUM"; |
| 18211 const volatile gles2::cmds::StencilStrokePathCHROMIUM& c = | 18360 const volatile gles2::cmds::StencilStrokePathCHROMIUM& c = |
| 18212 *static_cast<const volatile gles2::cmds::StencilStrokePathCHROMIUM*>( | 18361 *static_cast<const volatile gles2::cmds::StencilStrokePathCHROMIUM*>( |
| 18213 cmd_data); | 18362 cmd_data); |
| 18214 if (!features().chromium_path_rendering) | 18363 if (!features().chromium_path_rendering) |
| 18215 return error::kUnknownCommand; | 18364 return error::kUnknownCommand; |
| 18216 | 18365 |
| 18217 GLuint service_id = 0; | 18366 GLuint service_id = 0; |
| 18218 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { | 18367 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { |
| 18219 return error::kNoError; | 18368 return error::kNoError; |
| 18220 } | 18369 } |
| 18221 GLint reference = static_cast<GLint>(c.reference); | 18370 GLint reference = static_cast<GLint>(c.reference); |
| 18222 GLuint mask = static_cast<GLuint>(c.mask); | 18371 GLuint mask = static_cast<GLuint>(c.mask); |
| 18223 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18372 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18224 return error::kNoError; | 18373 return error::kNoError; |
| 18225 ApplyDirtyState(); | 18374 ApplyDirtyState(); |
| 18226 glStencilStrokePathNV(service_id, reference, mask); | 18375 glStencilStrokePathNV(service_id, reference, mask); |
| 18227 return error::kNoError; | 18376 return error::kNoError; |
| 18228 } | 18377 } |
| 18229 | 18378 |
| 18230 error::Error GLES2DecoderImpl::HandleCoverFillPathCHROMIUM( | 18379 error::Error GLES2DecoderImpl::HandleCoverFillPathCHROMIUM( |
| 18231 uint32_t immediate_data_size, | 18380 uint32_t immediate_data_size, |
| 18232 const volatile void* cmd_data) { | 18381 const volatile void* cmd_data) { |
| 18233 static const char kFunctionName[] = "glCoverFillPathCHROMIUM"; | 18382 static const char kFunctionName[] = "glCoverFillPathCHROMIUM"; |
| 18234 const volatile gles2::cmds::CoverFillPathCHROMIUM& c = | 18383 const volatile gles2::cmds::CoverFillPathCHROMIUM& c = |
| 18235 *static_cast<const volatile gles2::cmds::CoverFillPathCHROMIUM*>( | 18384 *static_cast<const volatile gles2::cmds::CoverFillPathCHROMIUM*>( |
| 18236 cmd_data); | 18385 cmd_data); |
| 18237 if (!features().chromium_path_rendering) | 18386 if (!features().chromium_path_rendering) |
| 18238 return error::kUnknownCommand; | 18387 return error::kUnknownCommand; |
| 18239 | 18388 |
| 18240 PathCommandValidatorContext v(this, kFunctionName); | 18389 PathCommandValidatorContext v(this, kFunctionName); |
| 18241 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 18390 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 18242 if (!v.GetCoverMode(c, &cover_mode)) | 18391 if (!v.GetCoverMode(c, &cover_mode)) |
| 18243 return v.error(); | 18392 return v.error(); |
| 18244 | 18393 |
| 18245 GLuint service_id = 0; | 18394 GLuint service_id = 0; |
| 18246 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 18395 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 18247 return error::kNoError; | 18396 return error::kNoError; |
| 18248 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18397 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18249 return error::kNoError; | 18398 return error::kNoError; |
| 18250 ApplyDirtyState(); | 18399 ApplyDirtyState(); |
| 18251 glCoverFillPathNV(service_id, cover_mode); | 18400 glCoverFillPathNV(service_id, cover_mode); |
| 18252 return error::kNoError; | 18401 return error::kNoError; |
| 18253 } | 18402 } |
| 18254 | 18403 |
| 18255 error::Error GLES2DecoderImpl::HandleCoverStrokePathCHROMIUM( | 18404 error::Error GLES2DecoderImpl::HandleCoverStrokePathCHROMIUM( |
| 18256 uint32_t immediate_data_size, | 18405 uint32_t immediate_data_size, |
| 18257 const volatile void* cmd_data) { | 18406 const volatile void* cmd_data) { |
| 18258 static const char kFunctionName[] = "glCoverStrokePathCHROMIUM"; | 18407 static const char kFunctionName[] = "glCoverStrokePathCHROMIUM"; |
| 18259 const volatile gles2::cmds::CoverStrokePathCHROMIUM& c = | 18408 const volatile gles2::cmds::CoverStrokePathCHROMIUM& c = |
| 18260 *static_cast<const volatile gles2::cmds::CoverStrokePathCHROMIUM*>( | 18409 *static_cast<const volatile gles2::cmds::CoverStrokePathCHROMIUM*>( |
| 18261 cmd_data); | 18410 cmd_data); |
| 18262 if (!features().chromium_path_rendering) | 18411 if (!features().chromium_path_rendering) |
| 18263 return error::kUnknownCommand; | 18412 return error::kUnknownCommand; |
| 18264 | 18413 |
| 18265 PathCommandValidatorContext v(this, kFunctionName); | 18414 PathCommandValidatorContext v(this, kFunctionName); |
| 18266 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 18415 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 18267 if (!v.GetCoverMode(c, &cover_mode)) | 18416 if (!v.GetCoverMode(c, &cover_mode)) |
| 18268 return v.error(); | 18417 return v.error(); |
| 18269 | 18418 |
| 18270 GLuint service_id = 0; | 18419 GLuint service_id = 0; |
| 18271 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 18420 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 18272 return error::kNoError; | 18421 return error::kNoError; |
| 18273 | 18422 |
| 18274 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18423 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18275 return error::kNoError; | 18424 return error::kNoError; |
| 18276 ApplyDirtyState(); | 18425 ApplyDirtyState(); |
| 18277 glCoverStrokePathNV(service_id, cover_mode); | 18426 glCoverStrokePathNV(service_id, cover_mode); |
| 18278 return error::kNoError; | 18427 return error::kNoError; |
| 18279 } | 18428 } |
| 18280 | 18429 |
| 18281 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathCHROMIUM( | 18430 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathCHROMIUM( |
| 18282 uint32_t immediate_data_size, | 18431 uint32_t immediate_data_size, |
| 18283 const volatile void* cmd_data) { | 18432 const volatile void* cmd_data) { |
| 18284 static const char kFunctionName[] = "glStencilThenCoverFillPathCHROMIUM"; | 18433 static const char kFunctionName[] = "glStencilThenCoverFillPathCHROMIUM"; |
| 18285 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM& c = | 18434 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM& c = |
| 18286 *static_cast< | 18435 *static_cast< |
| 18287 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM*>( | 18436 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM*>( |
| 18288 cmd_data); | 18437 cmd_data); |
| 18289 if (!features().chromium_path_rendering) | 18438 if (!features().chromium_path_rendering) |
| 18290 return error::kUnknownCommand; | 18439 return error::kUnknownCommand; |
| 18291 | 18440 |
| 18292 PathCommandValidatorContext v(this, kFunctionName); | 18441 PathCommandValidatorContext v(this, kFunctionName); |
| 18293 GLenum fill_mode = GL_COUNT_UP_CHROMIUM; | 18442 GLenum fill_mode = GL_COUNT_UP_CHROMIUM; |
| 18294 GLuint mask = 0; | 18443 GLuint mask = 0; |
| 18295 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 18444 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 18296 if (!v.GetFillModeAndMask(c, &fill_mode, &mask) || | 18445 if (!v.GetFillModeAndMask(c, &fill_mode, &mask) || |
| 18297 !v.GetCoverMode(c, &cover_mode)) | 18446 !v.GetCoverMode(c, &cover_mode)) |
| 18298 return v.error(); | 18447 return v.error(); |
| 18299 | 18448 |
| 18300 GLuint service_id = 0; | 18449 GLuint service_id = 0; |
| 18301 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 18450 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 18302 return error::kNoError; | 18451 return error::kNoError; |
| 18303 | 18452 |
| 18304 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18453 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18305 return error::kNoError; | 18454 return error::kNoError; |
| 18306 ApplyDirtyState(); | 18455 ApplyDirtyState(); |
| 18307 glStencilThenCoverFillPathNV(service_id, fill_mode, mask, cover_mode); | 18456 glStencilThenCoverFillPathNV(service_id, fill_mode, mask, cover_mode); |
| 18308 return error::kNoError; | 18457 return error::kNoError; |
| 18309 } | 18458 } |
| 18310 | 18459 |
| 18311 error::Error GLES2DecoderImpl::HandleStencilThenCoverStrokePathCHROMIUM( | 18460 error::Error GLES2DecoderImpl::HandleStencilThenCoverStrokePathCHROMIUM( |
| 18312 uint32_t immediate_data_size, | 18461 uint32_t immediate_data_size, |
| 18313 const volatile void* cmd_data) { | 18462 const volatile void* cmd_data) { |
| 18314 static const char kFunctionName[] = "glStencilThenCoverStrokePathCHROMIUM"; | 18463 static const char kFunctionName[] = "glStencilThenCoverStrokePathCHROMIUM"; |
| 18315 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM& c = | 18464 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM& c = |
| 18316 *static_cast< | 18465 *static_cast< |
| 18317 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM*>( | 18466 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM*>( |
| 18318 cmd_data); | 18467 cmd_data); |
| 18319 if (!features().chromium_path_rendering) | 18468 if (!features().chromium_path_rendering) |
| 18320 return error::kUnknownCommand; | 18469 return error::kUnknownCommand; |
| 18321 | 18470 |
| 18322 PathCommandValidatorContext v(this, kFunctionName); | 18471 PathCommandValidatorContext v(this, kFunctionName); |
| 18323 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 18472 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 18324 if (!v.GetCoverMode(c, &cover_mode)) | 18473 if (!v.GetCoverMode(c, &cover_mode)) |
| 18325 return v.error(); | 18474 return v.error(); |
| 18326 | 18475 |
| 18327 GLuint service_id = 0; | 18476 GLuint service_id = 0; |
| 18328 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 18477 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 18329 return error::kNoError; | 18478 return error::kNoError; |
| 18330 | 18479 |
| 18331 GLint reference = static_cast<GLint>(c.reference); | 18480 GLint reference = static_cast<GLint>(c.reference); |
| 18332 GLuint mask = static_cast<GLuint>(c.mask); | 18481 GLuint mask = static_cast<GLuint>(c.mask); |
| 18333 | 18482 |
| 18334 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18483 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18335 return error::kNoError; | 18484 return error::kNoError; |
| 18336 ApplyDirtyState(); | 18485 ApplyDirtyState(); |
| 18337 glStencilThenCoverStrokePathNV(service_id, reference, mask, cover_mode); | 18486 glStencilThenCoverStrokePathNV(service_id, reference, mask, cover_mode); |
| 18338 return error::kNoError; | 18487 return error::kNoError; |
| 18339 } | 18488 } |
| 18340 | 18489 |
| 18341 error::Error GLES2DecoderImpl::HandleStencilFillPathInstancedCHROMIUM( | 18490 error::Error GLES2DecoderImpl::HandleStencilFillPathInstancedCHROMIUM( |
| 18342 uint32_t immediate_data_size, | 18491 uint32_t immediate_data_size, |
| 18343 const volatile void* cmd_data) { | 18492 const volatile void* cmd_data) { |
| 18344 static const char kFunctionName[] = "glStencilFillPathInstancedCHROMIUM"; | 18493 static const char kFunctionName[] = "glStencilFillPathInstancedCHROMIUM"; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 18364 return error::kNoError; | 18513 return error::kNoError; |
| 18365 | 18514 |
| 18366 std::unique_ptr<GLuint[]> paths; | 18515 std::unique_ptr<GLuint[]> paths; |
| 18367 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18516 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18368 return v.error(); | 18517 return v.error(); |
| 18369 | 18518 |
| 18370 const GLfloat* transforms = nullptr; | 18519 const GLfloat* transforms = nullptr; |
| 18371 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18520 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18372 return v.error(); | 18521 return v.error(); |
| 18373 | 18522 |
| 18374 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18523 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18375 return error::kNoError; | 18524 return error::kNoError; |
| 18376 ApplyDirtyState(); | 18525 ApplyDirtyState(); |
| 18377 glStencilFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 18526 glStencilFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 18378 fill_mode, mask, transform_type, transforms); | 18527 fill_mode, mask, transform_type, transforms); |
| 18379 return error::kNoError; | 18528 return error::kNoError; |
| 18380 } | 18529 } |
| 18381 | 18530 |
| 18382 error::Error GLES2DecoderImpl::HandleStencilStrokePathInstancedCHROMIUM( | 18531 error::Error GLES2DecoderImpl::HandleStencilStrokePathInstancedCHROMIUM( |
| 18383 uint32_t immediate_data_size, | 18532 uint32_t immediate_data_size, |
| 18384 const volatile void* cmd_data) { | 18533 const volatile void* cmd_data) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 18404 std::unique_ptr<GLuint[]> paths; | 18553 std::unique_ptr<GLuint[]> paths; |
| 18405 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18554 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18406 return v.error(); | 18555 return v.error(); |
| 18407 | 18556 |
| 18408 const GLfloat* transforms = nullptr; | 18557 const GLfloat* transforms = nullptr; |
| 18409 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18558 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18410 return v.error(); | 18559 return v.error(); |
| 18411 | 18560 |
| 18412 GLint reference = static_cast<GLint>(c.reference); | 18561 GLint reference = static_cast<GLint>(c.reference); |
| 18413 GLuint mask = static_cast<GLuint>(c.mask); | 18562 GLuint mask = static_cast<GLuint>(c.mask); |
| 18414 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18563 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18415 return error::kNoError; | 18564 return error::kNoError; |
| 18416 ApplyDirtyState(); | 18565 ApplyDirtyState(); |
| 18417 glStencilStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 18566 glStencilStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 18418 reference, mask, transform_type, transforms); | 18567 reference, mask, transform_type, transforms); |
| 18419 return error::kNoError; | 18568 return error::kNoError; |
| 18420 } | 18569 } |
| 18421 | 18570 |
| 18422 error::Error GLES2DecoderImpl::HandleCoverFillPathInstancedCHROMIUM( | 18571 error::Error GLES2DecoderImpl::HandleCoverFillPathInstancedCHROMIUM( |
| 18423 uint32_t immediate_data_size, | 18572 uint32_t immediate_data_size, |
| 18424 const volatile void* cmd_data) { | 18573 const volatile void* cmd_data) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 18443 return error::kNoError; | 18592 return error::kNoError; |
| 18444 | 18593 |
| 18445 std::unique_ptr<GLuint[]> paths; | 18594 std::unique_ptr<GLuint[]> paths; |
| 18446 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18595 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18447 return v.error(); | 18596 return v.error(); |
| 18448 | 18597 |
| 18449 const GLfloat* transforms = nullptr; | 18598 const GLfloat* transforms = nullptr; |
| 18450 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18599 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18451 return v.error(); | 18600 return v.error(); |
| 18452 | 18601 |
| 18453 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18602 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18454 return error::kNoError; | 18603 return error::kNoError; |
| 18455 ApplyDirtyState(); | 18604 ApplyDirtyState(); |
| 18456 glCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 18605 glCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 18457 cover_mode, transform_type, transforms); | 18606 cover_mode, transform_type, transforms); |
| 18458 return error::kNoError; | 18607 return error::kNoError; |
| 18459 } | 18608 } |
| 18460 | 18609 |
| 18461 error::Error GLES2DecoderImpl::HandleCoverStrokePathInstancedCHROMIUM( | 18610 error::Error GLES2DecoderImpl::HandleCoverStrokePathInstancedCHROMIUM( |
| 18462 uint32_t immediate_data_size, | 18611 uint32_t immediate_data_size, |
| 18463 const volatile void* cmd_data) { | 18612 const volatile void* cmd_data) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 18483 return error::kNoError; | 18632 return error::kNoError; |
| 18484 | 18633 |
| 18485 std::unique_ptr<GLuint[]> paths; | 18634 std::unique_ptr<GLuint[]> paths; |
| 18486 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18635 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18487 return v.error(); | 18636 return v.error(); |
| 18488 | 18637 |
| 18489 const GLfloat* transforms = nullptr; | 18638 const GLfloat* transforms = nullptr; |
| 18490 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18639 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18491 return v.error(); | 18640 return v.error(); |
| 18492 | 18641 |
| 18493 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18642 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18494 return error::kNoError; | 18643 return error::kNoError; |
| 18495 ApplyDirtyState(); | 18644 ApplyDirtyState(); |
| 18496 glCoverStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 18645 glCoverStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 18497 cover_mode, transform_type, transforms); | 18646 cover_mode, transform_type, transforms); |
| 18498 return error::kNoError; | 18647 return error::kNoError; |
| 18499 } | 18648 } |
| 18500 | 18649 |
| 18501 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathInstancedCHROMIUM( | 18650 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathInstancedCHROMIUM( |
| 18502 uint32_t immediate_data_size, | 18651 uint32_t immediate_data_size, |
| 18503 const volatile void* cmd_data) { | 18652 const volatile void* cmd_data) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 18526 return error::kNoError; | 18675 return error::kNoError; |
| 18527 | 18676 |
| 18528 std::unique_ptr<GLuint[]> paths; | 18677 std::unique_ptr<GLuint[]> paths; |
| 18529 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18678 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18530 return v.error(); | 18679 return v.error(); |
| 18531 | 18680 |
| 18532 const GLfloat* transforms = nullptr; | 18681 const GLfloat* transforms = nullptr; |
| 18533 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18682 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18534 return v.error(); | 18683 return v.error(); |
| 18535 | 18684 |
| 18536 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18685 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18537 return error::kNoError; | 18686 return error::kNoError; |
| 18538 ApplyDirtyState(); | 18687 ApplyDirtyState(); |
| 18539 glStencilThenCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), | 18688 glStencilThenCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), |
| 18540 0, fill_mode, mask, cover_mode, | 18689 0, fill_mode, mask, cover_mode, |
| 18541 transform_type, transforms); | 18690 transform_type, transforms); |
| 18542 return error::kNoError; | 18691 return error::kNoError; |
| 18543 } | 18692 } |
| 18544 | 18693 |
| 18545 error::Error | 18694 error::Error |
| 18546 GLES2DecoderImpl::HandleStencilThenCoverStrokePathInstancedCHROMIUM( | 18695 GLES2DecoderImpl::HandleStencilThenCoverStrokePathInstancedCHROMIUM( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 18570 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18719 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18571 return v.error(); | 18720 return v.error(); |
| 18572 | 18721 |
| 18573 const GLfloat* transforms = nullptr; | 18722 const GLfloat* transforms = nullptr; |
| 18574 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18723 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18575 return v.error(); | 18724 return v.error(); |
| 18576 | 18725 |
| 18577 GLint reference = static_cast<GLint>(c.reference); | 18726 GLint reference = static_cast<GLint>(c.reference); |
| 18578 GLuint mask = static_cast<GLuint>(c.mask); | 18727 GLuint mask = static_cast<GLuint>(c.mask); |
| 18579 | 18728 |
| 18580 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18729 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18581 return error::kNoError; | 18730 return error::kNoError; |
| 18582 ApplyDirtyState(); | 18731 ApplyDirtyState(); |
| 18583 glStencilThenCoverStrokePathInstancedNV( | 18732 glStencilThenCoverStrokePathInstancedNV( |
| 18584 num_paths, GL_UNSIGNED_INT, paths.get(), 0, reference, mask, cover_mode, | 18733 num_paths, GL_UNSIGNED_INT, paths.get(), 0, reference, mask, cover_mode, |
| 18585 transform_type, transforms); | 18734 transform_type, transforms); |
| 18586 return error::kNoError; | 18735 return error::kNoError; |
| 18587 } | 18736 } |
| 18588 | 18737 |
| 18589 void GLES2DecoderImpl::DoBindFragmentInputLocationCHROMIUM( | 18738 void GLES2DecoderImpl::DoBindFragmentInputLocationCHROMIUM( |
| 18590 GLuint program_id, | 18739 GLuint program_id, |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18852 } | 19001 } |
| 18853 | 19002 |
| 18854 // Include the auto-generated part of this file. We split this because it means | 19003 // Include the auto-generated part of this file. We split this because it means |
| 18855 // we can easily edit the non-auto generated parts right here in this file | 19004 // we can easily edit the non-auto generated parts right here in this file |
| 18856 // instead of having to edit some template or the code generator. | 19005 // instead of having to edit some template or the code generator. |
| 18857 #include "base/macros.h" | 19006 #include "base/macros.h" |
| 18858 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19007 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 18859 | 19008 |
| 18860 } // namespace gles2 | 19009 } // namespace gles2 |
| 18861 } // namespace gpu | 19010 } // namespace gpu |
| OLD | NEW |