| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 GLsizei height); | 945 GLsizei height); |
| 946 | 946 |
| 947 // Wrapper for glCopyBufferSubData. | 947 // Wrapper for glCopyBufferSubData. |
| 948 void DoCopyBufferSubData(GLenum readtarget, | 948 void DoCopyBufferSubData(GLenum readtarget, |
| 949 GLenum writetarget, | 949 GLenum writetarget, |
| 950 GLintptr readoffset, | 950 GLintptr readoffset, |
| 951 GLintptr writeoffset, | 951 GLintptr writeoffset, |
| 952 GLsizeiptr size); | 952 GLsizeiptr size); |
| 953 | 953 |
| 954 void DoCopyTextureCHROMIUM(GLuint source_id, | 954 void DoCopyTextureCHROMIUM(GLuint source_id, |
| 955 GLint source_level, |
| 955 GLuint dest_id, | 956 GLuint dest_id, |
| 957 GLint dest_level, |
| 956 GLenum internal_format, | 958 GLenum internal_format, |
| 957 GLenum dest_type, | 959 GLenum dest_type, |
| 958 GLboolean unpack_flip_y, | 960 GLboolean unpack_flip_y, |
| 959 GLboolean unpack_premultiply_alpha, | 961 GLboolean unpack_premultiply_alpha, |
| 960 GLboolean unpack_unmultiply_alpha); | 962 GLboolean unpack_unmultiply_alpha); |
| 961 | 963 |
| 962 void DoCopySubTextureCHROMIUM(GLuint source_id, | 964 void DoCopySubTextureCHROMIUM(GLuint source_id, |
| 965 GLint source_level, |
| 963 GLuint dest_id, | 966 GLuint dest_id, |
| 967 GLint dest_level, |
| 964 GLint xoffset, | 968 GLint xoffset, |
| 965 GLint yoffset, | 969 GLint yoffset, |
| 966 GLint x, | 970 GLint x, |
| 967 GLint y, | 971 GLint y, |
| 968 GLsizei width, | 972 GLsizei width, |
| 969 GLsizei height, | 973 GLsizei height, |
| 970 GLboolean unpack_flip_y, | 974 GLboolean unpack_flip_y, |
| 971 GLboolean unpack_premultiply_alpha, | 975 GLboolean unpack_premultiply_alpha, |
| 972 GLboolean unpack_unmultiply_alpha); | 976 GLboolean unpack_unmultiply_alpha); |
| 973 | 977 |
| (...skipping 15351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16325 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 16329 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
| 16326 "invalid internal format"); | 16330 "invalid internal format"); |
| 16327 return false; | 16331 return false; |
| 16328 } | 16332 } |
| 16329 | 16333 |
| 16330 return true; | 16334 return true; |
| 16331 } | 16335 } |
| 16332 | 16336 |
| 16333 void GLES2DecoderImpl::DoCopyTextureCHROMIUM( | 16337 void GLES2DecoderImpl::DoCopyTextureCHROMIUM( |
| 16334 GLuint source_id, | 16338 GLuint source_id, |
| 16339 GLint source_level, |
| 16335 GLuint dest_id, | 16340 GLuint dest_id, |
| 16341 GLint dest_level, |
| 16336 GLenum internal_format, | 16342 GLenum internal_format, |
| 16337 GLenum dest_type, | 16343 GLenum dest_type, |
| 16338 GLboolean unpack_flip_y, | 16344 GLboolean unpack_flip_y, |
| 16339 GLboolean unpack_premultiply_alpha, | 16345 GLboolean unpack_premultiply_alpha, |
| 16340 GLboolean unpack_unmultiply_alpha) { | 16346 GLboolean unpack_unmultiply_alpha) { |
| 16341 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCopyTextureCHROMIUM"); | 16347 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCopyTextureCHROMIUM"); |
| 16342 static const char kFunctionName[] = "glCopyTextureCHROMIUM"; | 16348 static const char kFunctionName[] = "glCopyTextureCHROMIUM"; |
| 16343 | 16349 |
| 16350 // TODO(qiankun.miao@intel.com): Remove this after level > 0 support is |
| 16351 // implemented. See: https://crbug.com/612542. |
| 16352 DCHECK(source_level == 0); |
| 16353 DCHECK(dest_level == 0); |
| 16354 |
| 16344 TextureRef* source_texture_ref = GetTexture(source_id); | 16355 TextureRef* source_texture_ref = GetTexture(source_id); |
| 16345 TextureRef* dest_texture_ref = GetTexture(dest_id); | 16356 TextureRef* dest_texture_ref = GetTexture(dest_id); |
| 16346 | 16357 |
| 16347 if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref, | 16358 if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref, |
| 16348 dest_texture_ref)) { | 16359 dest_texture_ref)) { |
| 16349 return; | 16360 return; |
| 16350 } | 16361 } |
| 16351 | 16362 |
| 16352 Texture* source_texture = source_texture_ref->texture(); | 16363 Texture* source_texture = source_texture_ref->texture(); |
| 16353 Texture* dest_texture = dest_texture_ref->texture(); | 16364 Texture* dest_texture = dest_texture_ref->texture(); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16500 copy_texture_CHROMIUM_->DoCopyTexture( | 16511 copy_texture_CHROMIUM_->DoCopyTexture( |
| 16501 this, source_target, source_texture->service_id(), source_internal_format, | 16512 this, source_target, source_texture->service_id(), source_internal_format, |
| 16502 dest_target, dest_texture->service_id(), internal_format, source_width, | 16513 dest_target, dest_texture->service_id(), internal_format, source_width, |
| 16503 source_height, unpack_flip_y == GL_TRUE, | 16514 source_height, unpack_flip_y == GL_TRUE, |
| 16504 unpack_premultiply_alpha == GL_TRUE, unpack_unmultiply_alpha == GL_TRUE, | 16515 unpack_premultiply_alpha == GL_TRUE, unpack_unmultiply_alpha == GL_TRUE, |
| 16505 method); | 16516 method); |
| 16506 } | 16517 } |
| 16507 | 16518 |
| 16508 void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( | 16519 void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( |
| 16509 GLuint source_id, | 16520 GLuint source_id, |
| 16521 GLint source_level, |
| 16510 GLuint dest_id, | 16522 GLuint dest_id, |
| 16523 GLint dest_level, |
| 16511 GLint xoffset, | 16524 GLint xoffset, |
| 16512 GLint yoffset, | 16525 GLint yoffset, |
| 16513 GLint x, | 16526 GLint x, |
| 16514 GLint y, | 16527 GLint y, |
| 16515 GLsizei width, | 16528 GLsizei width, |
| 16516 GLsizei height, | 16529 GLsizei height, |
| 16517 GLboolean unpack_flip_y, | 16530 GLboolean unpack_flip_y, |
| 16518 GLboolean unpack_premultiply_alpha, | 16531 GLboolean unpack_premultiply_alpha, |
| 16519 GLboolean unpack_unmultiply_alpha) { | 16532 GLboolean unpack_unmultiply_alpha) { |
| 16520 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCopySubTextureCHROMIUM"); | 16533 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCopySubTextureCHROMIUM"); |
| 16521 | 16534 |
| 16535 // TODO(qiankun.miao@intel.com): Remove this after level > 0 support is |
| 16536 // implemented. See: https://crbug.com/612542. |
| 16537 DCHECK(source_level == 0); |
| 16538 DCHECK(dest_level == 0); |
| 16539 |
| 16522 static const char kFunctionName[] = "glCopySubTextureCHROMIUM"; | 16540 static const char kFunctionName[] = "glCopySubTextureCHROMIUM"; |
| 16523 TextureRef* source_texture_ref = GetTexture(source_id); | 16541 TextureRef* source_texture_ref = GetTexture(source_id); |
| 16524 TextureRef* dest_texture_ref = GetTexture(dest_id); | 16542 TextureRef* dest_texture_ref = GetTexture(dest_id); |
| 16525 | 16543 |
| 16526 if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref, | 16544 if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref, |
| 16527 dest_texture_ref)) { | 16545 dest_texture_ref)) { |
| 16528 return; | 16546 return; |
| 16529 } | 16547 } |
| 16530 | 16548 |
| 16531 Texture* source_texture = source_texture_ref->texture(); | 16549 Texture* source_texture = source_texture_ref->texture(); |
| (...skipping 2586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19118 } | 19136 } |
| 19119 | 19137 |
| 19120 // Include the auto-generated part of this file. We split this because it means | 19138 // Include the auto-generated part of this file. We split this because it means |
| 19121 // we can easily edit the non-auto generated parts right here in this file | 19139 // we can easily edit the non-auto generated parts right here in this file |
| 19122 // instead of having to edit some template or the code generator. | 19140 // instead of having to edit some template or the code generator. |
| 19123 #include "base/macros.h" | 19141 #include "base/macros.h" |
| 19124 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19142 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 19125 | 19143 |
| 19126 } // namespace gles2 | 19144 } // namespace gles2 |
| 19127 } // namespace gpu | 19145 } // namespace gpu |
| OLD | NEW |