Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1132)

Side by Side Diff: gpu/command_buffer/service/texture_manager.cc

Issue 1883273004: Emulate TEXTURE_IMMUTABLE_LEVELS on GL lower than 4.2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 if (!ClearLevel(decoder, info.target, jj)) { 1312 if (!ClearLevel(decoder, info.target, jj)) {
1313 return false; 1313 return false;
1314 } 1314 }
1315 } 1315 }
1316 } 1316 }
1317 } 1317 }
1318 UpdateSafeToRenderFrom(true); 1318 UpdateSafeToRenderFrom(true);
1319 return true; 1319 return true;
1320 } 1320 }
1321 1321
1322 GLint Texture::GetImmutableLevels() const {
1323 if (!immutable_)
1324 return 0;
1325 GLint levels = 0;
1326 if (immutable_) {
1327 DCHECK(face_infos_.size() > 0);
1328 for (size_t ii = 0; ii < face_infos_[0].level_infos.size(); ++ii) {
1329 const Texture::LevelInfo& info = face_infos_[0].level_infos[ii];
1330 if (info.target != 0)
1331 levels++;
1332 }
1333 }
1334 return levels;
1335 }
1336
1322 gfx::Rect Texture::GetLevelClearedRect(GLenum target, GLint level) const { 1337 gfx::Rect Texture::GetLevelClearedRect(GLenum target, GLint level) const {
1323 size_t face_index = GLES2Util::GLTargetToFaceIndex(target); 1338 size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
1324 if (face_index >= face_infos_.size() || 1339 if (face_index >= face_infos_.size() ||
1325 level >= static_cast<GLint>(face_infos_[face_index].level_infos.size())) { 1340 level >= static_cast<GLint>(face_infos_[face_index].level_infos.size())) {
1326 return gfx::Rect(); 1341 return gfx::Rect();
1327 } 1342 }
1328 1343
1329 const Texture::LevelInfo& info = face_infos_[face_index].level_infos[level]; 1344 const Texture::LevelInfo& info = face_infos_[face_index].level_infos[level];
1330 1345
1331 return info.cleared_rect; 1346 return info.cleared_rect;
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after
3134 uint32_t TextureManager::GetServiceIdGeneration() const { 3149 uint32_t TextureManager::GetServiceIdGeneration() const {
3135 return current_service_id_generation_; 3150 return current_service_id_generation_;
3136 } 3151 }
3137 3152
3138 void TextureManager::IncrementServiceIdGeneration() { 3153 void TextureManager::IncrementServiceIdGeneration() {
3139 current_service_id_generation_++; 3154 current_service_id_generation_++;
3140 } 3155 }
3141 3156
3142 } // namespace gles2 3157 } // namespace gles2
3143 } // namespace gpu 3158 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698