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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "gpu/command_buffer/service/gl_utils.h" | 10 #include "gpu/command_buffer/service/gl_utils.h" |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 GLsizei dest_height, | 464 GLsizei dest_height, |
465 GLsizei source_width, | 465 GLsizei source_width, |
466 GLsizei source_height, | 466 GLsizei source_height, |
467 bool flip_y, | 467 bool flip_y, |
468 bool premultiply_alpha, | 468 bool premultiply_alpha, |
469 bool unpremultiply_alpha, | 469 bool unpremultiply_alpha, |
470 const GLfloat transform_matrix[16]) { | 470 const GLfloat transform_matrix[16]) { |
471 DCHECK(source_target == GL_TEXTURE_2D || | 471 DCHECK(source_target == GL_TEXTURE_2D || |
472 source_target == GL_TEXTURE_RECTANGLE_ARB || | 472 source_target == GL_TEXTURE_RECTANGLE_ARB || |
473 source_target == GL_TEXTURE_EXTERNAL_OES); | 473 source_target == GL_TEXTURE_EXTERNAL_OES); |
474 DCHECK(xoffset >= 0 && xoffset + source_width <= dest_width); | 474 DCHECK_GE(xoffset, 0); |
475 DCHECK(yoffset >= 0 && yoffset + source_height <= dest_height); | 475 DCHECK_LE(xoffset + width, dest_width); |
| 476 DCHECK_GE(yoffset, 0); |
| 477 DCHECK_LE(yoffset + height, dest_height); |
476 if (!initialized_) { | 478 if (!initialized_) { |
477 DLOG(ERROR) << "CopyTextureCHROMIUM: Uninitialized manager."; | 479 DLOG(ERROR) << "CopyTextureCHROMIUM: Uninitialized manager."; |
478 return; | 480 return; |
479 } | 481 } |
480 | 482 |
481 VertexShaderId vertex_shader_id = GetVertexShaderId(flip_y); | 483 VertexShaderId vertex_shader_id = GetVertexShaderId(flip_y); |
482 DCHECK_LT(static_cast<size_t>(vertex_shader_id), vertex_shaders_.size()); | 484 DCHECK_LT(static_cast<size_t>(vertex_shader_id), vertex_shaders_.size()); |
483 FragmentShaderId fragment_shader_id = GetFragmentShaderId( | 485 FragmentShaderId fragment_shader_id = GetFragmentShaderId( |
484 premultiply_alpha, unpremultiply_alpha, source_target); | 486 premultiply_alpha, unpremultiply_alpha, source_target); |
485 DCHECK_LT(static_cast<size_t>(fragment_shader_id), fragment_shaders_.size()); | 487 DCHECK_LT(static_cast<size_t>(fragment_shader_id), fragment_shaders_.size()); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 decoder->RestoreTextureState(dest_id); | 594 decoder->RestoreTextureState(dest_id); |
593 decoder->RestoreTextureUnitBindings(0); | 595 decoder->RestoreTextureUnitBindings(0); |
594 decoder->RestoreActiveTexture(); | 596 decoder->RestoreActiveTexture(); |
595 decoder->RestoreProgramBindings(); | 597 decoder->RestoreProgramBindings(); |
596 decoder->RestoreBufferBindings(); | 598 decoder->RestoreBufferBindings(); |
597 decoder->RestoreFramebufferBindings(); | 599 decoder->RestoreFramebufferBindings(); |
598 decoder->RestoreGlobalState(); | 600 decoder->RestoreGlobalState(); |
599 } | 601 } |
600 | 602 |
601 } // namespace gpu | 603 } // namespace gpu |
OLD | NEW |