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

Unified Diff: cc/layers/texture_layer.cc

Issue 17176027: Add gpu command buffer support for loseContextCHROMIUM (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch 2 Created 7 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
Index: cc/layers/texture_layer.cc
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index 4266718daaec2b885b96292fdc85fed6e34199a7..d4e63759514cdbabd06029a0469a027302c3a13f 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -62,7 +62,7 @@ TextureLayer::~TextureLayer() {
if (layer_tree_host()) {
if (texture_id_)
layer_tree_host()->AcquireLayerTextures();
- if (rate_limit_context_ && client_)
+ if (rate_limit_context_ && client_ && client_->Context3d())
layer_tree_host()->StopRateLimiter(client_->Context3d());
}
if (own_mailbox_)
@@ -125,7 +125,8 @@ void TextureLayer::SetPremultipliedAlpha(bool premultiplied_alpha) {
}
void TextureLayer::SetRateLimitContext(bool rate_limit) {
- if (!rate_limit && rate_limit_context_ && client_ && layer_tree_host())
+ if (!rate_limit && rate_limit_context_ && client_ && client_->Context3d() &&
+ layer_tree_host())
layer_tree_host()->StopRateLimiter(client_->Context3d());
rate_limit_context_ = rate_limit;
@@ -163,7 +164,8 @@ void TextureLayer::WillModifyTexture() {
void TextureLayer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
Layer::SetNeedsDisplayRect(dirty_rect);
- if (rate_limit_context_ && client_ && layer_tree_host() && DrawsContent())
+ if (rate_limit_context_ && client_ && client_->Context3d() &&
Justin Novosad 2013/06/21 18:24:11 I was getting test crashes right here because of l
piman 2013/06/21 19:05:05 Why is the context NULL after a context loss? Losi
+ layer_tree_host() && DrawsContent())
layer_tree_host()->StartRateLimiter(client_->Context3d());
}
@@ -190,6 +192,7 @@ void TextureLayer::Update(ResourceUpdateQueue* queue,
texture_id_ = client_->PrepareTexture(queue);
}
context_lost_ =
+ !client_->Context3d() ||
client_->Context3d()->getGraphicsResetStatusARB() != GL_NO_ERROR;
}

Powered by Google App Engine
This is Rietveld 408576698