| 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 8036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8047 std::string("PERFORMANCE WARNING: ") + msg); | 8047 std::string("PERFORMANCE WARNING: ") + msg); |
| 8048 } | 8048 } |
| 8049 | 8049 |
| 8050 void GLES2DecoderImpl::DoCopyTexImage(Texture* texture, | 8050 void GLES2DecoderImpl::DoCopyTexImage(Texture* texture, |
| 8051 GLenum textarget, | 8051 GLenum textarget, |
| 8052 gl::GLImage* image) { | 8052 gl::GLImage* image) { |
| 8053 // Note: We update the state to COPIED prior to calling CopyTexImage() | 8053 // Note: We update the state to COPIED prior to calling CopyTexImage() |
| 8054 // as that allows the GLImage implemenatation to set it back to UNBOUND | 8054 // as that allows the GLImage implemenatation to set it back to UNBOUND |
| 8055 // and ensure that CopyTexImage() is called each time the texture is | 8055 // and ensure that CopyTexImage() is called each time the texture is |
| 8056 // used. | 8056 // used. |
| 8057 texture->SetLevelImage(textarget, 0, image, Texture::COPIED); | 8057 texture->SetLevelImageState(textarget, 0, Texture::COPIED); |
| 8058 bool rv = image->CopyTexImage(textarget); | 8058 bool rv = image->CopyTexImage(textarget); |
| 8059 DCHECK(rv) << "Both BindTexImage() and CopyTexImage() failed"; | 8059 DCHECK(rv) << "CopyTexImage() failed"; |
| 8060 } | 8060 } |
| 8061 | 8061 |
| 8062 void GLES2DecoderImpl::DoCopyTexImageIfNeeded(Texture* texture, | 8062 void GLES2DecoderImpl::DoCopyTexImageIfNeeded(Texture* texture, |
| 8063 GLenum textarget) { | 8063 GLenum textarget) { |
| 8064 // Image is already in use if texture is attached to a framebuffer. | 8064 // Image is already in use if texture is attached to a framebuffer. |
| 8065 if (texture && !texture->IsAttachedToFramebuffer()) { | 8065 if (texture && !texture->IsAttachedToFramebuffer()) { |
| 8066 Texture::ImageState image_state; | 8066 Texture::ImageState image_state; |
| 8067 gl::GLImage* image = texture->GetLevelImage(textarget, 0, &image_state); | 8067 gl::GLImage* image = texture->GetLevelImage(textarget, 0, &image_state); |
| 8068 if (image && image_state == Texture::UNBOUND) { | 8068 if (image && image_state == Texture::UNBOUND) { |
| 8069 ScopedGLErrorSuppressor suppressor( | 8069 ScopedGLErrorSuppressor suppressor( |
| (...skipping 8602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16672 } | 16672 } |
| 16673 | 16673 |
| 16674 // Include the auto-generated part of this file. We split this because it means | 16674 // Include the auto-generated part of this file. We split this because it means |
| 16675 // we can easily edit the non-auto generated parts right here in this file | 16675 // we can easily edit the non-auto generated parts right here in this file |
| 16676 // instead of having to edit some template or the code generator. | 16676 // instead of having to edit some template or the code generator. |
| 16677 #include "base/macros.h" | 16677 #include "base/macros.h" |
| 16678 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 16678 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 16679 | 16679 |
| 16680 } // namespace gles2 | 16680 } // namespace gles2 |
| 16681 } // namespace gpu | 16681 } // namespace gpu |
| OLD | NEW |