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 <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 face_infos_.size()); | 1257 face_infos_.size()); |
1258 DCHECK_LT(static_cast<size_t>(level), | 1258 DCHECK_LT(static_cast<size_t>(level), |
1259 face_infos_[face_index].level_infos.size()); | 1259 face_infos_[face_index].level_infos.size()); |
1260 Texture::LevelInfo& info = | 1260 Texture::LevelInfo& info = |
1261 face_infos_[face_index].level_infos[level]; | 1261 face_infos_[face_index].level_infos[level]; |
1262 DCHECK_EQ(info.target, target); | 1262 DCHECK_EQ(info.target, target); |
1263 DCHECK_EQ(info.level, level); | 1263 DCHECK_EQ(info.level, level); |
1264 info.image = image; | 1264 info.image = image; |
1265 UpdateCanRenderCondition(); | 1265 UpdateCanRenderCondition(); |
1266 UpdateHasImages(); | 1266 UpdateHasImages(); |
| 1267 |
| 1268 // TODO(ericrk): Images may have complex sizing not accounted for by |
| 1269 // |estimated_size_|, we should add logic here to update |estimated_size_| |
| 1270 // based on the new GLImage. crbug.com/526298 |
1267 } | 1271 } |
1268 | 1272 |
1269 gfx::GLImage* Texture::GetLevelImage(GLint target, GLint level) const { | 1273 gfx::GLImage* Texture::GetLevelImage(GLint target, GLint level) const { |
1270 if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES && | 1274 if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES && |
1271 target != GL_TEXTURE_RECTANGLE_ARB) { | 1275 target != GL_TEXTURE_RECTANGLE_ARB) { |
1272 return NULL; | 1276 return NULL; |
1273 } | 1277 } |
1274 | 1278 |
1275 size_t face_index = GLES2Util::GLTargetToFaceIndex(target); | 1279 size_t face_index = GLES2Util::GLTargetToFaceIndex(target); |
1276 if (level >= 0 && face_index < face_infos_.size() && | 1280 if (level >= 0 && face_index < face_infos_.size() && |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2134 pmd->AddOwnershipEdge(client_guid, service_guid, importance); | 2138 pmd->AddOwnershipEdge(client_guid, service_guid, importance); |
2135 | 2139 |
2136 // Dump all sub-levels held by the texture. They will appear below the main | 2140 // Dump all sub-levels held by the texture. They will appear below the main |
2137 // gl/textures/client_X/texture_Y dump. | 2141 // gl/textures/client_X/texture_Y dump. |
2138 ref->texture()->DumpLevelMemory(pmd, memory_tracker_->ClientTracingId(), | 2142 ref->texture()->DumpLevelMemory(pmd, memory_tracker_->ClientTracingId(), |
2139 dump_name); | 2143 dump_name); |
2140 } | 2144 } |
2141 | 2145 |
2142 } // namespace gles2 | 2146 } // namespace gles2 |
2143 } // namespace gpu | 2147 } // namespace gpu |
OLD | NEW |