| 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 10071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10082 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { | 10082 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { |
| 10083 // TODO(hkuang): get the StreamTexture transform matrix in GPU process | 10083 // TODO(hkuang): get the StreamTexture transform matrix in GPU process |
| 10084 // instead of using default matrix crbug.com/226218. | 10084 // instead of using default matrix crbug.com/226218. |
| 10085 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, | 10085 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, |
| 10086 0.0f, 1.0f, 0.0f, 0.0f, | 10086 0.0f, 1.0f, 0.0f, 0.0f, |
| 10087 0.0f, 0.0f, 1.0f, 0.0f, | 10087 0.0f, 0.0f, 1.0f, 0.0f, |
| 10088 0.0f, 0.0f, 0.0f, 1.0f}; | 10088 0.0f, 0.0f, 0.0f, 1.0f}; |
| 10089 copy_texture_CHROMIUM_->DoCopyTextureWithTransform( | 10089 copy_texture_CHROMIUM_->DoCopyTextureWithTransform( |
| 10090 this, | 10090 this, |
| 10091 source_texture->target(), | 10091 source_texture->target(), |
| 10092 dest_texture->target(), | |
| 10093 source_texture->service_id(), | 10092 source_texture->service_id(), |
| 10094 dest_texture->service_id(), level, | 10093 dest_texture->service_id(), |
| 10095 source_width, source_height, | 10094 level, |
| 10095 internal_format, |
| 10096 source_width, |
| 10097 source_height, |
| 10096 unpack_flip_y_, | 10098 unpack_flip_y_, |
| 10097 unpack_premultiply_alpha_, | 10099 unpack_premultiply_alpha_, |
| 10098 unpack_unpremultiply_alpha_, | 10100 unpack_unpremultiply_alpha_, |
| 10099 default_matrix); | 10101 default_matrix); |
| 10100 } else { | 10102 } else { |
| 10101 copy_texture_CHROMIUM_->DoCopyTexture( | 10103 copy_texture_CHROMIUM_->DoCopyTexture(this, |
| 10102 this, | 10104 source_texture->target(), |
| 10103 source_texture->target(), | 10105 source_texture->service_id(), |
| 10104 dest_texture->target(), | 10106 dest_texture->service_id(), |
| 10105 source_texture->service_id(), | 10107 level, |
| 10106 dest_texture->service_id(), level, | 10108 internal_format, |
| 10107 source_width, source_height, | 10109 source_width, |
| 10108 unpack_flip_y_, | 10110 source_height, |
| 10109 unpack_premultiply_alpha_, | 10111 unpack_flip_y_, |
| 10110 unpack_unpremultiply_alpha_); | 10112 unpack_premultiply_alpha_, |
| 10113 unpack_unpremultiply_alpha_); |
| 10111 } | 10114 } |
| 10112 | 10115 |
| 10113 DoDidUseTexImageIfNeeded(source_texture, source_texture->target()); | 10116 DoDidUseTexImageIfNeeded(source_texture, source_texture->target()); |
| 10114 } | 10117 } |
| 10115 | 10118 |
| 10116 static GLenum ExtractTypeFromStorageFormat(GLenum internalformat) { | 10119 static GLenum ExtractTypeFromStorageFormat(GLenum internalformat) { |
| 10117 switch (internalformat) { | 10120 switch (internalformat) { |
| 10118 case GL_RGB565: | 10121 case GL_RGB565: |
| 10119 return GL_UNSIGNED_SHORT_5_6_5; | 10122 return GL_UNSIGNED_SHORT_5_6_5; |
| 10120 case GL_RGBA4: | 10123 case GL_RGBA4: |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10916 } | 10919 } |
| 10917 } | 10920 } |
| 10918 | 10921 |
| 10919 // Include the auto-generated part of this file. We split this because it means | 10922 // Include the auto-generated part of this file. We split this because it means |
| 10920 // we can easily edit the non-auto generated parts right here in this file | 10923 // we can easily edit the non-auto generated parts right here in this file |
| 10921 // instead of having to edit some template or the code generator. | 10924 // instead of having to edit some template or the code generator. |
| 10922 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10925 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 10923 | 10926 |
| 10924 } // namespace gles2 | 10927 } // namespace gles2 |
| 10925 } // namespace gpu | 10928 } // namespace gpu |
| OLD | NEW |