| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1614 | 1614 |
| 1615 void Texture::ApplyFormatWorkarounds(FeatureInfo* feature_info) { | 1615 void Texture::ApplyFormatWorkarounds(FeatureInfo* feature_info) { |
| 1616 if (feature_info->gl_version_info().is_desktop_core_profile) { | 1616 if (feature_info->gl_version_info().is_desktop_core_profile) { |
| 1617 if (static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size()) | 1617 if (static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size()) |
| 1618 return; | 1618 return; |
| 1619 const Texture::LevelInfo& info = face_infos_[0].level_infos[base_level_]; | 1619 const Texture::LevelInfo& info = face_infos_[0].level_infos[base_level_]; |
| 1620 SetCompatibilitySwizzle(GetCompatibilitySwizzle(info.format)); | 1620 SetCompatibilitySwizzle(GetCompatibilitySwizzle(info.format)); |
| 1621 } | 1621 } |
| 1622 } | 1622 } |
| 1623 | 1623 |
| 1624 bool Texture::EmulatingRGB() { |
| 1625 for (const FaceInfo& face_info : face_infos_) { |
| 1626 for (const LevelInfo& level_info : face_info.level_infos) { |
| 1627 if (level_info.image && level_info.image->EmulatingRGB()) |
| 1628 return true; |
| 1629 } |
| 1630 } |
| 1631 return false; |
| 1632 } |
| 1633 |
| 1624 TextureRef::TextureRef(TextureManager* manager, | 1634 TextureRef::TextureRef(TextureManager* manager, |
| 1625 GLuint client_id, | 1635 GLuint client_id, |
| 1626 Texture* texture) | 1636 Texture* texture) |
| 1627 : manager_(manager), | 1637 : manager_(manager), |
| 1628 texture_(texture), | 1638 texture_(texture), |
| 1629 client_id_(client_id), | 1639 client_id_(client_id), |
| 1630 num_observers_(0) { | 1640 num_observers_(0) { |
| 1631 DCHECK(manager_); | 1641 DCHECK(manager_); |
| 1632 DCHECK(texture_); | 1642 DCHECK(texture_); |
| 1633 texture_->AddTextureRef(this); | 1643 texture_->AddTextureRef(this); |
| (...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3134 uint32_t TextureManager::GetServiceIdGeneration() const { | 3144 uint32_t TextureManager::GetServiceIdGeneration() const { |
| 3135 return current_service_id_generation_; | 3145 return current_service_id_generation_; |
| 3136 } | 3146 } |
| 3137 | 3147 |
| 3138 void TextureManager::IncrementServiceIdGeneration() { | 3148 void TextureManager::IncrementServiceIdGeneration() { |
| 3139 current_service_id_generation_++; | 3149 current_service_id_generation_++; |
| 3140 } | 3150 } |
| 3141 | 3151 |
| 3142 } // namespace gles2 | 3152 } // namespace gles2 |
| 3143 } // namespace gpu | 3153 } // namespace gpu |
| OLD | NEW |