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_copy_texture_chromium.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 // GL_TEXTURE_RECTANGLE_ARB on FBO is supported by OpenGL, not GLES2, | 480 // GL_TEXTURE_RECTANGLE_ARB on FBO is supported by OpenGL, not GLES2, |
481 // so restrict this to GL_TEXTURE_2D. | 481 // so restrict this to GL_TEXTURE_2D. |
482 if (source_target == GL_TEXTURE_2D && dest_target == GL_TEXTURE_2D && | 482 if (source_target == GL_TEXTURE_2D && dest_target == GL_TEXTURE_2D && |
483 !flip_y && !premultiply_alpha_change && | 483 !flip_y && !premultiply_alpha_change && |
484 source_format_contain_superset_of_dest_format) { | 484 source_format_contain_superset_of_dest_format) { |
485 DoCopyTexSubImage2D(decoder, source_target, source_id, dest_target, dest_id, | 485 DoCopyTexSubImage2D(decoder, source_target, source_id, dest_target, dest_id, |
486 xoffset, yoffset, x, y, width, height, framebuffer_); | 486 xoffset, yoffset, x, y, width, height, framebuffer_); |
487 return; | 487 return; |
488 } | 488 } |
489 | 489 |
| 490 DoCopySubTextureWithTransform( |
| 491 decoder, source_target, source_id, source_internal_format, dest_target, |
| 492 dest_id, dest_internal_format, xoffset, yoffset, x, y, width, height, |
| 493 dest_width, dest_height, source_width, source_height, flip_y, |
| 494 premultiply_alpha, unpremultiply_alpha, kIdentityMatrix); |
| 495 } |
| 496 |
| 497 void CopyTextureCHROMIUMResourceManager::DoCopySubTextureWithTransform( |
| 498 const gles2::GLES2Decoder* decoder, |
| 499 GLenum source_target, |
| 500 GLuint source_id, |
| 501 GLenum source_internal_format, |
| 502 GLenum dest_target, |
| 503 GLuint dest_id, |
| 504 GLenum dest_internal_format, |
| 505 GLint xoffset, |
| 506 GLint yoffset, |
| 507 GLint x, |
| 508 GLint y, |
| 509 GLsizei width, |
| 510 GLsizei height, |
| 511 GLsizei dest_width, |
| 512 GLsizei dest_height, |
| 513 GLsizei source_width, |
| 514 GLsizei source_height, |
| 515 bool flip_y, |
| 516 bool premultiply_alpha, |
| 517 bool unpremultiply_alpha, |
| 518 const GLfloat transform_matrix[16]) { |
490 DoCopyTextureInternal(decoder, source_target, source_id, dest_target, dest_id, | 519 DoCopyTextureInternal(decoder, source_target, source_id, dest_target, dest_id, |
491 xoffset, yoffset, x, y, width, height, dest_width, dest_height, | 520 xoffset, yoffset, x, y, width, height, dest_width, dest_height, |
492 source_width, source_height, flip_y, premultiply_alpha, | 521 source_width, source_height, flip_y, premultiply_alpha, |
493 unpremultiply_alpha, kIdentityMatrix); | 522 unpremultiply_alpha, transform_matrix); |
494 } | 523 } |
495 | 524 |
496 void CopyTextureCHROMIUMResourceManager::DoCopyTextureWithTransform( | 525 void CopyTextureCHROMIUMResourceManager::DoCopyTextureWithTransform( |
497 const gles2::GLES2Decoder* decoder, | 526 const gles2::GLES2Decoder* decoder, |
498 GLenum source_target, | 527 GLenum source_target, |
499 GLuint source_id, | 528 GLuint source_id, |
500 GLenum dest_target, | 529 GLenum dest_target, |
501 GLuint dest_id, | 530 GLuint dest_id, |
502 GLsizei width, | 531 GLsizei width, |
503 GLsizei height, | 532 GLsizei height, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 decoder->RestoreTextureState(dest_id); | 755 decoder->RestoreTextureState(dest_id); |
727 decoder->RestoreTextureUnitBindings(0); | 756 decoder->RestoreTextureUnitBindings(0); |
728 decoder->RestoreActiveTexture(); | 757 decoder->RestoreActiveTexture(); |
729 decoder->RestoreProgramBindings(); | 758 decoder->RestoreProgramBindings(); |
730 decoder->RestoreBufferBindings(); | 759 decoder->RestoreBufferBindings(); |
731 decoder->RestoreFramebufferBindings(); | 760 decoder->RestoreFramebufferBindings(); |
732 decoder->RestoreGlobalState(); | 761 decoder->RestoreGlobalState(); |
733 } | 762 } |
734 | 763 |
735 } // namespace gpu | 764 } // namespace gpu |
OLD | NEW |