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

Unified Diff: cc/layers/texture_layer.cc

Issue 23530003: cc: Block commit on activate by setting a flag on LayerTreeHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 27594734a4a36c8d8a3e4c46773fa7d02775221d..920b4aa52b17288a2f9b4f8eff6b838c6a4b1e92 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -137,6 +137,9 @@ void TextureLayer::SetTextureMailbox(const TextureMailbox& mailbox) {
holder_ref_.reset();
needs_set_mailbox_ = true;
SetNeedsCommit();
+ // The active frame needs to be replaced and the mailbox returned before the
+ // commit is called complete.
+ SetNextCommitWaitsForActivation();
}
void TextureLayer::WillModifyTexture() {
@@ -160,16 +163,24 @@ void TextureLayer::SetLayerTreeHost(LayerTreeHost* host) {
}
if (layer_tree_host()) {
- if (texture_id_)
+ if (texture_id_) {
layer_tree_host()->AcquireLayerTextures();
+ // The active frame needs to be replaced and the mailbox returned before
+ // the commit is called complete.
+ SetNextCommitWaitsForActivation();
+ }
if (rate_limit_context_ && client_)
layer_tree_host()->StopRateLimiter(client_->Context3d());
}
// If we're removed from the tree, the TextureLayerImpl will be destroyed, and
// we will need to set the mailbox again on a new TextureLayerImpl the next
// time we push.
- if (!host && uses_mailbox_ && holder_ref_)
+ if (!host && uses_mailbox_ && holder_ref_) {
needs_set_mailbox_ = true;
+ // The active frame needs to be replaced and the mailbox returned before the
+ // commit is called complete.
+ SetNextCommitWaitsForActivation();
+ }
Layer::SetLayerTreeHost(host);
}
@@ -195,6 +206,7 @@ bool TextureLayer::Update(ResourceUpdateQueue* queue,
client_->Context3d()->getGraphicsResetStatusARB() != GL_NO_ERROR)
texture_id_ = 0;
updated = true;
+ SetNextCommitWaitsForActivation();
}
}
@@ -240,13 +252,6 @@ Region TextureLayer::VisibleContentOpaqueRegion() const {
return Region();
}
-bool TextureLayer::BlocksPendingCommit() const {
- // Double-buffered texture layers need to be blocked until they can be made
- // triple-buffered. Single-buffered layers already prevent draws, so
- // can block too for simplicity.
- return DrawsContent();
-}
-
bool TextureLayer::CanClipSelf() const {
return true;
}

Powered by Google App Engine
This is Rietveld 408576698