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

Unified Diff: gpu/command_buffer/service/texture_manager.cc

Issue 2087663002: Simplify logic involving BackTexture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp91
Patch Set: Fixes. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_manager.cc
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index f3cc1d1170ea6d886bf2cfa3ea087f8ce470eaa9..a52ea3fade89a8c5dd84b4ed18f4336e973a925d 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -1698,7 +1698,8 @@ TextureRef::TextureRef(TextureManager* manager,
: manager_(manager),
texture_(texture),
client_id_(client_id),
- num_observers_(0) {
+ num_observers_(0),
+ force_context_lost_(false) {
DCHECK(manager_);
DCHECK(texture_);
texture_->AddTextureRef(this);
@@ -1713,10 +1714,15 @@ scoped_refptr<TextureRef> TextureRef::Create(TextureManager* manager,
TextureRef::~TextureRef() {
manager_->StopTracking(this);
- texture_->RemoveTextureRef(this, manager_->have_context_);
+ texture_->RemoveTextureRef(
+ this, force_context_lost_ ? false : manager_->have_context_);
manager_ = NULL;
}
+void TextureRef::ForceContextLost() {
+ force_context_lost_ = true;
+}
+
TextureManager::TextureManager(MemoryTracker* memory_tracker,
FeatureInfo* feature_info,
GLint max_texture_size,
« 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