| 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 9687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9698 bool dest_level_defined = dest_texture->GetLevelSize( | 9698 bool dest_level_defined = dest_texture->GetLevelSize( |
| 9699 GL_TEXTURE_2D, level, &dest_width, &dest_height); | 9699 GL_TEXTURE_2D, level, &dest_width, &dest_height); |
| 9700 | 9700 |
| 9701 if (dest_level_defined) { | 9701 if (dest_level_defined) { |
| 9702 dest_texture->GetLevelType(GL_TEXTURE_2D, level, &dest_type_previous, | 9702 dest_texture->GetLevelType(GL_TEXTURE_2D, level, &dest_type_previous, |
| 9703 &dest_internal_format); | 9703 &dest_internal_format); |
| 9704 } | 9704 } |
| 9705 | 9705 |
| 9706 // Set source texture's width and height to be the same as | 9706 // Set source texture's width and height to be the same as |
| 9707 // destination texture when source is GL_TEXTURE_EXTERNAL_OES. | 9707 // destination texture when source is GL_TEXTURE_EXTERNAL_OES. |
| 9708 // TODO(hkuang): Add support to get width/height of StreamTexture |
| 9709 // crbug.com/225781. |
| 9708 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { | 9710 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { |
| 9711 if (!dest_level_defined) { |
| 9712 LOCAL_SET_GL_ERROR( |
| 9713 GL_INVALID_VALUE, |
| 9714 "glCopyTextureCHROMIUM", "destination level not defined"); |
| 9715 return; |
| 9716 } |
| 9709 source_width = dest_width; | 9717 source_width = dest_width; |
| 9710 source_height = dest_height; | 9718 source_height = dest_height; |
| 9711 } | 9719 } |
| 9712 | 9720 |
| 9713 // Resize the destination texture to the dimensions of the source texture. | 9721 // Resize the destination texture to the dimensions of the source texture. |
| 9714 if (!dest_level_defined || dest_width != source_width || | 9722 if (!dest_level_defined || dest_width != source_width || |
| 9715 dest_height != source_height || | 9723 dest_height != source_height || |
| 9716 dest_internal_format != internal_format || | 9724 dest_internal_format != internal_format || |
| 9717 dest_type_previous != dest_type) { | 9725 dest_type_previous != dest_type) { |
| 9718 // Ensure that the glTexImage2D succeeds. | 9726 // Ensure that the glTexImage2D succeeds. |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10412 return error::kNoError; | 10420 return error::kNoError; |
| 10413 } | 10421 } |
| 10414 | 10422 |
| 10415 // Include the auto-generated part of this file. We split this because it means | 10423 // Include the auto-generated part of this file. We split this because it means |
| 10416 // we can easily edit the non-auto generated parts right here in this file | 10424 // we can easily edit the non-auto generated parts right here in this file |
| 10417 // instead of having to edit some template or the code generator. | 10425 // instead of having to edit some template or the code generator. |
| 10418 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10426 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 10419 | 10427 |
| 10420 } // namespace gles2 | 10428 } // namespace gles2 |
| 10421 } // namespace gpu | 10429 } // namespace gpu |
| OLD | NEW |