| 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 5900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5911 GL_INVALID_OPERATION)) { | 5911 GL_INVALID_OPERATION)) { |
| 5912 if (params) { | 5912 if (params) { |
| 5913 *params = 0; | 5913 *params = 0; |
| 5914 } | 5914 } |
| 5915 return true; | 5915 return true; |
| 5916 } | 5916 } |
| 5917 if (params) { | 5917 if (params) { |
| 5918 ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::GetHelper", | 5918 ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::GetHelper", |
| 5919 GetErrorState()); | 5919 GetErrorState()); |
| 5920 glGetIntegerv(pname, params); | 5920 glGetIntegerv(pname, params); |
| 5921 if (glGetError() != GL_NO_ERROR) { | 5921 bool is_valid = glGetError() == GL_NO_ERROR; |
| 5922 if (is_valid) { |
| 5923 is_valid = pname == GL_IMPLEMENTATION_COLOR_READ_FORMAT ? |
| 5924 validators_->read_pixel_format.IsValid(*params) : |
| 5925 validators_->read_pixel_type.IsValid(*params); |
| 5926 } |
| 5927 if (!is_valid) { |
| 5922 if (pname == GL_IMPLEMENTATION_COLOR_READ_FORMAT) { | 5928 if (pname == GL_IMPLEMENTATION_COLOR_READ_FORMAT) { |
| 5923 *params = GLES2Util::GetGLReadPixelsImplementationFormat( | 5929 *params = GLES2Util::GetGLReadPixelsImplementationFormat( |
| 5924 GetBoundReadFrameBufferInternalFormat(), | 5930 GetBoundReadFrameBufferInternalFormat(), |
| 5925 GetBoundReadFrameBufferTextureType(), | 5931 GetBoundReadFrameBufferTextureType(), |
| 5926 feature_info_->feature_flags().ext_read_format_bgra); | 5932 feature_info_->feature_flags().ext_read_format_bgra); |
| 5927 } else { | 5933 } else { |
| 5928 *params = GLES2Util::GetGLReadPixelsImplementationType( | 5934 *params = GLES2Util::GetGLReadPixelsImplementationType( |
| 5929 GetBoundReadFrameBufferInternalFormat(), | 5935 GetBoundReadFrameBufferInternalFormat(), |
| 5930 GetBoundReadFrameBufferTextureType()); | 5936 GetBoundReadFrameBufferTextureType()); |
| 5931 } | 5937 } |
| (...skipping 11472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17404 } | 17410 } |
| 17405 | 17411 |
| 17406 // Include the auto-generated part of this file. We split this because it means | 17412 // Include the auto-generated part of this file. We split this because it means |
| 17407 // we can easily edit the non-auto generated parts right here in this file | 17413 // we can easily edit the non-auto generated parts right here in this file |
| 17408 // instead of having to edit some template or the code generator. | 17414 // instead of having to edit some template or the code generator. |
| 17409 #include "base/macros.h" | 17415 #include "base/macros.h" |
| 17410 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 17416 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 17411 | 17417 |
| 17412 } // namespace gles2 | 17418 } // namespace gles2 |
| 17413 } // namespace gpu | 17419 } // namespace gpu |
| OLD | NEW |