Chromium Code Reviews| 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); | |
|
Zhenyao Mo
2016/11/16 03:27:27
may_need_workaround should always be true. i.e.,
| |
| 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); | |
|
Zhenyao Mo
2016/11/16 03:27:27
Same here, see my comments below.
| |
| 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( | |
|
Zhenyao Mo
2016/11/16 03:27:28
It should really be AdjustReadBufferAndDrawBuffers
| |
| 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 && |
|
Zhenyao Mo
2016/11/16 03:27:27
This is wrong. See below.
| |
| 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)) | |
|
Zhenyao Mo
2016/11/16 03:27:28
This is very wrong. It's not just the image that
| |
| 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) { | |
|
Zhenyao Mo
2016/11/16 03:27:27
No need for this function.
| |
| 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 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13822 return; | 13968 return; |
| 13823 } | 13969 } |
| 13824 if (!texture_manager()->ValidForTarget(target, level, width, height, 1) || | 13970 if (!texture_manager()->ValidForTarget(target, level, width, height, 1) || |
| 13825 border != 0) { | 13971 border != 0) { |
| 13826 LOCAL_SET_GL_ERROR( | 13972 LOCAL_SET_GL_ERROR( |
| 13827 GL_INVALID_VALUE, func_name, "dimensions out of range"); | 13973 GL_INVALID_VALUE, func_name, "dimensions out of range"); |
| 13828 return; | 13974 return; |
| 13829 } | 13975 } |
| 13830 | 13976 |
| 13831 if (!CheckBoundReadFramebufferValid(func_name, | 13977 if (!CheckBoundReadFramebufferValid(func_name, |
| 13832 GL_INVALID_FRAMEBUFFER_OPERATION)) { | 13978 GL_INVALID_FRAMEBUFFER_OPERATION, |
| 13979 true)) { | |
| 13833 return; | 13980 return; |
| 13834 } | 13981 } |
| 13835 | 13982 |
| 13836 GLenum read_format = GetBoundReadFramebufferInternalFormat(); | 13983 GLenum read_format = GetBoundReadFramebufferInternalFormat(); |
| 13837 GLenum read_type = GetBoundReadFramebufferTextureType(); | 13984 GLenum read_type = GetBoundReadFramebufferTextureType(); |
| 13838 if (!ValidateCopyTexFormat(func_name, internal_format, | 13985 if (!ValidateCopyTexFormat(func_name, internal_format, |
| 13839 read_format, read_type)) { | 13986 read_format, read_type)) { |
| 13840 return; | 13987 return; |
| 13841 } | 13988 } |
| 13842 | 13989 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14069 GLenum type = 0; | 14216 GLenum type = 0; |
| 14070 GLenum internal_format = 0; | 14217 GLenum internal_format = 0; |
| 14071 if (!texture->GetLevelType(target, level, &type, &internal_format) || | 14218 if (!texture->GetLevelType(target, level, &type, &internal_format) || |
| 14072 !texture->ValidForTexture( | 14219 !texture->ValidForTexture( |
| 14073 target, level, xoffset, yoffset, 0, width, height, 1)) { | 14220 target, level, xoffset, yoffset, 0, width, height, 1)) { |
| 14074 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "bad dimensions."); | 14221 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "bad dimensions."); |
| 14075 return; | 14222 return; |
| 14076 } | 14223 } |
| 14077 | 14224 |
| 14078 if (!CheckBoundReadFramebufferValid(func_name, | 14225 if (!CheckBoundReadFramebufferValid(func_name, |
| 14079 GL_INVALID_FRAMEBUFFER_OPERATION)) { | 14226 GL_INVALID_FRAMEBUFFER_OPERATION, |
| 14227 true)) { | |
| 14080 return; | 14228 return; |
| 14081 } | 14229 } |
| 14082 | 14230 |
| 14083 GLenum read_format = GetBoundReadFramebufferInternalFormat(); | 14231 GLenum read_format = GetBoundReadFramebufferInternalFormat(); |
| 14084 GLenum read_type = GetBoundReadFramebufferTextureType(); | 14232 GLenum read_type = GetBoundReadFramebufferTextureType(); |
| 14085 if (!ValidateCopyTexFormat(func_name, internal_format, | 14233 if (!ValidateCopyTexFormat(func_name, internal_format, |
| 14086 read_format, read_type)) { | 14234 read_format, read_type)) { |
| 14087 return; | 14235 return; |
| 14088 } | 14236 } |
| 14089 | 14237 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14185 GLenum type = 0; | 14333 GLenum type = 0; |
| 14186 GLenum internal_format = 0; | 14334 GLenum internal_format = 0; |
| 14187 if (!texture->GetLevelType(target, level, &type, &internal_format) || | 14335 if (!texture->GetLevelType(target, level, &type, &internal_format) || |
| 14188 !texture->ValidForTexture( | 14336 !texture->ValidForTexture( |
| 14189 target, level, xoffset, yoffset, zoffset, width, height, 1)) { | 14337 target, level, xoffset, yoffset, zoffset, width, height, 1)) { |
| 14190 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "bad dimensions."); | 14338 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "bad dimensions."); |
| 14191 return; | 14339 return; |
| 14192 } | 14340 } |
| 14193 | 14341 |
| 14194 if (!CheckBoundReadFramebufferValid(func_name, | 14342 if (!CheckBoundReadFramebufferValid(func_name, |
| 14195 GL_INVALID_FRAMEBUFFER_OPERATION)) { | 14343 GL_INVALID_FRAMEBUFFER_OPERATION, |
| 14344 true)) { | |
| 14196 return; | 14345 return; |
| 14197 } | 14346 } |
| 14198 | 14347 |
| 14199 GLenum read_format = GetBoundReadFramebufferInternalFormat(); | 14348 GLenum read_format = GetBoundReadFramebufferInternalFormat(); |
| 14200 GLenum read_type = GetBoundReadFramebufferTextureType(); | 14349 GLenum read_type = GetBoundReadFramebufferTextureType(); |
| 14201 if (!ValidateCopyTexFormat(func_name, internal_format, | 14350 if (!ValidateCopyTexFormat(func_name, internal_format, |
| 14202 read_format, read_type)) { | 14351 read_format, read_type)) { |
| 14203 return; | 14352 return; |
| 14204 } | 14353 } |
| 14205 | 14354 |
| (...skipping 3990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 18196 GLuint mask = 0; | 18345 GLuint mask = 0; |
| 18197 if (!v.GetFillModeAndMask(c, &fill_mode, &mask)) | 18346 if (!v.GetFillModeAndMask(c, &fill_mode, &mask)) |
| 18198 return v.error(); | 18347 return v.error(); |
| 18199 GLuint service_id = 0; | 18348 GLuint service_id = 0; |
| 18200 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { | 18349 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { |
| 18201 // "If /path/ does not name an existing path object, the command does | 18350 // "If /path/ does not name an existing path object, the command does |
| 18202 // nothing (and no error is generated)." | 18351 // nothing (and no error is generated)." |
| 18203 // This holds for other rendering functions, too. | 18352 // This holds for other rendering functions, too. |
| 18204 return error::kNoError; | 18353 return error::kNoError; |
| 18205 } | 18354 } |
| 18206 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18355 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18207 return error::kNoError; | 18356 return error::kNoError; |
| 18208 ApplyDirtyState(); | 18357 ApplyDirtyState(); |
| 18209 glStencilFillPathNV(service_id, fill_mode, mask); | 18358 glStencilFillPathNV(service_id, fill_mode, mask); |
| 18210 return error::kNoError; | 18359 return error::kNoError; |
| 18211 } | 18360 } |
| 18212 | 18361 |
| 18213 error::Error GLES2DecoderImpl::HandleStencilStrokePathCHROMIUM( | 18362 error::Error GLES2DecoderImpl::HandleStencilStrokePathCHROMIUM( |
| 18214 uint32_t immediate_data_size, | 18363 uint32_t immediate_data_size, |
| 18215 const volatile void* cmd_data) { | 18364 const volatile void* cmd_data) { |
| 18216 static const char kFunctionName[] = "glStencilStrokePathCHROMIUM"; | 18365 static const char kFunctionName[] = "glStencilStrokePathCHROMIUM"; |
| 18217 const volatile gles2::cmds::StencilStrokePathCHROMIUM& c = | 18366 const volatile gles2::cmds::StencilStrokePathCHROMIUM& c = |
| 18218 *static_cast<const volatile gles2::cmds::StencilStrokePathCHROMIUM*>( | 18367 *static_cast<const volatile gles2::cmds::StencilStrokePathCHROMIUM*>( |
| 18219 cmd_data); | 18368 cmd_data); |
| 18220 if (!features().chromium_path_rendering) | 18369 if (!features().chromium_path_rendering) |
| 18221 return error::kUnknownCommand; | 18370 return error::kUnknownCommand; |
| 18222 | 18371 |
| 18223 GLuint service_id = 0; | 18372 GLuint service_id = 0; |
| 18224 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { | 18373 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { |
| 18225 return error::kNoError; | 18374 return error::kNoError; |
| 18226 } | 18375 } |
| 18227 GLint reference = static_cast<GLint>(c.reference); | 18376 GLint reference = static_cast<GLint>(c.reference); |
| 18228 GLuint mask = static_cast<GLuint>(c.mask); | 18377 GLuint mask = static_cast<GLuint>(c.mask); |
| 18229 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18378 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18230 return error::kNoError; | 18379 return error::kNoError; |
| 18231 ApplyDirtyState(); | 18380 ApplyDirtyState(); |
| 18232 glStencilStrokePathNV(service_id, reference, mask); | 18381 glStencilStrokePathNV(service_id, reference, mask); |
| 18233 return error::kNoError; | 18382 return error::kNoError; |
| 18234 } | 18383 } |
| 18235 | 18384 |
| 18236 error::Error GLES2DecoderImpl::HandleCoverFillPathCHROMIUM( | 18385 error::Error GLES2DecoderImpl::HandleCoverFillPathCHROMIUM( |
| 18237 uint32_t immediate_data_size, | 18386 uint32_t immediate_data_size, |
| 18238 const volatile void* cmd_data) { | 18387 const volatile void* cmd_data) { |
| 18239 static const char kFunctionName[] = "glCoverFillPathCHROMIUM"; | 18388 static const char kFunctionName[] = "glCoverFillPathCHROMIUM"; |
| 18240 const volatile gles2::cmds::CoverFillPathCHROMIUM& c = | 18389 const volatile gles2::cmds::CoverFillPathCHROMIUM& c = |
| 18241 *static_cast<const volatile gles2::cmds::CoverFillPathCHROMIUM*>( | 18390 *static_cast<const volatile gles2::cmds::CoverFillPathCHROMIUM*>( |
| 18242 cmd_data); | 18391 cmd_data); |
| 18243 if (!features().chromium_path_rendering) | 18392 if (!features().chromium_path_rendering) |
| 18244 return error::kUnknownCommand; | 18393 return error::kUnknownCommand; |
| 18245 | 18394 |
| 18246 PathCommandValidatorContext v(this, kFunctionName); | 18395 PathCommandValidatorContext v(this, kFunctionName); |
| 18247 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 18396 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 18248 if (!v.GetCoverMode(c, &cover_mode)) | 18397 if (!v.GetCoverMode(c, &cover_mode)) |
| 18249 return v.error(); | 18398 return v.error(); |
| 18250 | 18399 |
| 18251 GLuint service_id = 0; | 18400 GLuint service_id = 0; |
| 18252 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 18401 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 18253 return error::kNoError; | 18402 return error::kNoError; |
| 18254 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18403 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18255 return error::kNoError; | 18404 return error::kNoError; |
| 18256 ApplyDirtyState(); | 18405 ApplyDirtyState(); |
| 18257 glCoverFillPathNV(service_id, cover_mode); | 18406 glCoverFillPathNV(service_id, cover_mode); |
| 18258 return error::kNoError; | 18407 return error::kNoError; |
| 18259 } | 18408 } |
| 18260 | 18409 |
| 18261 error::Error GLES2DecoderImpl::HandleCoverStrokePathCHROMIUM( | 18410 error::Error GLES2DecoderImpl::HandleCoverStrokePathCHROMIUM( |
| 18262 uint32_t immediate_data_size, | 18411 uint32_t immediate_data_size, |
| 18263 const volatile void* cmd_data) { | 18412 const volatile void* cmd_data) { |
| 18264 static const char kFunctionName[] = "glCoverStrokePathCHROMIUM"; | 18413 static const char kFunctionName[] = "glCoverStrokePathCHROMIUM"; |
| 18265 const volatile gles2::cmds::CoverStrokePathCHROMIUM& c = | 18414 const volatile gles2::cmds::CoverStrokePathCHROMIUM& c = |
| 18266 *static_cast<const volatile gles2::cmds::CoverStrokePathCHROMIUM*>( | 18415 *static_cast<const volatile gles2::cmds::CoverStrokePathCHROMIUM*>( |
| 18267 cmd_data); | 18416 cmd_data); |
| 18268 if (!features().chromium_path_rendering) | 18417 if (!features().chromium_path_rendering) |
| 18269 return error::kUnknownCommand; | 18418 return error::kUnknownCommand; |
| 18270 | 18419 |
| 18271 PathCommandValidatorContext v(this, kFunctionName); | 18420 PathCommandValidatorContext v(this, kFunctionName); |
| 18272 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 18421 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 18273 if (!v.GetCoverMode(c, &cover_mode)) | 18422 if (!v.GetCoverMode(c, &cover_mode)) |
| 18274 return v.error(); | 18423 return v.error(); |
| 18275 | 18424 |
| 18276 GLuint service_id = 0; | 18425 GLuint service_id = 0; |
| 18277 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 18426 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 18278 return error::kNoError; | 18427 return error::kNoError; |
| 18279 | 18428 |
| 18280 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18429 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18281 return error::kNoError; | 18430 return error::kNoError; |
| 18282 ApplyDirtyState(); | 18431 ApplyDirtyState(); |
| 18283 glCoverStrokePathNV(service_id, cover_mode); | 18432 glCoverStrokePathNV(service_id, cover_mode); |
| 18284 return error::kNoError; | 18433 return error::kNoError; |
| 18285 } | 18434 } |
| 18286 | 18435 |
| 18287 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathCHROMIUM( | 18436 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathCHROMIUM( |
| 18288 uint32_t immediate_data_size, | 18437 uint32_t immediate_data_size, |
| 18289 const volatile void* cmd_data) { | 18438 const volatile void* cmd_data) { |
| 18290 static const char kFunctionName[] = "glStencilThenCoverFillPathCHROMIUM"; | 18439 static const char kFunctionName[] = "glStencilThenCoverFillPathCHROMIUM"; |
| 18291 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM& c = | 18440 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM& c = |
| 18292 *static_cast< | 18441 *static_cast< |
| 18293 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM*>( | 18442 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM*>( |
| 18294 cmd_data); | 18443 cmd_data); |
| 18295 if (!features().chromium_path_rendering) | 18444 if (!features().chromium_path_rendering) |
| 18296 return error::kUnknownCommand; | 18445 return error::kUnknownCommand; |
| 18297 | 18446 |
| 18298 PathCommandValidatorContext v(this, kFunctionName); | 18447 PathCommandValidatorContext v(this, kFunctionName); |
| 18299 GLenum fill_mode = GL_COUNT_UP_CHROMIUM; | 18448 GLenum fill_mode = GL_COUNT_UP_CHROMIUM; |
| 18300 GLuint mask = 0; | 18449 GLuint mask = 0; |
| 18301 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 18450 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 18302 if (!v.GetFillModeAndMask(c, &fill_mode, &mask) || | 18451 if (!v.GetFillModeAndMask(c, &fill_mode, &mask) || |
| 18303 !v.GetCoverMode(c, &cover_mode)) | 18452 !v.GetCoverMode(c, &cover_mode)) |
| 18304 return v.error(); | 18453 return v.error(); |
| 18305 | 18454 |
| 18306 GLuint service_id = 0; | 18455 GLuint service_id = 0; |
| 18307 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 18456 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 18308 return error::kNoError; | 18457 return error::kNoError; |
| 18309 | 18458 |
| 18310 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18459 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18311 return error::kNoError; | 18460 return error::kNoError; |
| 18312 ApplyDirtyState(); | 18461 ApplyDirtyState(); |
| 18313 glStencilThenCoverFillPathNV(service_id, fill_mode, mask, cover_mode); | 18462 glStencilThenCoverFillPathNV(service_id, fill_mode, mask, cover_mode); |
| 18314 return error::kNoError; | 18463 return error::kNoError; |
| 18315 } | 18464 } |
| 18316 | 18465 |
| 18317 error::Error GLES2DecoderImpl::HandleStencilThenCoverStrokePathCHROMIUM( | 18466 error::Error GLES2DecoderImpl::HandleStencilThenCoverStrokePathCHROMIUM( |
| 18318 uint32_t immediate_data_size, | 18467 uint32_t immediate_data_size, |
| 18319 const volatile void* cmd_data) { | 18468 const volatile void* cmd_data) { |
| 18320 static const char kFunctionName[] = "glStencilThenCoverStrokePathCHROMIUM"; | 18469 static const char kFunctionName[] = "glStencilThenCoverStrokePathCHROMIUM"; |
| 18321 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM& c = | 18470 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM& c = |
| 18322 *static_cast< | 18471 *static_cast< |
| 18323 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM*>( | 18472 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM*>( |
| 18324 cmd_data); | 18473 cmd_data); |
| 18325 if (!features().chromium_path_rendering) | 18474 if (!features().chromium_path_rendering) |
| 18326 return error::kUnknownCommand; | 18475 return error::kUnknownCommand; |
| 18327 | 18476 |
| 18328 PathCommandValidatorContext v(this, kFunctionName); | 18477 PathCommandValidatorContext v(this, kFunctionName); |
| 18329 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 18478 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 18330 if (!v.GetCoverMode(c, &cover_mode)) | 18479 if (!v.GetCoverMode(c, &cover_mode)) |
| 18331 return v.error(); | 18480 return v.error(); |
| 18332 | 18481 |
| 18333 GLuint service_id = 0; | 18482 GLuint service_id = 0; |
| 18334 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 18483 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 18335 return error::kNoError; | 18484 return error::kNoError; |
| 18336 | 18485 |
| 18337 GLint reference = static_cast<GLint>(c.reference); | 18486 GLint reference = static_cast<GLint>(c.reference); |
| 18338 GLuint mask = static_cast<GLuint>(c.mask); | 18487 GLuint mask = static_cast<GLuint>(c.mask); |
| 18339 | 18488 |
| 18340 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18489 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18341 return error::kNoError; | 18490 return error::kNoError; |
| 18342 ApplyDirtyState(); | 18491 ApplyDirtyState(); |
| 18343 glStencilThenCoverStrokePathNV(service_id, reference, mask, cover_mode); | 18492 glStencilThenCoverStrokePathNV(service_id, reference, mask, cover_mode); |
| 18344 return error::kNoError; | 18493 return error::kNoError; |
| 18345 } | 18494 } |
| 18346 | 18495 |
| 18347 error::Error GLES2DecoderImpl::HandleStencilFillPathInstancedCHROMIUM( | 18496 error::Error GLES2DecoderImpl::HandleStencilFillPathInstancedCHROMIUM( |
| 18348 uint32_t immediate_data_size, | 18497 uint32_t immediate_data_size, |
| 18349 const volatile void* cmd_data) { | 18498 const volatile void* cmd_data) { |
| 18350 static const char kFunctionName[] = "glStencilFillPathInstancedCHROMIUM"; | 18499 static const char kFunctionName[] = "glStencilFillPathInstancedCHROMIUM"; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 18370 return error::kNoError; | 18519 return error::kNoError; |
| 18371 | 18520 |
| 18372 std::unique_ptr<GLuint[]> paths; | 18521 std::unique_ptr<GLuint[]> paths; |
| 18373 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18522 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18374 return v.error(); | 18523 return v.error(); |
| 18375 | 18524 |
| 18376 const GLfloat* transforms = nullptr; | 18525 const GLfloat* transforms = nullptr; |
| 18377 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18526 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18378 return v.error(); | 18527 return v.error(); |
| 18379 | 18528 |
| 18380 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18529 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18381 return error::kNoError; | 18530 return error::kNoError; |
| 18382 ApplyDirtyState(); | 18531 ApplyDirtyState(); |
| 18383 glStencilFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 18532 glStencilFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 18384 fill_mode, mask, transform_type, transforms); | 18533 fill_mode, mask, transform_type, transforms); |
| 18385 return error::kNoError; | 18534 return error::kNoError; |
| 18386 } | 18535 } |
| 18387 | 18536 |
| 18388 error::Error GLES2DecoderImpl::HandleStencilStrokePathInstancedCHROMIUM( | 18537 error::Error GLES2DecoderImpl::HandleStencilStrokePathInstancedCHROMIUM( |
| 18389 uint32_t immediate_data_size, | 18538 uint32_t immediate_data_size, |
| 18390 const volatile void* cmd_data) { | 18539 const volatile void* cmd_data) { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 18410 std::unique_ptr<GLuint[]> paths; | 18559 std::unique_ptr<GLuint[]> paths; |
| 18411 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18560 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18412 return v.error(); | 18561 return v.error(); |
| 18413 | 18562 |
| 18414 const GLfloat* transforms = nullptr; | 18563 const GLfloat* transforms = nullptr; |
| 18415 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18564 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18416 return v.error(); | 18565 return v.error(); |
| 18417 | 18566 |
| 18418 GLint reference = static_cast<GLint>(c.reference); | 18567 GLint reference = static_cast<GLint>(c.reference); |
| 18419 GLuint mask = static_cast<GLuint>(c.mask); | 18568 GLuint mask = static_cast<GLuint>(c.mask); |
| 18420 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18569 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18421 return error::kNoError; | 18570 return error::kNoError; |
| 18422 ApplyDirtyState(); | 18571 ApplyDirtyState(); |
| 18423 glStencilStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 18572 glStencilStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 18424 reference, mask, transform_type, transforms); | 18573 reference, mask, transform_type, transforms); |
| 18425 return error::kNoError; | 18574 return error::kNoError; |
| 18426 } | 18575 } |
| 18427 | 18576 |
| 18428 error::Error GLES2DecoderImpl::HandleCoverFillPathInstancedCHROMIUM( | 18577 error::Error GLES2DecoderImpl::HandleCoverFillPathInstancedCHROMIUM( |
| 18429 uint32_t immediate_data_size, | 18578 uint32_t immediate_data_size, |
| 18430 const volatile void* cmd_data) { | 18579 const volatile void* cmd_data) { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 18449 return error::kNoError; | 18598 return error::kNoError; |
| 18450 | 18599 |
| 18451 std::unique_ptr<GLuint[]> paths; | 18600 std::unique_ptr<GLuint[]> paths; |
| 18452 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18601 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18453 return v.error(); | 18602 return v.error(); |
| 18454 | 18603 |
| 18455 const GLfloat* transforms = nullptr; | 18604 const GLfloat* transforms = nullptr; |
| 18456 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18605 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18457 return v.error(); | 18606 return v.error(); |
| 18458 | 18607 |
| 18459 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18608 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18460 return error::kNoError; | 18609 return error::kNoError; |
| 18461 ApplyDirtyState(); | 18610 ApplyDirtyState(); |
| 18462 glCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 18611 glCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 18463 cover_mode, transform_type, transforms); | 18612 cover_mode, transform_type, transforms); |
| 18464 return error::kNoError; | 18613 return error::kNoError; |
| 18465 } | 18614 } |
| 18466 | 18615 |
| 18467 error::Error GLES2DecoderImpl::HandleCoverStrokePathInstancedCHROMIUM( | 18616 error::Error GLES2DecoderImpl::HandleCoverStrokePathInstancedCHROMIUM( |
| 18468 uint32_t immediate_data_size, | 18617 uint32_t immediate_data_size, |
| 18469 const volatile void* cmd_data) { | 18618 const volatile void* cmd_data) { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 18489 return error::kNoError; | 18638 return error::kNoError; |
| 18490 | 18639 |
| 18491 std::unique_ptr<GLuint[]> paths; | 18640 std::unique_ptr<GLuint[]> paths; |
| 18492 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18641 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18493 return v.error(); | 18642 return v.error(); |
| 18494 | 18643 |
| 18495 const GLfloat* transforms = nullptr; | 18644 const GLfloat* transforms = nullptr; |
| 18496 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18645 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18497 return v.error(); | 18646 return v.error(); |
| 18498 | 18647 |
| 18499 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18648 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18500 return error::kNoError; | 18649 return error::kNoError; |
| 18501 ApplyDirtyState(); | 18650 ApplyDirtyState(); |
| 18502 glCoverStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 18651 glCoverStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 18503 cover_mode, transform_type, transforms); | 18652 cover_mode, transform_type, transforms); |
| 18504 return error::kNoError; | 18653 return error::kNoError; |
| 18505 } | 18654 } |
| 18506 | 18655 |
| 18507 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathInstancedCHROMIUM( | 18656 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathInstancedCHROMIUM( |
| 18508 uint32_t immediate_data_size, | 18657 uint32_t immediate_data_size, |
| 18509 const volatile void* cmd_data) { | 18658 const volatile void* cmd_data) { |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 18532 return error::kNoError; | 18681 return error::kNoError; |
| 18533 | 18682 |
| 18534 std::unique_ptr<GLuint[]> paths; | 18683 std::unique_ptr<GLuint[]> paths; |
| 18535 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18684 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18536 return v.error(); | 18685 return v.error(); |
| 18537 | 18686 |
| 18538 const GLfloat* transforms = nullptr; | 18687 const GLfloat* transforms = nullptr; |
| 18539 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18688 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18540 return v.error(); | 18689 return v.error(); |
| 18541 | 18690 |
| 18542 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18691 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18543 return error::kNoError; | 18692 return error::kNoError; |
| 18544 ApplyDirtyState(); | 18693 ApplyDirtyState(); |
| 18545 glStencilThenCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), | 18694 glStencilThenCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), |
| 18546 0, fill_mode, mask, cover_mode, | 18695 0, fill_mode, mask, cover_mode, |
| 18547 transform_type, transforms); | 18696 transform_type, transforms); |
| 18548 return error::kNoError; | 18697 return error::kNoError; |
| 18549 } | 18698 } |
| 18550 | 18699 |
| 18551 error::Error | 18700 error::Error |
| 18552 GLES2DecoderImpl::HandleStencilThenCoverStrokePathInstancedCHROMIUM( | 18701 GLES2DecoderImpl::HandleStencilThenCoverStrokePathInstancedCHROMIUM( |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 18576 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 18725 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 18577 return v.error(); | 18726 return v.error(); |
| 18578 | 18727 |
| 18579 const GLfloat* transforms = nullptr; | 18728 const GLfloat* transforms = nullptr; |
| 18580 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 18729 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 18581 return v.error(); | 18730 return v.error(); |
| 18582 | 18731 |
| 18583 GLint reference = static_cast<GLint>(c.reference); | 18732 GLint reference = static_cast<GLint>(c.reference); |
| 18584 GLuint mask = static_cast<GLuint>(c.mask); | 18733 GLuint mask = static_cast<GLuint>(c.mask); |
| 18585 | 18734 |
| 18586 if (!CheckBoundDrawFramebufferValid(kFunctionName)) | 18735 if (!CheckBoundDrawFramebufferValid(kFunctionName, false)) |
| 18587 return error::kNoError; | 18736 return error::kNoError; |
| 18588 ApplyDirtyState(); | 18737 ApplyDirtyState(); |
| 18589 glStencilThenCoverStrokePathInstancedNV( | 18738 glStencilThenCoverStrokePathInstancedNV( |
| 18590 num_paths, GL_UNSIGNED_INT, paths.get(), 0, reference, mask, cover_mode, | 18739 num_paths, GL_UNSIGNED_INT, paths.get(), 0, reference, mask, cover_mode, |
| 18591 transform_type, transforms); | 18740 transform_type, transforms); |
| 18592 return error::kNoError; | 18741 return error::kNoError; |
| 18593 } | 18742 } |
| 18594 | 18743 |
| 18595 void GLES2DecoderImpl::DoBindFragmentInputLocationCHROMIUM( | 18744 void GLES2DecoderImpl::DoBindFragmentInputLocationCHROMIUM( |
| 18596 GLuint program_id, | 18745 GLuint program_id, |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 18858 } | 19007 } |
| 18859 | 19008 |
| 18860 // Include the auto-generated part of this file. We split this because it means | 19009 // Include the auto-generated part of this file. We split this because it means |
| 18861 // we can easily edit the non-auto generated parts right here in this file | 19010 // we can easily edit the non-auto generated parts right here in this file |
| 18862 // instead of having to edit some template or the code generator. | 19011 // instead of having to edit some template or the code generator. |
| 18863 #include "base/macros.h" | 19012 #include "base/macros.h" |
| 18864 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19013 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 18865 | 19014 |
| 18866 } // namespace gles2 | 19015 } // namespace gles2 |
| 18867 } // namespace gpu | 19016 } // namespace gpu |
| OLD | NEW |