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 // TODO(hkuang): Add support to get width/height of StreamTexture |
| 9631 // crbug.com/225781. |
9630 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { | 9632 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { |
| 9633 if (!dest_level_defined) { |
| 9634 LOCAL_SET_GL_ERROR( |
| 9635 GL_INVALID_VALUE, |
| 9636 "glCopyTextureCHROMIUM", "destination level not defined"); |
| 9637 return; |
| 9638 } |
9631 source_width = dest_width; | 9639 source_width = dest_width; |
9632 source_height = dest_height; | 9640 source_height = dest_height; |
9633 } | 9641 } |
9634 | 9642 |
9635 // Resize the destination texture to the dimensions of the source texture. | 9643 // Resize the destination texture to the dimensions of the source texture. |
9636 if (!dest_level_defined || dest_width != source_width || | 9644 if (!dest_level_defined || dest_width != source_width || |
9637 dest_height != source_height || | 9645 dest_height != source_height || |
9638 dest_internal_format != internal_format || | 9646 dest_internal_format != internal_format || |
9639 dest_type_previous != dest_type) { | 9647 dest_type_previous != dest_type) { |
9640 // Ensure that the glTexImage2D succeeds. | 9648 // Ensure that the glTexImage2D succeeds. |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10332 return error::kNoError; | 10340 return error::kNoError; |
10333 } | 10341 } |
10334 | 10342 |
10335 // Include the auto-generated part of this file. We split this because it means | 10343 // 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 | 10344 // 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. | 10345 // instead of having to edit some template or the code generator. |
10338 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10346 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10339 | 10347 |
10340 } // namespace gles2 | 10348 } // namespace gles2 |
10341 } // namespace gpu | 10349 } // namespace gpu |
OLD | NEW |