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 <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 10131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10142 } | 10142 } |
10143 | 10143 |
10144 gfx::GLImage* gl_image = image_manager()->LookupImage(image_id); | 10144 gfx::GLImage* gl_image = image_manager()->LookupImage(image_id); |
10145 if (!gl_image) { | 10145 if (!gl_image) { |
10146 LOCAL_SET_GL_ERROR( | 10146 LOCAL_SET_GL_ERROR( |
10147 GL_INVALID_OPERATION, | 10147 GL_INVALID_OPERATION, |
10148 "glBindTexImage2DCHROMIUM", "no image found with the given ID"); | 10148 "glBindTexImage2DCHROMIUM", "no image found with the given ID"); |
10149 return; | 10149 return; |
10150 } | 10150 } |
10151 | 10151 |
10152 if (!gl_image->BindTexImage()) { | 10152 { |
10153 LOCAL_SET_GL_ERROR( | 10153 ScopedGLErrorSuppressor suppressor( |
10154 GL_INVALID_OPERATION, | 10154 "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM", this); |
10155 "glBindTexImage2DCHROMIUM", "fail to bind image with the given ID"); | 10155 if (!gl_image->BindTexImage()) { |
10156 return; | 10156 LOCAL_SET_GL_ERROR( |
| 10157 GL_INVALID_OPERATION, |
| 10158 "glBindTexImage2DCHROMIUM", "fail to bind image with the given ID"); |
| 10159 return; |
| 10160 } |
10157 } | 10161 } |
10158 | 10162 |
10159 gfx::Size size = gl_image->GetSize(); | 10163 gfx::Size size = gl_image->GetSize(); |
10160 texture_manager()->SetLevelInfo( | 10164 texture_manager()->SetLevelInfo( |
10161 texture, target, 0, GL_RGBA, size.width(), size.height(), 1, 0, | 10165 texture, target, 0, GL_RGBA, size.width(), size.height(), 1, 0, |
10162 GL_RGBA, GL_UNSIGNED_BYTE, true); | 10166 GL_RGBA, GL_UNSIGNED_BYTE, true); |
10163 texture_manager()->SetLevelImage(texture, target, 0, gl_image); | 10167 texture_manager()->SetLevelImage(texture, target, 0, gl_image); |
10164 } | 10168 } |
10165 | 10169 |
10166 void GLES2DecoderImpl::DoReleaseTexImage2DCHROMIUM( | 10170 void GLES2DecoderImpl::DoReleaseTexImage2DCHROMIUM( |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10525 return error::kNoError; | 10529 return error::kNoError; |
10526 } | 10530 } |
10527 | 10531 |
10528 // Include the auto-generated part of this file. We split this because it means | 10532 // Include the auto-generated part of this file. We split this because it means |
10529 // we can easily edit the non-auto generated parts right here in this file | 10533 // we can easily edit the non-auto generated parts right here in this file |
10530 // instead of having to edit some template or the code generator. | 10534 // instead of having to edit some template or the code generator. |
10531 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10535 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10532 | 10536 |
10533 } // namespace gles2 | 10537 } // namespace gles2 |
10534 } // namespace gpu | 10538 } // namespace gpu |
OLD | NEW |