| 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/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bits.h" | 10 #include "base/bits.h" |
| (...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1637 TextureRef* texture_ref; | 1637 TextureRef* texture_ref; |
| 1638 if (!ValidateTexImage2D(state, "glTexImage2D", args, &texture_ref)) { | 1638 if (!ValidateTexImage2D(state, "glTexImage2D", args, &texture_ref)) { |
| 1639 return; | 1639 return; |
| 1640 } | 1640 } |
| 1641 | 1641 |
| 1642 DoTexImage2D(texture_state, state->GetErrorState(), framebuffer_state, | 1642 DoTexImage2D(texture_state, state->GetErrorState(), framebuffer_state, |
| 1643 texture_ref, args); | 1643 texture_ref, args); |
| 1644 } | 1644 } |
| 1645 | 1645 |
| 1646 GLenum TextureManager::AdjustTexFormat(GLenum format) const { | 1646 GLenum TextureManager::AdjustTexFormat(GLenum format) const { |
| 1647 // TODO: GLES 3 allows for internal format and format to differ. This logic | 1647 // TODO(bajones): GLES 3 allows for internal format and format to differ. |
| 1648 // may need to change as a result. | 1648 // This logic may need to change as a result. |
| 1649 if (gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) { | 1649 if (gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) { |
| 1650 if (format == GL_SRGB_EXT) | 1650 if (format == GL_SRGB_EXT) |
| 1651 return GL_RGB; | 1651 return GL_RGB; |
| 1652 if (format == GL_SRGB_ALPHA_EXT) | 1652 if (format == GL_SRGB_ALPHA_EXT) |
| 1653 return GL_RGBA; | 1653 return GL_RGBA; |
| 1654 } | 1654 } |
| 1655 return format; | 1655 return format; |
| 1656 } | 1656 } |
| 1657 | 1657 |
| 1658 void TextureManager::DoTexImage2D( | 1658 void TextureManager::DoTexImage2D( |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1722 } | 1722 } |
| 1723 | 1723 |
| 1724 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { | 1724 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { |
| 1725 texture_state_->texture_upload_count++; | 1725 texture_state_->texture_upload_count++; |
| 1726 texture_state_->total_texture_upload_time += | 1726 texture_state_->total_texture_upload_time += |
| 1727 base::TimeTicks::Now() - begin_time_; | 1727 base::TimeTicks::Now() - begin_time_; |
| 1728 } | 1728 } |
| 1729 | 1729 |
| 1730 } // namespace gles2 | 1730 } // namespace gles2 |
| 1731 } // namespace gpu | 1731 } // namespace gpu |
| OLD | NEW |