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

Unified Diff: components/exo/buffer.cc

Issue 2041663002: exo: Handle cross-fade animations properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remote-shell-version-2
Patch Set: remove double negative 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 | « components/exo/buffer.h ('k') | components/exo/buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/buffer.cc
diff --git a/components/exo/buffer.cc b/components/exo/buffer.cc
index f5040bf76a108171f04b905cd1f1f1e3213cb4d5..c3bbd143ed9e81c25a20ad932009b2fc4e8f6425 100644
--- a/components/exo/buffer.cc
+++ b/components/exo/buffer.cc
@@ -369,8 +369,14 @@ Buffer::~Buffer() {}
std::unique_ptr<cc::SingleReleaseCallback> Buffer::ProduceTextureMailbox(
cc::TextureMailbox* texture_mailbox,
bool secure_output_only,
- bool lost_context) {
- DLOG_IF(WARNING, use_count_)
+ bool client_usage) {
+ // Non-client usage can only be allowed when the client is not allowed to
+ // use the buffer. If the buffer has been released to the client then it
+ // can no longer be used as the client might be writing to it.
+ if (!client_usage && !use_count_)
+ return nullptr;
+
+ DLOG_IF(WARNING, use_count_ && client_usage)
<< "Producing a texture mailbox for a buffer that has not been released";
// Some clients think that they can reuse a buffer before it's released by
@@ -380,7 +386,7 @@ std::unique_ptr<cc::SingleReleaseCallback> Buffer::ProduceTextureMailbox(
// buffer has been reused). We stop running the release callback when this
// type of behavior is detected as having the buffer always be busy will
// result in fewer drawing artifacts.
- if (use_count_ && !lost_context)
+ if (use_count_ && client_usage)
release_callback_.Reset();
// Increment the use count for this buffer.
« no previous file with comments | « components/exo/buffer.h ('k') | components/exo/buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698