| 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 15366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16340 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 16344 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
| 16341 "invalid internal format"); | 16345 "invalid internal format"); |
| 16342 return false; | 16346 return false; |
| 16343 } | 16347 } |
| 16344 | 16348 |
| 16345 return true; | 16349 return true; |
| 16346 } | 16350 } |
| 16347 | 16351 |
| 16348 void GLES2DecoderImpl::DoCopyTextureCHROMIUM( | 16352 void GLES2DecoderImpl::DoCopyTextureCHROMIUM( |
| 16349 GLuint source_id, | 16353 GLuint source_id, |
| 16354 GLint source_level, |
| 16350 GLuint dest_id, | 16355 GLuint dest_id, |
| 16356 GLint dest_level, |
| 16351 GLenum internal_format, | 16357 GLenum internal_format, |
| 16352 GLenum dest_type, | 16358 GLenum dest_type, |
| 16353 GLboolean unpack_flip_y, | 16359 GLboolean unpack_flip_y, |
| 16354 GLboolean unpack_premultiply_alpha, | 16360 GLboolean unpack_premultiply_alpha, |
| 16355 GLboolean unpack_unmultiply_alpha) { | 16361 GLboolean unpack_unmultiply_alpha) { |
| 16356 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCopyTextureCHROMIUM"); | 16362 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCopyTextureCHROMIUM"); |
| 16357 static const char kFunctionName[] = "glCopyTextureCHROMIUM"; | 16363 static const char kFunctionName[] = "glCopyTextureCHROMIUM"; |
| 16358 | 16364 |
| 16365 // TODO(qiankun.miao@intel.com): Remove this after level > 0 support is |
| 16366 // implemented. See: https://crbug.com/612542. |
| 16367 DCHECK(source_level == 0); |
| 16368 DCHECK(dest_level == 0); |
| 16369 |
| 16359 TextureRef* source_texture_ref = GetTexture(source_id); | 16370 TextureRef* source_texture_ref = GetTexture(source_id); |
| 16360 TextureRef* dest_texture_ref = GetTexture(dest_id); | 16371 TextureRef* dest_texture_ref = GetTexture(dest_id); |
| 16361 | 16372 |
| 16362 if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref, | 16373 if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref, |
| 16363 dest_texture_ref)) { | 16374 dest_texture_ref)) { |
| 16364 return; | 16375 return; |
| 16365 } | 16376 } |
| 16366 | 16377 |
| 16367 Texture* source_texture = source_texture_ref->texture(); | 16378 Texture* source_texture = source_texture_ref->texture(); |
| 16368 Texture* dest_texture = dest_texture_ref->texture(); | 16379 Texture* dest_texture = dest_texture_ref->texture(); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16515 copy_texture_CHROMIUM_->DoCopyTexture( | 16526 copy_texture_CHROMIUM_->DoCopyTexture( |
| 16516 this, source_target, source_texture->service_id(), source_internal_format, | 16527 this, source_target, source_texture->service_id(), source_internal_format, |
| 16517 dest_target, dest_texture->service_id(), internal_format, source_width, | 16528 dest_target, dest_texture->service_id(), internal_format, source_width, |
| 16518 source_height, unpack_flip_y == GL_TRUE, | 16529 source_height, unpack_flip_y == GL_TRUE, |
| 16519 unpack_premultiply_alpha == GL_TRUE, unpack_unmultiply_alpha == GL_TRUE, | 16530 unpack_premultiply_alpha == GL_TRUE, unpack_unmultiply_alpha == GL_TRUE, |
| 16520 method); | 16531 method); |
| 16521 } | 16532 } |
| 16522 | 16533 |
| 16523 void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( | 16534 void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( |
| 16524 GLuint source_id, | 16535 GLuint source_id, |
| 16536 GLint source_level, |
| 16525 GLuint dest_id, | 16537 GLuint dest_id, |
| 16538 GLint dest_level, |
| 16526 GLint xoffset, | 16539 GLint xoffset, |
| 16527 GLint yoffset, | 16540 GLint yoffset, |
| 16528 GLint x, | 16541 GLint x, |
| 16529 GLint y, | 16542 GLint y, |
| 16530 GLsizei width, | 16543 GLsizei width, |
| 16531 GLsizei height, | 16544 GLsizei height, |
| 16532 GLboolean unpack_flip_y, | 16545 GLboolean unpack_flip_y, |
| 16533 GLboolean unpack_premultiply_alpha, | 16546 GLboolean unpack_premultiply_alpha, |
| 16534 GLboolean unpack_unmultiply_alpha) { | 16547 GLboolean unpack_unmultiply_alpha) { |
| 16535 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCopySubTextureCHROMIUM"); | 16548 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCopySubTextureCHROMIUM"); |
| 16536 | 16549 |
| 16550 // TODO(qiankun.miao@intel.com): Remove this after level > 0 support is |
| 16551 // implemented. See: https://crbug.com/612542. |
| 16552 DCHECK(source_level == 0); |
| 16553 DCHECK(dest_level == 0); |
| 16554 |
| 16537 static const char kFunctionName[] = "glCopySubTextureCHROMIUM"; | 16555 static const char kFunctionName[] = "glCopySubTextureCHROMIUM"; |
| 16538 TextureRef* source_texture_ref = GetTexture(source_id); | 16556 TextureRef* source_texture_ref = GetTexture(source_id); |
| 16539 TextureRef* dest_texture_ref = GetTexture(dest_id); | 16557 TextureRef* dest_texture_ref = GetTexture(dest_id); |
| 16540 | 16558 |
| 16541 if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref, | 16559 if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref, |
| 16542 dest_texture_ref)) { | 16560 dest_texture_ref)) { |
| 16543 return; | 16561 return; |
| 16544 } | 16562 } |
| 16545 | 16563 |
| 16546 Texture* source_texture = source_texture_ref->texture(); | 16564 Texture* source_texture = source_texture_ref->texture(); |
| (...skipping 2586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19133 } | 19151 } |
| 19134 | 19152 |
| 19135 // Include the auto-generated part of this file. We split this because it means | 19153 // Include the auto-generated part of this file. We split this because it means |
| 19136 // we can easily edit the non-auto generated parts right here in this file | 19154 // we can easily edit the non-auto generated parts right here in this file |
| 19137 // instead of having to edit some template or the code generator. | 19155 // instead of having to edit some template or the code generator. |
| 19138 #include "base/macros.h" | 19156 #include "base/macros.h" |
| 19139 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19157 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 19140 | 19158 |
| 19141 } // namespace gles2 | 19159 } // namespace gles2 |
| 19142 } // namespace gpu | 19160 } // namespace gpu |
| OLD | NEW |