Chromium Code Reviews| 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; |
| } |