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 8176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8187 std::string("PERFORMANCE WARNING: ") + msg); | 8187 std::string("PERFORMANCE WARNING: ") + msg); |
8188 } | 8188 } |
8189 | 8189 |
8190 void GLES2DecoderImpl::DoCopyTexImage(Texture* texture, | 8190 void GLES2DecoderImpl::DoCopyTexImage(Texture* texture, |
8191 GLenum textarget, | 8191 GLenum textarget, |
8192 gl::GLImage* image) { | 8192 gl::GLImage* image) { |
8193 // Note: We update the state to COPIED prior to calling CopyTexImage() | 8193 // Note: We update the state to COPIED prior to calling CopyTexImage() |
8194 // as that allows the GLImage implemenatation to set it back to UNBOUND | 8194 // as that allows the GLImage implemenatation to set it back to UNBOUND |
8195 // and ensure that CopyTexImage() is called each time the texture is | 8195 // and ensure that CopyTexImage() is called each time the texture is |
8196 // used. | 8196 // used. |
8197 texture->SetLevelImage(textarget, 0, image, Texture::COPIED); | 8197 texture->SetLevelImageState(textarget, 0, Texture::COPIED); |
8198 bool rv = image->CopyTexImage(textarget); | 8198 bool rv = image->CopyTexImage(textarget); |
8199 DCHECK(rv) << "Both BindTexImage() and CopyTexImage() failed"; | 8199 DCHECK(rv) << "CopyTexImage() failed"; |
8200 } | 8200 } |
8201 | 8201 |
8202 void GLES2DecoderImpl::DoCopyTexImageIfNeeded(Texture* texture, | 8202 void GLES2DecoderImpl::DoCopyTexImageIfNeeded(Texture* texture, |
8203 GLenum textarget) { | 8203 GLenum textarget) { |
8204 // Image is already in use if texture is attached to a framebuffer. | 8204 // Image is already in use if texture is attached to a framebuffer. |
8205 if (texture && !texture->IsAttachedToFramebuffer()) { | 8205 if (texture && !texture->IsAttachedToFramebuffer()) { |
8206 Texture::ImageState image_state; | 8206 Texture::ImageState image_state; |
8207 gl::GLImage* image = texture->GetLevelImage(textarget, 0, &image_state); | 8207 gl::GLImage* image = texture->GetLevelImage(textarget, 0, &image_state); |
8208 if (image && image_state == Texture::UNBOUND) { | 8208 if (image && image_state == Texture::UNBOUND) { |
8209 ScopedGLErrorSuppressor suppressor( | 8209 ScopedGLErrorSuppressor suppressor( |
(...skipping 8579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16789 } | 16789 } |
16790 | 16790 |
16791 // Include the auto-generated part of this file. We split this because it means | 16791 // Include the auto-generated part of this file. We split this because it means |
16792 // we can easily edit the non-auto generated parts right here in this file | 16792 // we can easily edit the non-auto generated parts right here in this file |
16793 // instead of having to edit some template or the code generator. | 16793 // instead of having to edit some template or the code generator. |
16794 #include "base/macros.h" | 16794 #include "base/macros.h" |
16795 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 16795 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
16796 | 16796 |
16797 } // namespace gles2 | 16797 } // namespace gles2 |
16798 } // namespace gpu | 16798 } // namespace gpu |
OLD | NEW |