| 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 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1331 | 1331 |
| 1332 // Check that the currently bound read framebuffer's color image | 1332 // Check that the currently bound read framebuffer's color image |
| 1333 // isn't the target texture of the glCopyTex{Sub}Image2D. | 1333 // isn't the target texture of the glCopyTex{Sub}Image2D. |
| 1334 bool FormsTextureCopyingFeedbackLoop(TextureRef* texture, GLint level); | 1334 bool FormsTextureCopyingFeedbackLoop(TextureRef* texture, GLint level); |
| 1335 | 1335 |
| 1336 // Check if a framebuffer meets our requirements. | 1336 // Check if a framebuffer meets our requirements. |
| 1337 // Generates |gl_error| if the framebuffer is incomplete. | 1337 // Generates |gl_error| if the framebuffer is incomplete. |
| 1338 bool CheckFramebufferValid( | 1338 bool CheckFramebufferValid( |
| 1339 Framebuffer* framebuffer, | 1339 Framebuffer* framebuffer, |
| 1340 GLenum target, | 1340 GLenum target, |
| 1341 bool clear_uncleared_images, | |
| 1342 GLenum gl_error, | 1341 GLenum gl_error, |
| 1343 const char* func_name); | 1342 const char* func_name); |
| 1344 | 1343 |
| 1345 bool CheckBoundDrawFramebufferValid( | 1344 bool CheckBoundDrawFramebufferValid(const char* func_name); |
| 1346 bool clear_uncleared_images, const char* func_name); | |
| 1347 // Generates |gl_error| if the bound read fbo is incomplete. | 1345 // Generates |gl_error| if the bound read fbo is incomplete. |
| 1348 bool CheckBoundReadFramebufferValid(const char* func_name, GLenum gl_error); | 1346 bool CheckBoundReadFramebufferValid(const char* func_name, GLenum gl_error); |
| 1349 // This is only used by DoBlitFramebufferCHROMIUM which operates read/draw | 1347 // This is only used by DoBlitFramebufferCHROMIUM which operates read/draw |
| 1350 // framebuffer at the same time. | 1348 // framebuffer at the same time. |
| 1351 bool CheckBoundFramebufferValid(const char* func_name); | 1349 bool CheckBoundFramebufferValid(const char* func_name); |
| 1352 | 1350 |
| 1353 // Checks if the current program exists and is valid. If not generates the | 1351 // Checks if the current program exists and is valid. If not generates the |
| 1354 // appropriate GL error. Returns true if the current program is in a usable | 1352 // appropriate GL error. Returns true if the current program is in a usable |
| 1355 // state. | 1353 // state. |
| 1356 bool CheckCurrentProgram(const char* function_name); | 1354 bool CheckCurrentProgram(const char* function_name); |
| 1357 | 1355 |
| 1358 // Checks if the current program exists and is valid and that location is not | 1356 // Checks if the current program exists and is valid and that location is not |
| 1359 // -1. If the current program is not valid generates the appropriate GL | 1357 // -1. If the current program is not valid generates the appropriate GL |
| 1360 // error. Returns true if the current program is in a usable state and | 1358 // error. Returns true if the current program is in a usable state and |
| 1361 // location is not -1. | 1359 // location is not -1. |
| 1362 bool CheckCurrentProgramForUniform(GLint location, const char* function_name); | 1360 bool CheckCurrentProgramForUniform(GLint location, const char* function_name); |
| 1363 | 1361 |
| 1364 // Checks if the current program samples a texture that is also the color | 1362 // Checks if the current program samples a texture that is also the color |
| 1365 // image of the current bound framebuffer, i.e., the source and destination | 1363 // image of the current bound framebuffer, i.e., the source and destination |
| 1366 // of the draw operation are the same. | 1364 // of the draw operation are the same. |
| 1367 bool CheckDrawingFeedbackLoops(); | 1365 bool CheckDrawingFeedbackLoops(); |
| 1368 | 1366 |
| 1367 bool SupportsDrawBuffers() const; |
| 1368 |
| 1369 // Checks if a draw buffer's format and its corresponding fragment shader |
| 1370 // output's type are compatible, i.e., a signed integer typed variable is |
| 1371 // incompatible with a float or unsigned integer buffer. |
| 1372 // If incompaticle, generates an INVALID_OPERATION to avoid undefined buffer |
| 1373 // contents and return false. |
| 1374 // Otherwise, filter out the draw buffers that are not written to but are not |
| 1375 // NONE through DrawBuffers, to be on the safe side. Return true. |
| 1376 bool ValidateAndAdjustDrawBuffers(const char* function_name); |
| 1377 |
| 1378 // This is similar to ValidateAndAdjustDrawBuffers(), except that it does not |
| 1379 // do the validation of drawe buffer format and fragment output type match. |
| 1380 // It only adjusts a draw buffer to NONE if it doesn't have an image or the |
| 1381 // image is integer format. |
| 1382 // This is only for Clear() to avoid undefined buffer contents. |
| 1383 void AdjustDrawBuffers(); |
| 1384 |
| 1369 // Checks if |api_type| is valid for the given uniform | 1385 // Checks if |api_type| is valid for the given uniform |
| 1370 // If the api type is not valid generates the appropriate GL | 1386 // If the api type is not valid generates the appropriate GL |
| 1371 // error. Returns true if |api_type| is valid for the uniform | 1387 // error. Returns true if |api_type| is valid for the uniform |
| 1372 bool CheckUniformForApiType(const Program::UniformInfo* info, | 1388 bool CheckUniformForApiType(const Program::UniformInfo* info, |
| 1373 const char* function_name, | 1389 const char* function_name, |
| 1374 Program::UniformApiType api_type); | 1390 Program::UniformApiType api_type); |
| 1375 | 1391 |
| 1376 // Gets the type of a uniform for a location in the current program. Sets GL | 1392 // Gets the type of a uniform for a location in the current program. Sets GL |
| 1377 // errors if the current program is not valid. Returns true if the current | 1393 // errors if the current program is not valid. Returns true if the current |
| 1378 // program is valid and the location exists. Adjusts count so it | 1394 // program is valid and the location exists. Adjusts count so it |
| (...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4091 GL_DRAW_FRAMEBUFFER_EXT, | 4107 GL_DRAW_FRAMEBUFFER_EXT, |
| 4092 framebuffer_state_.bound_draw_framebuffer.get(), | 4108 framebuffer_state_.bound_draw_framebuffer.get(), |
| 4093 GetBackbufferServiceId()); | 4109 GetBackbufferServiceId()); |
| 4094 } | 4110 } |
| 4095 OnFboChanged(); | 4111 OnFboChanged(); |
| 4096 } | 4112 } |
| 4097 | 4113 |
| 4098 bool GLES2DecoderImpl::CheckFramebufferValid( | 4114 bool GLES2DecoderImpl::CheckFramebufferValid( |
| 4099 Framebuffer* framebuffer, | 4115 Framebuffer* framebuffer, |
| 4100 GLenum target, | 4116 GLenum target, |
| 4101 bool clear_uncleared_images, | |
| 4102 GLenum gl_error, | 4117 GLenum gl_error, |
| 4103 const char* func_name) { | 4118 const char* func_name) { |
| 4104 if (!framebuffer) { | 4119 if (!framebuffer) { |
| 4105 if (surfaceless_) | 4120 if (surfaceless_) |
| 4106 return false; | 4121 return false; |
| 4107 if (backbuffer_needs_clear_bits_ && clear_uncleared_images) { | 4122 if (backbuffer_needs_clear_bits_) { |
| 4108 glClearColor(0, 0, 0, BackBufferAlphaClearColor()); | 4123 glClearColor(0, 0, 0, BackBufferAlphaClearColor()); |
| 4109 state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); | 4124 state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |
| 4110 glClearStencil(0); | 4125 glClearStencil(0); |
| 4111 state_.SetDeviceStencilMaskSeparate(GL_FRONT, kDefaultStencilMask); | 4126 state_.SetDeviceStencilMaskSeparate(GL_FRONT, kDefaultStencilMask); |
| 4112 state_.SetDeviceStencilMaskSeparate(GL_BACK, kDefaultStencilMask); | 4127 state_.SetDeviceStencilMaskSeparate(GL_BACK, kDefaultStencilMask); |
| 4113 glClearDepth(1.0f); | 4128 glClearDepth(1.0f); |
| 4114 state_.SetDeviceDepthMask(GL_TRUE); | 4129 state_.SetDeviceDepthMask(GL_TRUE); |
| 4115 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false); | 4130 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false); |
| 4116 bool reset_draw_buffer = false; | 4131 bool reset_draw_buffer = false; |
| 4117 if ((backbuffer_needs_clear_bits_ & GL_COLOR_BUFFER_BIT) != 0 && | 4132 if ((backbuffer_needs_clear_bits_ & GL_COLOR_BUFFER_BIT) != 0 && |
| (...skipping 25 matching lines...) Expand all Loading... |
| 4143 if (framebuffer->GetStatus(texture_manager(), target) != | 4158 if (framebuffer->GetStatus(texture_manager(), target) != |
| 4144 GL_FRAMEBUFFER_COMPLETE) { | 4159 GL_FRAMEBUFFER_COMPLETE) { |
| 4145 LOCAL_SET_GL_ERROR( | 4160 LOCAL_SET_GL_ERROR( |
| 4146 gl_error, func_name, "framebuffer incomplete (check)"); | 4161 gl_error, func_name, "framebuffer incomplete (check)"); |
| 4147 return false; | 4162 return false; |
| 4148 } | 4163 } |
| 4149 framebuffer_manager()->MarkAsComplete(framebuffer); | 4164 framebuffer_manager()->MarkAsComplete(framebuffer); |
| 4150 } | 4165 } |
| 4151 | 4166 |
| 4152 // Are all the attachments cleared? | 4167 // Are all the attachments cleared? |
| 4153 if (clear_uncleared_images && | 4168 if (renderbuffer_manager()->HaveUnclearedRenderbuffers() || |
| 4154 (renderbuffer_manager()->HaveUnclearedRenderbuffers() || | 4169 texture_manager()->HaveUnclearedMips()) { |
| 4155 texture_manager()->HaveUnclearedMips())) { | |
| 4156 if (!framebuffer->IsCleared()) { | 4170 if (!framebuffer->IsCleared()) { |
| 4157 ClearUnclearedAttachments(target, framebuffer); | 4171 ClearUnclearedAttachments(target, framebuffer); |
| 4158 } | 4172 } |
| 4159 } | 4173 } |
| 4160 return true; | 4174 return true; |
| 4161 } | 4175 } |
| 4162 | 4176 |
| 4163 bool GLES2DecoderImpl::CheckBoundDrawFramebufferValid( | 4177 bool GLES2DecoderImpl::CheckBoundDrawFramebufferValid(const char* func_name) { |
| 4164 bool clear_uncleared_images, const char* func_name) { | |
| 4165 GLenum target = features().chromium_framebuffer_multisample ? | 4178 GLenum target = features().chromium_framebuffer_multisample ? |
| 4166 GL_DRAW_FRAMEBUFFER : GL_FRAMEBUFFER; | 4179 GL_DRAW_FRAMEBUFFER : GL_FRAMEBUFFER; |
| 4167 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); | 4180 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); |
| 4168 bool valid = CheckFramebufferValid( | 4181 bool valid = CheckFramebufferValid( |
| 4169 framebuffer, target, clear_uncleared_images, | 4182 framebuffer, target, GL_INVALID_FRAMEBUFFER_OPERATION, func_name); |
| 4170 GL_INVALID_FRAMEBUFFER_OPERATION, func_name); | |
| 4171 if (valid && !features().chromium_framebuffer_multisample) | 4183 if (valid && !features().chromium_framebuffer_multisample) |
| 4172 OnUseFramebuffer(); | 4184 OnUseFramebuffer(); |
| 4173 if (valid && feature_info_->feature_flags().desktop_srgb_support) { | 4185 if (valid && feature_info_->feature_flags().desktop_srgb_support) { |
| 4174 // If framebuffer contains sRGB images, then enable FRAMEBUFFER_SRGB. | 4186 // If framebuffer contains sRGB images, then enable FRAMEBUFFER_SRGB. |
| 4175 // Otherwise, disable FRAMEBUFFER_SRGB. Assume default fbo does not have | 4187 // Otherwise, disable FRAMEBUFFER_SRGB. Assume default fbo does not have |
| 4176 // sRGB image. | 4188 // sRGB image. |
| 4177 // In theory, we can just leave FRAMEBUFFER_SRGB on. However, many drivers | 4189 // In theory, we can just leave FRAMEBUFFER_SRGB on. However, many drivers |
| 4178 // behave incorrectly when all images are linear encoding, they still apply | 4190 // behave incorrectly when all images are linear encoding, they still apply |
| 4179 // the sRGB conversion, but when at least one image is sRGB, then they | 4191 // the sRGB conversion, but when at least one image is sRGB, then they |
| 4180 // behave correctly. | 4192 // behave correctly. |
| 4181 bool enable_framebuffer_srgb = | 4193 bool enable_framebuffer_srgb = |
| 4182 framebuffer && framebuffer->HasSRGBAttachments(); | 4194 framebuffer && framebuffer->HasSRGBAttachments(); |
| 4183 state_.EnableDisableFramebufferSRGB(enable_framebuffer_srgb); | 4195 state_.EnableDisableFramebufferSRGB(enable_framebuffer_srgb); |
| 4184 } | 4196 } |
| 4185 return valid; | 4197 return valid; |
| 4186 } | 4198 } |
| 4187 | 4199 |
| 4188 bool GLES2DecoderImpl::CheckBoundReadFramebufferValid( | 4200 bool GLES2DecoderImpl::CheckBoundReadFramebufferValid( |
| 4189 const char* func_name, GLenum gl_error) { | 4201 const char* func_name, GLenum gl_error) { |
| 4190 GLenum target = features().chromium_framebuffer_multisample ? | 4202 GLenum target = features().chromium_framebuffer_multisample ? |
| 4191 GL_READ_FRAMEBUFFER : GL_FRAMEBUFFER; | 4203 GL_READ_FRAMEBUFFER : GL_FRAMEBUFFER; |
| 4192 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); | 4204 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); |
| 4193 bool valid = CheckFramebufferValid( | 4205 bool valid = CheckFramebufferValid( |
| 4194 framebuffer, target, true, gl_error, func_name); | 4206 framebuffer, target, gl_error, func_name); |
| 4195 return valid; | 4207 return valid; |
| 4196 } | 4208 } |
| 4197 | 4209 |
| 4198 bool GLES2DecoderImpl::CheckBoundFramebufferValid(const char* func_name) { | 4210 bool GLES2DecoderImpl::CheckBoundFramebufferValid(const char* func_name) { |
| 4199 GLenum target = features().chromium_framebuffer_multisample ? | 4211 GLenum target = features().chromium_framebuffer_multisample ? |
| 4200 GL_DRAW_FRAMEBUFFER : GL_FRAMEBUFFER; | 4212 GL_DRAW_FRAMEBUFFER : GL_FRAMEBUFFER; |
| 4201 Framebuffer* draw_framebuffer = GetFramebufferInfoForTarget(target); | 4213 Framebuffer* draw_framebuffer = GetFramebufferInfoForTarget(target); |
| 4202 bool valid = CheckFramebufferValid( | 4214 bool valid = CheckFramebufferValid( |
| 4203 draw_framebuffer, target, true, | 4215 draw_framebuffer, target, GL_INVALID_FRAMEBUFFER_OPERATION, func_name); |
| 4204 GL_INVALID_FRAMEBUFFER_OPERATION, func_name); | |
| 4205 | 4216 |
| 4206 target = features().chromium_framebuffer_multisample ? | 4217 target = features().chromium_framebuffer_multisample ? |
| 4207 GL_READ_FRAMEBUFFER : GL_FRAMEBUFFER; | 4218 GL_READ_FRAMEBUFFER : GL_FRAMEBUFFER; |
| 4208 Framebuffer* read_framebuffer = GetFramebufferInfoForTarget(target); | 4219 Framebuffer* read_framebuffer = GetFramebufferInfoForTarget(target); |
| 4209 valid = valid && CheckFramebufferValid( | 4220 valid = valid && CheckFramebufferValid( |
| 4210 read_framebuffer, target, true, | 4221 read_framebuffer, target, GL_INVALID_FRAMEBUFFER_OPERATION, func_name); |
| 4211 GL_INVALID_FRAMEBUFFER_OPERATION, func_name); | |
| 4212 | 4222 |
| 4213 if (valid && feature_info_->feature_flags().desktop_srgb_support) { | 4223 if (valid && feature_info_->feature_flags().desktop_srgb_support) { |
| 4214 bool enable_framebuffer_srgb = | 4224 bool enable_framebuffer_srgb = |
| 4215 (draw_framebuffer && draw_framebuffer->HasSRGBAttachments()) || | 4225 (draw_framebuffer && draw_framebuffer->HasSRGBAttachments()) || |
| 4216 (read_framebuffer && read_framebuffer->HasSRGBAttachments()); | 4226 (read_framebuffer && read_framebuffer->HasSRGBAttachments()); |
| 4217 state_.EnableDisableFramebufferSRGB(enable_framebuffer_srgb); | 4227 state_.EnableDisableFramebufferSRGB(enable_framebuffer_srgb); |
| 4218 } | 4228 } |
| 4219 | 4229 |
| 4220 return valid; | 4230 return valid; |
| 4221 } | 4231 } |
| (...skipping 2582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6804 } else { | 6814 } else { |
| 6805 LOCAL_SET_GL_ERROR( | 6815 LOCAL_SET_GL_ERROR( |
| 6806 GL_INVALID_VALUE, "glDeleteProgram", "unknown program"); | 6816 GL_INVALID_VALUE, "glDeleteProgram", "unknown program"); |
| 6807 } | 6817 } |
| 6808 } | 6818 } |
| 6809 return error::kNoError; | 6819 return error::kNoError; |
| 6810 } | 6820 } |
| 6811 | 6821 |
| 6812 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) { | 6822 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) { |
| 6813 DCHECK(!ShouldDeferDraws()); | 6823 DCHECK(!ShouldDeferDraws()); |
| 6814 if (CheckBoundDrawFramebufferValid(true, "glClear")) { | 6824 if (CheckBoundDrawFramebufferValid("glClear")) { |
| 6815 ApplyDirtyState(); | 6825 ApplyDirtyState(); |
| 6816 // TODO(zmo): Filter out INTEGER/SIGNED INTEGER images to avoid | |
| 6817 // undefined results. | |
| 6818 if (workarounds().gl_clear_broken) { | 6826 if (workarounds().gl_clear_broken) { |
| 6819 ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::ClearWorkaround", | 6827 ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::ClearWorkaround", |
| 6820 GetErrorState()); | 6828 GetErrorState()); |
| 6821 if (!BoundFramebufferHasDepthAttachment()) | 6829 if (!BoundFramebufferHasDepthAttachment()) |
| 6822 mask &= ~GL_DEPTH_BUFFER_BIT; | 6830 mask &= ~GL_DEPTH_BUFFER_BIT; |
| 6823 if (!BoundFramebufferHasStencilAttachment()) | 6831 if (!BoundFramebufferHasStencilAttachment()) |
| 6824 mask &= ~GL_STENCIL_BUFFER_BIT; | 6832 mask &= ~GL_STENCIL_BUFFER_BIT; |
| 6825 clear_framebuffer_blit_->ClearFramebuffer( | 6833 clear_framebuffer_blit_->ClearFramebuffer( |
| 6826 this, GetBoundReadFrameBufferSize(), mask, state_.color_clear_red, | 6834 this, GetBoundReadFrameBufferSize(), mask, state_.color_clear_red, |
| 6827 state_.color_clear_green, state_.color_clear_blue, | 6835 state_.color_clear_green, state_.color_clear_blue, |
| 6828 state_.color_clear_alpha, state_.depth_clear, state_.stencil_clear); | 6836 state_.color_clear_alpha, state_.depth_clear, state_.stencil_clear); |
| 6829 return error::kNoError; | 6837 return error::kNoError; |
| 6830 } | 6838 } |
| 6839 AdjustDrawBuffers(); |
| 6831 glClear(mask); | 6840 glClear(mask); |
| 6832 } | 6841 } |
| 6833 return error::kNoError; | 6842 return error::kNoError; |
| 6834 } | 6843 } |
| 6835 | 6844 |
| 6836 void GLES2DecoderImpl::DoClearBufferiv( | 6845 void GLES2DecoderImpl::DoClearBufferiv( |
| 6837 GLenum buffer, GLint drawbuffer, const GLint* value) { | 6846 GLenum buffer, GLint drawbuffer, const GLint* value) { |
| 6838 // TODO(zmo): Set clear_uncleared_images=true once crbug.com/584059 is fixed. | 6847 if (!CheckBoundDrawFramebufferValid("glClearBufferiv")) |
| 6839 if (!CheckBoundDrawFramebufferValid(false, "glClearBufferiv")) | |
| 6840 return; | 6848 return; |
| 6841 ApplyDirtyState(); | 6849 ApplyDirtyState(); |
| 6842 | 6850 |
| 6843 if (buffer == GL_COLOR) { | 6851 if (buffer == GL_COLOR) { |
| 6844 if (drawbuffer < 0 || | 6852 if (drawbuffer < 0 || |
| 6845 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { | 6853 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { |
| 6846 LOCAL_SET_GL_ERROR( | 6854 LOCAL_SET_GL_ERROR( |
| 6847 GL_INVALID_VALUE, "glClearBufferiv", "invalid drawBuffer"); | 6855 GL_INVALID_VALUE, "glClearBufferiv", "invalid drawBuffer"); |
| 6848 return; | 6856 return; |
| 6849 } | 6857 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 6863 if (!BoundFramebufferHasStencilAttachment()) { | 6871 if (!BoundFramebufferHasStencilAttachment()) { |
| 6864 return; | 6872 return; |
| 6865 } | 6873 } |
| 6866 } | 6874 } |
| 6867 MarkDrawBufferAsCleared(buffer, drawbuffer); | 6875 MarkDrawBufferAsCleared(buffer, drawbuffer); |
| 6868 glClearBufferiv(buffer, drawbuffer, value); | 6876 glClearBufferiv(buffer, drawbuffer, value); |
| 6869 } | 6877 } |
| 6870 | 6878 |
| 6871 void GLES2DecoderImpl::DoClearBufferuiv( | 6879 void GLES2DecoderImpl::DoClearBufferuiv( |
| 6872 GLenum buffer, GLint drawbuffer, const GLuint* value) { | 6880 GLenum buffer, GLint drawbuffer, const GLuint* value) { |
| 6873 // TODO(zmo): Set clear_uncleared_images=true once crbug.com/584059 is fixed. | 6881 if (!CheckBoundDrawFramebufferValid("glClearBufferuiv")) |
| 6874 if (!CheckBoundDrawFramebufferValid(false, "glClearBufferuiv")) | |
| 6875 return; | 6882 return; |
| 6876 ApplyDirtyState(); | 6883 ApplyDirtyState(); |
| 6877 | 6884 |
| 6878 if (drawbuffer < 0 || | 6885 if (drawbuffer < 0 || |
| 6879 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { | 6886 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { |
| 6880 LOCAL_SET_GL_ERROR( | 6887 LOCAL_SET_GL_ERROR( |
| 6881 GL_INVALID_VALUE, "glClearBufferuiv", "invalid drawBuffer"); | 6888 GL_INVALID_VALUE, "glClearBufferuiv", "invalid drawBuffer"); |
| 6882 return; | 6889 return; |
| 6883 } | 6890 } |
| 6884 GLenum internal_format = | 6891 GLenum internal_format = |
| 6885 GetBoundColorDrawBufferInternalFormat(drawbuffer); | 6892 GetBoundColorDrawBufferInternalFormat(drawbuffer); |
| 6886 if (!GLES2Util::IsUnsignedIntegerFormat(internal_format)) { | 6893 if (!GLES2Util::IsUnsignedIntegerFormat(internal_format)) { |
| 6887 // To avoid undefined results, return without calling the gl function. | 6894 // To avoid undefined results, return without calling the gl function. |
| 6888 return; | 6895 return; |
| 6889 } | 6896 } |
| 6890 MarkDrawBufferAsCleared(buffer, drawbuffer); | 6897 MarkDrawBufferAsCleared(buffer, drawbuffer); |
| 6891 glClearBufferuiv(buffer, drawbuffer, value); | 6898 glClearBufferuiv(buffer, drawbuffer, value); |
| 6892 } | 6899 } |
| 6893 | 6900 |
| 6894 void GLES2DecoderImpl::DoClearBufferfv( | 6901 void GLES2DecoderImpl::DoClearBufferfv( |
| 6895 GLenum buffer, GLint drawbuffer, const GLfloat* value) { | 6902 GLenum buffer, GLint drawbuffer, const GLfloat* value) { |
| 6896 // TODO(zmo): Set clear_uncleared_images=true once crbug.com/584059 is fixed. | 6903 if (!CheckBoundDrawFramebufferValid("glClearBufferfv")) |
| 6897 if (!CheckBoundDrawFramebufferValid(false, "glClearBufferfv")) | |
| 6898 return; | 6904 return; |
| 6899 ApplyDirtyState(); | 6905 ApplyDirtyState(); |
| 6900 | 6906 |
| 6901 if (buffer == GL_COLOR) { | 6907 if (buffer == GL_COLOR) { |
| 6902 if (drawbuffer < 0 || | 6908 if (drawbuffer < 0 || |
| 6903 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { | 6909 drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { |
| 6904 LOCAL_SET_GL_ERROR( | 6910 LOCAL_SET_GL_ERROR( |
| 6905 GL_INVALID_VALUE, "glClearBufferfv", "invalid drawBuffer"); | 6911 GL_INVALID_VALUE, "glClearBufferfv", "invalid drawBuffer"); |
| 6906 return; | 6912 return; |
| 6907 } | 6913 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 6921 if (!BoundFramebufferHasDepthAttachment()) { | 6927 if (!BoundFramebufferHasDepthAttachment()) { |
| 6922 return; | 6928 return; |
| 6923 } | 6929 } |
| 6924 } | 6930 } |
| 6925 MarkDrawBufferAsCleared(buffer, drawbuffer); | 6931 MarkDrawBufferAsCleared(buffer, drawbuffer); |
| 6926 glClearBufferfv(buffer, drawbuffer, value); | 6932 glClearBufferfv(buffer, drawbuffer, value); |
| 6927 } | 6933 } |
| 6928 | 6934 |
| 6929 void GLES2DecoderImpl::DoClearBufferfi( | 6935 void GLES2DecoderImpl::DoClearBufferfi( |
| 6930 GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) { | 6936 GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) { |
| 6931 // TODO(zmo): Set clear_uncleared_images=true once crbug.com/584059 is fixed. | 6937 if (!CheckBoundDrawFramebufferValid("glClearBufferfi")) |
| 6932 if (!CheckBoundDrawFramebufferValid(false, "glClearBufferfi")) | |
| 6933 return; | 6938 return; |
| 6934 ApplyDirtyState(); | 6939 ApplyDirtyState(); |
| 6935 | 6940 |
| 6936 if (drawbuffer != 0) { | 6941 if (drawbuffer != 0) { |
| 6937 LOCAL_SET_GL_ERROR( | 6942 LOCAL_SET_GL_ERROR( |
| 6938 GL_INVALID_VALUE, "glClearBufferfi", "invalid drawBuffer"); | 6943 GL_INVALID_VALUE, "glClearBufferfi", "invalid drawBuffer"); |
| 6939 return; | 6944 return; |
| 6940 } | 6945 } |
| 6941 if (!BoundFramebufferHasDepthAttachment() && | 6946 if (!BoundFramebufferHasDepthAttachment() && |
| 6942 !BoundFramebufferHasStencilAttachment()) { | 6947 !BoundFramebufferHasStencilAttachment()) { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7055 | 7060 |
| 7056 GLbitfield clear_bits = 0; | 7061 GLbitfield clear_bits = 0; |
| 7057 bool reset_draw_buffers = false; | 7062 bool reset_draw_buffers = false; |
| 7058 if (framebuffer->HasUnclearedColorAttachments()) { | 7063 if (framebuffer->HasUnclearedColorAttachments()) { |
| 7059 // We should always use alpha == 0 here, because 1) some draw buffers may | 7064 // We should always use alpha == 0 here, because 1) some draw buffers may |
| 7060 // have alpha and some may not; 2) we won't have the same situation as the | 7065 // have alpha and some may not; 2) we won't have the same situation as the |
| 7061 // back buffer where alpha channel exists but is not requested. | 7066 // back buffer where alpha channel exists but is not requested. |
| 7062 glClearColor(0.0f, 0.0f, 0.0f, 0.0f); | 7067 glClearColor(0.0f, 0.0f, 0.0f, 0.0f); |
| 7063 state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); | 7068 state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |
| 7064 clear_bits |= GL_COLOR_BUFFER_BIT; | 7069 clear_bits |= GL_COLOR_BUFFER_BIT; |
| 7065 if (feature_info_->feature_flags().ext_draw_buffers || | 7070 |
| 7066 feature_info_->IsES3Enabled()) { | 7071 if (SupportsDrawBuffers()) { |
| 7067 reset_draw_buffers = framebuffer->PrepareDrawBuffersForClear(); | 7072 reset_draw_buffers = |
| 7073 framebuffer->PrepareDrawBuffersForClearingUninitializedAttachments(); |
| 7068 } | 7074 } |
| 7069 } | 7075 } |
| 7070 | 7076 |
| 7071 if (framebuffer->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT) || | 7077 if (framebuffer->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT) || |
| 7072 framebuffer->HasUnclearedAttachment(GL_DEPTH_STENCIL_ATTACHMENT)) { | 7078 framebuffer->HasUnclearedAttachment(GL_DEPTH_STENCIL_ATTACHMENT)) { |
| 7073 glClearStencil(0); | 7079 glClearStencil(0); |
| 7074 state_.SetDeviceStencilMaskSeparate(GL_FRONT, kDefaultStencilMask); | 7080 state_.SetDeviceStencilMaskSeparate(GL_FRONT, kDefaultStencilMask); |
| 7075 state_.SetDeviceStencilMaskSeparate(GL_BACK, kDefaultStencilMask); | 7081 state_.SetDeviceStencilMaskSeparate(GL_BACK, kDefaultStencilMask); |
| 7076 clear_bits |= GL_STENCIL_BUFFER_BIT; | 7082 clear_bits |= GL_STENCIL_BUFFER_BIT; |
| 7077 } | 7083 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 7089 // TODO(zmo): There is no guarantee that an FBO that is complete on the | 7095 // TODO(zmo): There is no guarantee that an FBO that is complete on the |
| 7090 // READ attachment will be complete as a DRAW attachment. | 7096 // READ attachment will be complete as a DRAW attachment. |
| 7091 glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, framebuffer->service_id()); | 7097 glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, framebuffer->service_id()); |
| 7092 } | 7098 } |
| 7093 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false); | 7099 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false); |
| 7094 glClear(clear_bits); | 7100 glClear(clear_bits); |
| 7095 } | 7101 } |
| 7096 | 7102 |
| 7097 if (cleared_int_renderbuffers || clear_bits) { | 7103 if (cleared_int_renderbuffers || clear_bits) { |
| 7098 if (reset_draw_buffers) | 7104 if (reset_draw_buffers) |
| 7099 framebuffer->RestoreDrawBuffersAfterClear(); | 7105 framebuffer->RestoreDrawBuffers(); |
| 7100 RestoreClearState(); | 7106 RestoreClearState(); |
| 7101 if (target == GL_READ_FRAMEBUFFER && draw_framebuffer != framebuffer) { | 7107 if (target == GL_READ_FRAMEBUFFER && draw_framebuffer != framebuffer) { |
| 7102 GLuint service_id = draw_framebuffer ? draw_framebuffer->service_id() : | 7108 GLuint service_id = draw_framebuffer ? draw_framebuffer->service_id() : |
| 7103 GetBackbufferServiceId(); | 7109 GetBackbufferServiceId(); |
| 7104 glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, service_id); | 7110 glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, service_id); |
| 7105 } | 7111 } |
| 7106 } | 7112 } |
| 7107 | 7113 |
| 7108 framebuffer_manager()->MarkAttachmentsAsCleared( | 7114 framebuffer_manager()->MarkAttachmentsAsCleared( |
| 7109 framebuffer, renderbuffer_manager(), texture_manager()); | 7115 framebuffer, renderbuffer_manager(), texture_manager()); |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8019 TextureUnit& texture_unit = state_.texture_units[texture_unit_index]; | 8025 TextureUnit& texture_unit = state_.texture_units[texture_unit_index]; |
| 8020 TextureRef* texture_ref = | 8026 TextureRef* texture_ref = |
| 8021 texture_unit.GetInfoForSamplerType(uniform_info->type).get(); | 8027 texture_unit.GetInfoForSamplerType(uniform_info->type).get(); |
| 8022 if (attachment->IsTexture(texture_ref)) | 8028 if (attachment->IsTexture(texture_ref)) |
| 8023 return true; | 8029 return true; |
| 8024 } | 8030 } |
| 8025 } | 8031 } |
| 8026 return false; | 8032 return false; |
| 8027 } | 8033 } |
| 8028 | 8034 |
| 8035 bool GLES2DecoderImpl::SupportsDrawBuffers() const { |
| 8036 switch (feature_info_->context_type()) { |
| 8037 case CONTEXT_TYPE_OPENGLES2: |
| 8038 case CONTEXT_TYPE_WEBGL1: |
| 8039 return feature_info_->feature_flags().ext_draw_buffers; |
| 8040 default: |
| 8041 return true; |
| 8042 } |
| 8043 } |
| 8044 |
| 8045 bool GLES2DecoderImpl::ValidateAndAdjustDrawBuffers(const char* func_name) { |
| 8046 if (!SupportsDrawBuffers()) { |
| 8047 return true; |
| 8048 } |
| 8049 Framebuffer* framebuffer = framebuffer_state_.bound_draw_framebuffer.get(); |
| 8050 if (!state_.current_program.get() || !framebuffer) { |
| 8051 return true; |
| 8052 } |
| 8053 const ShaderVariableBaseType* fragment_output_base_types = |
| 8054 state_.current_program->GetFragmentOutputBaseTypes(); |
| 8055 if (!framebuffer->ValidateAndAdjustDrawBuffers(fragment_output_base_types)) { |
| 8056 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| 8057 "buffer format and fragment output variable type incompatible"); |
| 8058 return false; |
| 8059 } |
| 8060 return true; |
| 8061 } |
| 8062 |
| 8063 void GLES2DecoderImpl::AdjustDrawBuffers() { |
| 8064 if (!SupportsDrawBuffers()) |
| 8065 return; |
| 8066 Framebuffer* framebuffer = framebuffer_state_.bound_draw_framebuffer.get(); |
| 8067 if (!framebuffer) |
| 8068 return; |
| 8069 framebuffer->ValidateAndAdjustDrawBuffers(nullptr); |
| 8070 } |
| 8071 |
| 8029 bool GLES2DecoderImpl::CheckUniformForApiType( | 8072 bool GLES2DecoderImpl::CheckUniformForApiType( |
| 8030 const Program::UniformInfo* info, | 8073 const Program::UniformInfo* info, |
| 8031 const char* function_name, | 8074 const char* function_name, |
| 8032 Program::UniformApiType api_type) { | 8075 Program::UniformApiType api_type) { |
| 8033 DCHECK(info); | 8076 DCHECK(info); |
| 8034 if ((api_type & info->accepts_api_type) == 0) { | 8077 if ((api_type & info->accepts_api_type) == 0) { |
| 8035 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 8078 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
| 8036 "wrong uniform function for type"); | 8079 "wrong uniform function for type"); |
| 8037 return false; | 8080 return false; |
| 8038 } | 8081 } |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9005 return error::kNoError; | 9048 return error::kNoError; |
| 9006 } | 9049 } |
| 9007 if (count < 0) { | 9050 if (count < 0) { |
| 9008 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "count < 0"); | 9051 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "count < 0"); |
| 9009 return error::kNoError; | 9052 return error::kNoError; |
| 9010 } | 9053 } |
| 9011 if (primcount < 0) { | 9054 if (primcount < 0) { |
| 9012 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); | 9055 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); |
| 9013 return error::kNoError; | 9056 return error::kNoError; |
| 9014 } | 9057 } |
| 9015 if (!CheckBoundDrawFramebufferValid(true, function_name)) { | 9058 if (!CheckBoundDrawFramebufferValid(function_name)) { |
| 9016 return error::kNoError; | 9059 return error::kNoError; |
| 9017 } | 9060 } |
| 9018 // We have to check this here because the prototype for glDrawArrays | 9061 // We have to check this here because the prototype for glDrawArrays |
| 9019 // is GLint not GLsizei. | 9062 // is GLint not GLsizei. |
| 9020 if (first < 0) { | 9063 if (first < 0) { |
| 9021 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "first < 0"); | 9064 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "first < 0"); |
| 9022 return error::kNoError; | 9065 return error::kNoError; |
| 9023 } | 9066 } |
| 9024 | 9067 |
| 9025 if (state_.bound_transform_feedback.get() && | 9068 if (state_.bound_transform_feedback.get() && |
| (...skipping 20 matching lines...) Expand all Loading... |
| 9046 if (!SimulateAttrib0( | 9089 if (!SimulateAttrib0( |
| 9047 function_name, max_vertex_accessed, &simulated_attrib_0)) { | 9090 function_name, max_vertex_accessed, &simulated_attrib_0)) { |
| 9048 return error::kNoError; | 9091 return error::kNoError; |
| 9049 } | 9092 } |
| 9050 bool simulated_fixed_attribs = false; | 9093 bool simulated_fixed_attribs = false; |
| 9051 if (SimulateFixedAttribs( | 9094 if (SimulateFixedAttribs( |
| 9052 function_name, max_vertex_accessed, &simulated_fixed_attribs, | 9095 function_name, max_vertex_accessed, &simulated_fixed_attribs, |
| 9053 primcount)) { | 9096 primcount)) { |
| 9054 bool textures_set = !PrepareTexturesForRender(); | 9097 bool textures_set = !PrepareTexturesForRender(); |
| 9055 ApplyDirtyState(); | 9098 ApplyDirtyState(); |
| 9099 if (!ValidateAndAdjustDrawBuffers(function_name)) { |
| 9100 return error::kNoError; |
| 9101 } |
| 9056 if (!instanced) { | 9102 if (!instanced) { |
| 9057 glDrawArrays(mode, first, count); | 9103 glDrawArrays(mode, first, count); |
| 9058 } else { | 9104 } else { |
| 9059 glDrawArraysInstancedANGLE(mode, first, count, primcount); | 9105 glDrawArraysInstancedANGLE(mode, first, count, primcount); |
| 9060 } | 9106 } |
| 9061 if (textures_set) { | 9107 if (textures_set) { |
| 9062 RestoreStateForTextures(); | 9108 RestoreStateForTextures(); |
| 9063 } | 9109 } |
| 9064 if (simulated_fixed_attribs) { | 9110 if (simulated_fixed_attribs) { |
| 9065 RestoreStateForSimulatedFixedAttribs(); | 9111 RestoreStateForSimulatedFixedAttribs(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9133 } | 9179 } |
| 9134 if (!validators_->index_type.IsValid(type)) { | 9180 if (!validators_->index_type.IsValid(type)) { |
| 9135 LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, type, "type"); | 9181 LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, type, "type"); |
| 9136 return error::kNoError; | 9182 return error::kNoError; |
| 9137 } | 9183 } |
| 9138 if (primcount < 0) { | 9184 if (primcount < 0) { |
| 9139 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); | 9185 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); |
| 9140 return error::kNoError; | 9186 return error::kNoError; |
| 9141 } | 9187 } |
| 9142 | 9188 |
| 9143 if (!CheckBoundDrawFramebufferValid(true, function_name)) { | 9189 if (!CheckBoundDrawFramebufferValid(function_name)) { |
| 9144 return error::kNoError; | 9190 return error::kNoError; |
| 9145 } | 9191 } |
| 9146 | 9192 |
| 9147 if (state_.bound_transform_feedback.get() && | 9193 if (state_.bound_transform_feedback.get() && |
| 9148 state_.bound_transform_feedback->active() && | 9194 state_.bound_transform_feedback->active() && |
| 9149 !state_.bound_transform_feedback->paused()) { | 9195 !state_.bound_transform_feedback->paused()) { |
| 9150 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 9196 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
| 9151 "transformfeedback is active and not paused"); | 9197 "transformfeedback is active and not paused"); |
| 9152 return error::kNoError; | 9198 return error::kNoError; |
| 9153 } | 9199 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9187 ApplyDirtyState(); | 9233 ApplyDirtyState(); |
| 9188 // TODO(gman): Refactor to hide these details in BufferManager or | 9234 // TODO(gman): Refactor to hide these details in BufferManager or |
| 9189 // VertexAttribManager. | 9235 // VertexAttribManager. |
| 9190 const GLvoid* indices = reinterpret_cast<const GLvoid*>(offset); | 9236 const GLvoid* indices = reinterpret_cast<const GLvoid*>(offset); |
| 9191 bool used_client_side_array = false; | 9237 bool used_client_side_array = false; |
| 9192 if (element_array_buffer->IsClientSideArray()) { | 9238 if (element_array_buffer->IsClientSideArray()) { |
| 9193 used_client_side_array = true; | 9239 used_client_side_array = true; |
| 9194 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); | 9240 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); |
| 9195 indices = element_array_buffer->GetRange(offset, 0); | 9241 indices = element_array_buffer->GetRange(offset, 0); |
| 9196 } | 9242 } |
| 9197 | 9243 if (!ValidateAndAdjustDrawBuffers(function_name)) { |
| 9244 return error::kNoError; |
| 9245 } |
| 9198 if (state_.enable_flags.primitive_restart_fixed_index && | 9246 if (state_.enable_flags.primitive_restart_fixed_index && |
| 9199 feature_info_->feature_flags(). | 9247 feature_info_->feature_flags(). |
| 9200 emulate_primitive_restart_fixed_index) { | 9248 emulate_primitive_restart_fixed_index) { |
| 9201 glEnable(GL_PRIMITIVE_RESTART); | 9249 glEnable(GL_PRIMITIVE_RESTART); |
| 9202 buffer_manager()->SetPrimitiveRestartFixedIndexIfNecessary(type); | 9250 buffer_manager()->SetPrimitiveRestartFixedIndexIfNecessary(type); |
| 9203 } | 9251 } |
| 9204 | |
| 9205 if (!instanced) { | 9252 if (!instanced) { |
| 9206 glDrawElements(mode, count, type, indices); | 9253 glDrawElements(mode, count, type, indices); |
| 9207 } else { | 9254 } else { |
| 9208 glDrawElementsInstancedANGLE(mode, count, type, indices, primcount); | 9255 glDrawElementsInstancedANGLE(mode, count, type, indices, primcount); |
| 9209 } | 9256 } |
| 9210 if (state_.enable_flags.primitive_restart_fixed_index && | 9257 if (state_.enable_flags.primitive_restart_fixed_index && |
| 9211 feature_info_->feature_flags(). | 9258 feature_info_->feature_flags(). |
| 9212 emulate_primitive_restart_fixed_index) { | 9259 emulate_primitive_restart_fixed_index) { |
| 9213 glDisable(GL_PRIMITIVE_RESTART); | 9260 glDisable(GL_PRIMITIVE_RESTART); |
| 9214 } | 9261 } |
| 9215 | |
| 9216 if (used_client_side_array) { | 9262 if (used_client_side_array) { |
| 9217 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, | 9263 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, |
| 9218 element_array_buffer->service_id()); | 9264 element_array_buffer->service_id()); |
| 9219 } | 9265 } |
| 9220 | |
| 9221 if (textures_set) { | 9266 if (textures_set) { |
| 9222 RestoreStateForTextures(); | 9267 RestoreStateForTextures(); |
| 9223 } | 9268 } |
| 9224 if (simulated_fixed_attribs) { | 9269 if (simulated_fixed_attribs) { |
| 9225 RestoreStateForSimulatedFixedAttribs(); | 9270 RestoreStateForSimulatedFixedAttribs(); |
| 9226 } | 9271 } |
| 9227 } | 9272 } |
| 9228 if (simulated_attrib_0) { | 9273 if (simulated_attrib_0) { |
| 9229 // We don't have to restore attrib 0 generic data at the end of this | 9274 // We don't have to restore attrib 0 generic data at the end of this |
| 9230 // function even if it is simulated. This is because we will simulate | 9275 // function even if it is simulated. This is because we will simulate |
| (...skipping 7234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16465 GLuint mask = 0; | 16510 GLuint mask = 0; |
| 16466 if (!v.GetFillModeAndMask(c, &fill_mode, &mask)) | 16511 if (!v.GetFillModeAndMask(c, &fill_mode, &mask)) |
| 16467 return v.error(); | 16512 return v.error(); |
| 16468 GLuint service_id = 0; | 16513 GLuint service_id = 0; |
| 16469 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { | 16514 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { |
| 16470 // "If /path/ does not name an existing path object, the command does | 16515 // "If /path/ does not name an existing path object, the command does |
| 16471 // nothing (and no error is generated)." | 16516 // nothing (and no error is generated)." |
| 16472 // This holds for other rendering functions, too. | 16517 // This holds for other rendering functions, too. |
| 16473 return error::kNoError; | 16518 return error::kNoError; |
| 16474 } | 16519 } |
| 16475 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16520 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16476 return error::kNoError; | 16521 return error::kNoError; |
| 16477 ApplyDirtyState(); | 16522 ApplyDirtyState(); |
| 16478 glStencilFillPathNV(service_id, fill_mode, mask); | 16523 glStencilFillPathNV(service_id, fill_mode, mask); |
| 16479 return error::kNoError; | 16524 return error::kNoError; |
| 16480 } | 16525 } |
| 16481 | 16526 |
| 16482 error::Error GLES2DecoderImpl::HandleStencilStrokePathCHROMIUM( | 16527 error::Error GLES2DecoderImpl::HandleStencilStrokePathCHROMIUM( |
| 16483 uint32_t immediate_data_size, | 16528 uint32_t immediate_data_size, |
| 16484 const void* cmd_data) { | 16529 const void* cmd_data) { |
| 16485 static const char kFunctionName[] = "glStencilStrokePathCHROMIUM"; | 16530 static const char kFunctionName[] = "glStencilStrokePathCHROMIUM"; |
| 16486 const gles2::cmds::StencilStrokePathCHROMIUM& c = | 16531 const gles2::cmds::StencilStrokePathCHROMIUM& c = |
| 16487 *static_cast<const gles2::cmds::StencilStrokePathCHROMIUM*>(cmd_data); | 16532 *static_cast<const gles2::cmds::StencilStrokePathCHROMIUM*>(cmd_data); |
| 16488 if (!features().chromium_path_rendering) | 16533 if (!features().chromium_path_rendering) |
| 16489 return error::kUnknownCommand; | 16534 return error::kUnknownCommand; |
| 16490 | 16535 |
| 16491 GLuint service_id = 0; | 16536 GLuint service_id = 0; |
| 16492 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { | 16537 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) { |
| 16493 return error::kNoError; | 16538 return error::kNoError; |
| 16494 } | 16539 } |
| 16495 GLint reference = static_cast<GLint>(c.reference); | 16540 GLint reference = static_cast<GLint>(c.reference); |
| 16496 GLuint mask = static_cast<GLuint>(c.mask); | 16541 GLuint mask = static_cast<GLuint>(c.mask); |
| 16497 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16542 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16498 return error::kNoError; | 16543 return error::kNoError; |
| 16499 ApplyDirtyState(); | 16544 ApplyDirtyState(); |
| 16500 glStencilStrokePathNV(service_id, reference, mask); | 16545 glStencilStrokePathNV(service_id, reference, mask); |
| 16501 return error::kNoError; | 16546 return error::kNoError; |
| 16502 } | 16547 } |
| 16503 | 16548 |
| 16504 error::Error GLES2DecoderImpl::HandleCoverFillPathCHROMIUM( | 16549 error::Error GLES2DecoderImpl::HandleCoverFillPathCHROMIUM( |
| 16505 uint32_t immediate_data_size, | 16550 uint32_t immediate_data_size, |
| 16506 const void* cmd_data) { | 16551 const void* cmd_data) { |
| 16507 static const char kFunctionName[] = "glCoverFillPathCHROMIUM"; | 16552 static const char kFunctionName[] = "glCoverFillPathCHROMIUM"; |
| 16508 const gles2::cmds::CoverFillPathCHROMIUM& c = | 16553 const gles2::cmds::CoverFillPathCHROMIUM& c = |
| 16509 *static_cast<const gles2::cmds::CoverFillPathCHROMIUM*>(cmd_data); | 16554 *static_cast<const gles2::cmds::CoverFillPathCHROMIUM*>(cmd_data); |
| 16510 if (!features().chromium_path_rendering) | 16555 if (!features().chromium_path_rendering) |
| 16511 return error::kUnknownCommand; | 16556 return error::kUnknownCommand; |
| 16512 | 16557 |
| 16513 PathCommandValidatorContext v(this, kFunctionName); | 16558 PathCommandValidatorContext v(this, kFunctionName); |
| 16514 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 16559 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 16515 if (!v.GetCoverMode(c, &cover_mode)) | 16560 if (!v.GetCoverMode(c, &cover_mode)) |
| 16516 return v.error(); | 16561 return v.error(); |
| 16517 | 16562 |
| 16518 GLuint service_id = 0; | 16563 GLuint service_id = 0; |
| 16519 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 16564 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 16520 return error::kNoError; | 16565 return error::kNoError; |
| 16521 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16566 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16522 return error::kNoError; | 16567 return error::kNoError; |
| 16523 ApplyDirtyState(); | 16568 ApplyDirtyState(); |
| 16524 glCoverFillPathNV(service_id, cover_mode); | 16569 glCoverFillPathNV(service_id, cover_mode); |
| 16525 return error::kNoError; | 16570 return error::kNoError; |
| 16526 } | 16571 } |
| 16527 | 16572 |
| 16528 error::Error GLES2DecoderImpl::HandleCoverStrokePathCHROMIUM( | 16573 error::Error GLES2DecoderImpl::HandleCoverStrokePathCHROMIUM( |
| 16529 uint32_t immediate_data_size, | 16574 uint32_t immediate_data_size, |
| 16530 const void* cmd_data) { | 16575 const void* cmd_data) { |
| 16531 static const char kFunctionName[] = "glCoverStrokePathCHROMIUM"; | 16576 static const char kFunctionName[] = "glCoverStrokePathCHROMIUM"; |
| 16532 const gles2::cmds::CoverStrokePathCHROMIUM& c = | 16577 const gles2::cmds::CoverStrokePathCHROMIUM& c = |
| 16533 *static_cast<const gles2::cmds::CoverStrokePathCHROMIUM*>(cmd_data); | 16578 *static_cast<const gles2::cmds::CoverStrokePathCHROMIUM*>(cmd_data); |
| 16534 if (!features().chromium_path_rendering) | 16579 if (!features().chromium_path_rendering) |
| 16535 return error::kUnknownCommand; | 16580 return error::kUnknownCommand; |
| 16536 | 16581 |
| 16537 PathCommandValidatorContext v(this, kFunctionName); | 16582 PathCommandValidatorContext v(this, kFunctionName); |
| 16538 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 16583 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 16539 if (!v.GetCoverMode(c, &cover_mode)) | 16584 if (!v.GetCoverMode(c, &cover_mode)) |
| 16540 return v.error(); | 16585 return v.error(); |
| 16541 | 16586 |
| 16542 GLuint service_id = 0; | 16587 GLuint service_id = 0; |
| 16543 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 16588 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 16544 return error::kNoError; | 16589 return error::kNoError; |
| 16545 | 16590 |
| 16546 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16591 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16547 return error::kNoError; | 16592 return error::kNoError; |
| 16548 ApplyDirtyState(); | 16593 ApplyDirtyState(); |
| 16549 glCoverStrokePathNV(service_id, cover_mode); | 16594 glCoverStrokePathNV(service_id, cover_mode); |
| 16550 return error::kNoError; | 16595 return error::kNoError; |
| 16551 } | 16596 } |
| 16552 | 16597 |
| 16553 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathCHROMIUM( | 16598 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathCHROMIUM( |
| 16554 uint32_t immediate_data_size, | 16599 uint32_t immediate_data_size, |
| 16555 const void* cmd_data) { | 16600 const void* cmd_data) { |
| 16556 static const char kFunctionName[] = "glStencilThenCoverFillPathCHROMIUM"; | 16601 static const char kFunctionName[] = "glStencilThenCoverFillPathCHROMIUM"; |
| 16557 const gles2::cmds::StencilThenCoverFillPathCHROMIUM& c = | 16602 const gles2::cmds::StencilThenCoverFillPathCHROMIUM& c = |
| 16558 *static_cast<const gles2::cmds::StencilThenCoverFillPathCHROMIUM*>( | 16603 *static_cast<const gles2::cmds::StencilThenCoverFillPathCHROMIUM*>( |
| 16559 cmd_data); | 16604 cmd_data); |
| 16560 if (!features().chromium_path_rendering) | 16605 if (!features().chromium_path_rendering) |
| 16561 return error::kUnknownCommand; | 16606 return error::kUnknownCommand; |
| 16562 | 16607 |
| 16563 PathCommandValidatorContext v(this, kFunctionName); | 16608 PathCommandValidatorContext v(this, kFunctionName); |
| 16564 GLenum fill_mode = GL_COUNT_UP_CHROMIUM; | 16609 GLenum fill_mode = GL_COUNT_UP_CHROMIUM; |
| 16565 GLuint mask = 0; | 16610 GLuint mask = 0; |
| 16566 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 16611 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 16567 if (!v.GetFillModeAndMask(c, &fill_mode, &mask) || | 16612 if (!v.GetFillModeAndMask(c, &fill_mode, &mask) || |
| 16568 !v.GetCoverMode(c, &cover_mode)) | 16613 !v.GetCoverMode(c, &cover_mode)) |
| 16569 return v.error(); | 16614 return v.error(); |
| 16570 | 16615 |
| 16571 GLuint service_id = 0; | 16616 GLuint service_id = 0; |
| 16572 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 16617 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 16573 return error::kNoError; | 16618 return error::kNoError; |
| 16574 | 16619 |
| 16575 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16620 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16576 return error::kNoError; | 16621 return error::kNoError; |
| 16577 ApplyDirtyState(); | 16622 ApplyDirtyState(); |
| 16578 glStencilThenCoverFillPathNV(service_id, fill_mode, mask, cover_mode); | 16623 glStencilThenCoverFillPathNV(service_id, fill_mode, mask, cover_mode); |
| 16579 return error::kNoError; | 16624 return error::kNoError; |
| 16580 } | 16625 } |
| 16581 | 16626 |
| 16582 error::Error GLES2DecoderImpl::HandleStencilThenCoverStrokePathCHROMIUM( | 16627 error::Error GLES2DecoderImpl::HandleStencilThenCoverStrokePathCHROMIUM( |
| 16583 uint32_t immediate_data_size, | 16628 uint32_t immediate_data_size, |
| 16584 const void* cmd_data) { | 16629 const void* cmd_data) { |
| 16585 static const char kFunctionName[] = "glStencilThenCoverStrokePathCHROMIUM"; | 16630 static const char kFunctionName[] = "glStencilThenCoverStrokePathCHROMIUM"; |
| 16586 const gles2::cmds::StencilThenCoverStrokePathCHROMIUM& c = | 16631 const gles2::cmds::StencilThenCoverStrokePathCHROMIUM& c = |
| 16587 *static_cast<const gles2::cmds::StencilThenCoverStrokePathCHROMIUM*>( | 16632 *static_cast<const gles2::cmds::StencilThenCoverStrokePathCHROMIUM*>( |
| 16588 cmd_data); | 16633 cmd_data); |
| 16589 if (!features().chromium_path_rendering) | 16634 if (!features().chromium_path_rendering) |
| 16590 return error::kUnknownCommand; | 16635 return error::kUnknownCommand; |
| 16591 | 16636 |
| 16592 PathCommandValidatorContext v(this, kFunctionName); | 16637 PathCommandValidatorContext v(this, kFunctionName); |
| 16593 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; | 16638 GLenum cover_mode = GL_BOUNDING_BOX_CHROMIUM; |
| 16594 if (!v.GetCoverMode(c, &cover_mode)) | 16639 if (!v.GetCoverMode(c, &cover_mode)) |
| 16595 return v.error(); | 16640 return v.error(); |
| 16596 | 16641 |
| 16597 GLuint service_id = 0; | 16642 GLuint service_id = 0; |
| 16598 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) | 16643 if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) |
| 16599 return error::kNoError; | 16644 return error::kNoError; |
| 16600 | 16645 |
| 16601 GLint reference = static_cast<GLint>(c.reference); | 16646 GLint reference = static_cast<GLint>(c.reference); |
| 16602 GLuint mask = static_cast<GLuint>(c.mask); | 16647 GLuint mask = static_cast<GLuint>(c.mask); |
| 16603 | 16648 |
| 16604 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16649 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16605 return error::kNoError; | 16650 return error::kNoError; |
| 16606 ApplyDirtyState(); | 16651 ApplyDirtyState(); |
| 16607 glStencilThenCoverStrokePathNV(service_id, reference, mask, cover_mode); | 16652 glStencilThenCoverStrokePathNV(service_id, reference, mask, cover_mode); |
| 16608 return error::kNoError; | 16653 return error::kNoError; |
| 16609 } | 16654 } |
| 16610 | 16655 |
| 16611 error::Error GLES2DecoderImpl::HandleStencilFillPathInstancedCHROMIUM( | 16656 error::Error GLES2DecoderImpl::HandleStencilFillPathInstancedCHROMIUM( |
| 16612 uint32_t immediate_data_size, | 16657 uint32_t immediate_data_size, |
| 16613 const void* cmd_data) { | 16658 const void* cmd_data) { |
| 16614 static const char kFunctionName[] = "glStencilFillPathInstancedCHROMIUM"; | 16659 static const char kFunctionName[] = "glStencilFillPathInstancedCHROMIUM"; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 16633 return error::kNoError; | 16678 return error::kNoError; |
| 16634 | 16679 |
| 16635 std::unique_ptr<GLuint[]> paths; | 16680 std::unique_ptr<GLuint[]> paths; |
| 16636 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 16681 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 16637 return v.error(); | 16682 return v.error(); |
| 16638 | 16683 |
| 16639 const GLfloat* transforms = nullptr; | 16684 const GLfloat* transforms = nullptr; |
| 16640 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 16685 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 16641 return v.error(); | 16686 return v.error(); |
| 16642 | 16687 |
| 16643 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16688 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16644 return error::kNoError; | 16689 return error::kNoError; |
| 16645 ApplyDirtyState(); | 16690 ApplyDirtyState(); |
| 16646 glStencilFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 16691 glStencilFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 16647 fill_mode, mask, transform_type, transforms); | 16692 fill_mode, mask, transform_type, transforms); |
| 16648 return error::kNoError; | 16693 return error::kNoError; |
| 16649 } | 16694 } |
| 16650 | 16695 |
| 16651 error::Error GLES2DecoderImpl::HandleStencilStrokePathInstancedCHROMIUM( | 16696 error::Error GLES2DecoderImpl::HandleStencilStrokePathInstancedCHROMIUM( |
| 16652 uint32_t immediate_data_size, | 16697 uint32_t immediate_data_size, |
| 16653 const void* cmd_data) { | 16698 const void* cmd_data) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 16672 std::unique_ptr<GLuint[]> paths; | 16717 std::unique_ptr<GLuint[]> paths; |
| 16673 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 16718 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 16674 return v.error(); | 16719 return v.error(); |
| 16675 | 16720 |
| 16676 const GLfloat* transforms = nullptr; | 16721 const GLfloat* transforms = nullptr; |
| 16677 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 16722 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 16678 return v.error(); | 16723 return v.error(); |
| 16679 | 16724 |
| 16680 GLint reference = static_cast<GLint>(c.reference); | 16725 GLint reference = static_cast<GLint>(c.reference); |
| 16681 GLuint mask = static_cast<GLuint>(c.mask); | 16726 GLuint mask = static_cast<GLuint>(c.mask); |
| 16682 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16727 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16683 return error::kNoError; | 16728 return error::kNoError; |
| 16684 ApplyDirtyState(); | 16729 ApplyDirtyState(); |
| 16685 glStencilStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 16730 glStencilStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 16686 reference, mask, transform_type, transforms); | 16731 reference, mask, transform_type, transforms); |
| 16687 return error::kNoError; | 16732 return error::kNoError; |
| 16688 } | 16733 } |
| 16689 | 16734 |
| 16690 error::Error GLES2DecoderImpl::HandleCoverFillPathInstancedCHROMIUM( | 16735 error::Error GLES2DecoderImpl::HandleCoverFillPathInstancedCHROMIUM( |
| 16691 uint32_t immediate_data_size, | 16736 uint32_t immediate_data_size, |
| 16692 const void* cmd_data) { | 16737 const void* cmd_data) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 16711 return error::kNoError; | 16756 return error::kNoError; |
| 16712 | 16757 |
| 16713 std::unique_ptr<GLuint[]> paths; | 16758 std::unique_ptr<GLuint[]> paths; |
| 16714 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 16759 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 16715 return v.error(); | 16760 return v.error(); |
| 16716 | 16761 |
| 16717 const GLfloat* transforms = nullptr; | 16762 const GLfloat* transforms = nullptr; |
| 16718 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 16763 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 16719 return v.error(); | 16764 return v.error(); |
| 16720 | 16765 |
| 16721 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16766 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16722 return error::kNoError; | 16767 return error::kNoError; |
| 16723 ApplyDirtyState(); | 16768 ApplyDirtyState(); |
| 16724 glCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 16769 glCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 16725 cover_mode, transform_type, transforms); | 16770 cover_mode, transform_type, transforms); |
| 16726 return error::kNoError; | 16771 return error::kNoError; |
| 16727 } | 16772 } |
| 16728 | 16773 |
| 16729 error::Error GLES2DecoderImpl::HandleCoverStrokePathInstancedCHROMIUM( | 16774 error::Error GLES2DecoderImpl::HandleCoverStrokePathInstancedCHROMIUM( |
| 16730 uint32_t immediate_data_size, | 16775 uint32_t immediate_data_size, |
| 16731 const void* cmd_data) { | 16776 const void* cmd_data) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 16750 return error::kNoError; | 16795 return error::kNoError; |
| 16751 | 16796 |
| 16752 std::unique_ptr<GLuint[]> paths; | 16797 std::unique_ptr<GLuint[]> paths; |
| 16753 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 16798 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 16754 return v.error(); | 16799 return v.error(); |
| 16755 | 16800 |
| 16756 const GLfloat* transforms = nullptr; | 16801 const GLfloat* transforms = nullptr; |
| 16757 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 16802 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 16758 return v.error(); | 16803 return v.error(); |
| 16759 | 16804 |
| 16760 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16805 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16761 return error::kNoError; | 16806 return error::kNoError; |
| 16762 ApplyDirtyState(); | 16807 ApplyDirtyState(); |
| 16763 glCoverStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, | 16808 glCoverStrokePathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), 0, |
| 16764 cover_mode, transform_type, transforms); | 16809 cover_mode, transform_type, transforms); |
| 16765 return error::kNoError; | 16810 return error::kNoError; |
| 16766 } | 16811 } |
| 16767 | 16812 |
| 16768 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathInstancedCHROMIUM( | 16813 error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathInstancedCHROMIUM( |
| 16769 uint32_t immediate_data_size, | 16814 uint32_t immediate_data_size, |
| 16770 const void* cmd_data) { | 16815 const void* cmd_data) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 16794 return error::kNoError; | 16839 return error::kNoError; |
| 16795 | 16840 |
| 16796 std::unique_ptr<GLuint[]> paths; | 16841 std::unique_ptr<GLuint[]> paths; |
| 16797 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 16842 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 16798 return v.error(); | 16843 return v.error(); |
| 16799 | 16844 |
| 16800 const GLfloat* transforms = nullptr; | 16845 const GLfloat* transforms = nullptr; |
| 16801 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 16846 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 16802 return v.error(); | 16847 return v.error(); |
| 16803 | 16848 |
| 16804 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16849 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16805 return error::kNoError; | 16850 return error::kNoError; |
| 16806 ApplyDirtyState(); | 16851 ApplyDirtyState(); |
| 16807 glStencilThenCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), | 16852 glStencilThenCoverFillPathInstancedNV(num_paths, GL_UNSIGNED_INT, paths.get(), |
| 16808 0, fill_mode, mask, cover_mode, | 16853 0, fill_mode, mask, cover_mode, |
| 16809 transform_type, transforms); | 16854 transform_type, transforms); |
| 16810 return error::kNoError; | 16855 return error::kNoError; |
| 16811 } | 16856 } |
| 16812 | 16857 |
| 16813 error::Error | 16858 error::Error |
| 16814 GLES2DecoderImpl::HandleStencilThenCoverStrokePathInstancedCHROMIUM( | 16859 GLES2DecoderImpl::HandleStencilThenCoverStrokePathInstancedCHROMIUM( |
| (...skipping 24 matching lines...) Expand all Loading... |
| 16839 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) | 16884 if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) |
| 16840 return v.error(); | 16885 return v.error(); |
| 16841 | 16886 |
| 16842 const GLfloat* transforms = nullptr; | 16887 const GLfloat* transforms = nullptr; |
| 16843 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) | 16888 if (!v.GetTransforms(c, num_paths, transform_type, &transforms)) |
| 16844 return v.error(); | 16889 return v.error(); |
| 16845 | 16890 |
| 16846 GLint reference = static_cast<GLint>(c.reference); | 16891 GLint reference = static_cast<GLint>(c.reference); |
| 16847 GLuint mask = static_cast<GLuint>(c.mask); | 16892 GLuint mask = static_cast<GLuint>(c.mask); |
| 16848 | 16893 |
| 16849 if (!CheckBoundDrawFramebufferValid(true, kFunctionName)) | 16894 if (!CheckBoundDrawFramebufferValid(kFunctionName)) |
| 16850 return error::kNoError; | 16895 return error::kNoError; |
| 16851 ApplyDirtyState(); | 16896 ApplyDirtyState(); |
| 16852 glStencilThenCoverStrokePathInstancedNV( | 16897 glStencilThenCoverStrokePathInstancedNV( |
| 16853 num_paths, GL_UNSIGNED_INT, paths.get(), 0, reference, mask, cover_mode, | 16898 num_paths, GL_UNSIGNED_INT, paths.get(), 0, reference, mask, cover_mode, |
| 16854 transform_type, transforms); | 16899 transform_type, transforms); |
| 16855 return error::kNoError; | 16900 return error::kNoError; |
| 16856 } | 16901 } |
| 16857 | 16902 |
| 16858 void GLES2DecoderImpl::DoBindFragmentInputLocationCHROMIUM( | 16903 void GLES2DecoderImpl::DoBindFragmentInputLocationCHROMIUM( |
| 16859 GLuint program_id, | 16904 GLuint program_id, |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17106 } | 17151 } |
| 17107 | 17152 |
| 17108 // Include the auto-generated part of this file. We split this because it means | 17153 // Include the auto-generated part of this file. We split this because it means |
| 17109 // we can easily edit the non-auto generated parts right here in this file | 17154 // we can easily edit the non-auto generated parts right here in this file |
| 17110 // instead of having to edit some template or the code generator. | 17155 // instead of having to edit some template or the code generator. |
| 17111 #include "base/macros.h" | 17156 #include "base/macros.h" |
| 17112 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 17157 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 17113 | 17158 |
| 17114 } // namespace gles2 | 17159 } // namespace gles2 |
| 17115 } // namespace gpu | 17160 } // namespace gpu |
| OLD | NEW |