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 8480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8491 0, internal_format, dest_type, NULL); | 8491 0, internal_format, dest_type, NULL); |
8492 GLenum error = PeekGLError(); | 8492 GLenum error = PeekGLError(); |
8493 if (error != GL_NO_ERROR) { | 8493 if (error != GL_NO_ERROR) { |
8494 RestoreCurrentTexture2DBindings(); | 8494 RestoreCurrentTexture2DBindings(); |
8495 return; | 8495 return; |
8496 } | 8496 } |
8497 | 8497 |
8498 texture_manager()->SetLevelInfo( | 8498 texture_manager()->SetLevelInfo( |
8499 dest_info, GL_TEXTURE_2D, level, internal_format, source_width, | 8499 dest_info, GL_TEXTURE_2D, level, internal_format, source_width, |
8500 source_height, 1, 0, internal_format, dest_type, true); | 8500 source_height, 1, 0, internal_format, dest_type, true); |
| 8501 } else { |
| 8502 texture_manager()->SetLevelCleared(dest_info, GL_TEXTURE_2D, level); |
8501 } | 8503 } |
8502 | 8504 |
8503 state_dirty_ = true; | 8505 state_dirty_ = true; |
8504 glViewport(0, 0, source_width, source_height); | 8506 glViewport(0, 0, source_width, source_height); |
8505 copy_texture_CHROMIUM_->DoCopyTexture(target, source_info->service_id(), | 8507 copy_texture_CHROMIUM_->DoCopyTexture(target, source_info->service_id(), |
8506 dest_info->service_id(), level, | 8508 dest_info->service_id(), level, |
8507 unpack_flip_y_, | 8509 unpack_flip_y_, |
8508 unpack_premultiply_alpha_); | 8510 unpack_premultiply_alpha_); |
8509 glViewport(viewport_x_, viewport_y_, viewport_width_, viewport_height_); | 8511 glViewport(viewport_x_, viewport_y_, viewport_width_, viewport_height_); |
8510 | 8512 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8687 BindAndApplyTextureParameters(info); | 8689 BindAndApplyTextureParameters(info); |
8688 } | 8690 } |
8689 | 8691 |
8690 // Include the auto-generated part of this file. We split this because it means | 8692 // Include the auto-generated part of this file. We split this because it means |
8691 // we can easily edit the non-auto generated parts right here in this file | 8693 // we can easily edit the non-auto generated parts right here in this file |
8692 // instead of having to edit some template or the code generator. | 8694 // instead of having to edit some template or the code generator. |
8693 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 8695 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
8694 | 8696 |
8695 } // namespace gles2 | 8697 } // namespace gles2 |
8696 } // namespace gpu | 8698 } // namespace gpu |
OLD | NEW |