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 <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 9609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9620 bool dest_level_defined = dest_texture->GetLevelSize( | 9620 bool dest_level_defined = dest_texture->GetLevelSize( |
| 9621 GL_TEXTURE_2D, level, &dest_width, &dest_height); | 9621 GL_TEXTURE_2D, level, &dest_width, &dest_height); |
| 9622 | 9622 |
| 9623 if (dest_level_defined) { | 9623 if (dest_level_defined) { |
| 9624 dest_texture->GetLevelType(GL_TEXTURE_2D, level, &dest_type_previous, | 9624 dest_texture->GetLevelType(GL_TEXTURE_2D, level, &dest_type_previous, |
| 9625 &dest_internal_format); | 9625 &dest_internal_format); |
| 9626 } | 9626 } |
| 9627 | 9627 |
| 9628 // Set source texture's width and height to be the same as | 9628 // Set source texture's width and height to be the same as |
| 9629 // destination texture when source is GL_TEXTURE_EXTERNAL_OES. | 9629 // destination texture when source is GL_TEXTURE_EXTERNAL_OES. |
| 9630 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { | 9630 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { |
|
greggman
2013/05/09 16:15:11
Doesn't this code just need to move to about line
Sami
2013/05/09 16:18:43
The problem is that for GL_TEXTURE_EXTERNAL, sourc
| |
| 9631 if (!dest_level_defined) { | |
|
greggman
2013/05/09 16:41:23
Then please add a TODO: here that this coude shoul
Sami
2013/05/09 16:46:24
Right, this is just a temporary safeguard while th
| |
| 9632 LOCAL_SET_GL_ERROR( | |
| 9633 GL_INVALID_VALUE, | |
| 9634 "glCopyTextureCHROMIUM", "destination level not defined"); | |
| 9635 return; | |
| 9636 } | |
| 9631 source_width = dest_width; | 9637 source_width = dest_width; |
| 9632 source_height = dest_height; | 9638 source_height = dest_height; |
| 9633 } | 9639 } |
| 9634 | 9640 |
| 9635 // Resize the destination texture to the dimensions of the source texture. | 9641 // Resize the destination texture to the dimensions of the source texture. |
| 9636 if (!dest_level_defined || dest_width != source_width || | 9642 if (!dest_level_defined || dest_width != source_width || |
| 9637 dest_height != source_height || | 9643 dest_height != source_height || |
| 9638 dest_internal_format != internal_format || | 9644 dest_internal_format != internal_format || |
| 9639 dest_type_previous != dest_type) { | 9645 dest_type_previous != dest_type) { |
| 9640 // Ensure that the glTexImage2D succeeds. | 9646 // Ensure that the glTexImage2D succeeds. |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10332 return error::kNoError; | 10338 return error::kNoError; |
| 10333 } | 10339 } |
| 10334 | 10340 |
| 10335 // Include the auto-generated part of this file. We split this because it means | 10341 // Include the auto-generated part of this file. We split this because it means |
| 10336 // we can easily edit the non-auto generated parts right here in this file | 10342 // we can easily edit the non-auto generated parts right here in this file |
| 10337 // instead of having to edit some template or the code generator. | 10343 // instead of having to edit some template or the code generator. |
| 10338 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10344 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 10339 | 10345 |
| 10340 } // namespace gles2 | 10346 } // namespace gles2 |
| 10341 } // namespace gpu | 10347 } // namespace gpu |
| OLD | NEW |