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

Unified Diff: cc/resources/resource_provider.cc

Issue 2559523002: Send overlay promotion hints from to GLStreamTextureImage. (Closed)
Patch Set: reverted media Created 4 years 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/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index b5ee7a999e86394ebb20d96a18e1662aeb040e89..fce4fac88fec5a7a974b109d293599965309c582 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -1677,18 +1677,30 @@ void ResourceProvider::ReceiveReturnsFromParent(
#if defined(OS_ANDROID)
void ResourceProvider::SendPromotionHints(
- const ResourceIdSet& promotable_hints) {
+ const OverlayCandidateList::PromotionHintInfoMap& promotion_hints) {
+ GLES2Interface* gl = ContextGL();
+ if (!gl)
+ return;
+
for (const auto& id : wants_promotion_hints_set_) {
+ const ResourceMap::iterator it = resources_.find(id);
+ if (it == resources_.end())
+ continue;
+
+ if (it->second.marked_for_deletion)
+ continue;
+
const Resource* resource = LockForRead(id);
DCHECK(resource->wants_promotion_hint);
// Insist that this is backed by a GPU texture.
if (IsGpuResourceType(resource->type)) {
DCHECK(resource->gl_id);
- // TODO(liberato): Here we would either construct a set to send all at
- // once, or send the promotion hint individually to resource->gl_id, based
- // on whether promtable_hints.count(it->first) > 0 .
- // crbug.com/671357
+ auto iter = promotion_hints.find(id);
+ bool promotable = iter != promotion_hints.end();
+ gl->SendOverlayPromotionHintCHROMIUM(resource->gl_id, promotable,
+ promotable ? iter->second.x() : 0,
+ promotable ? iter->second.y() : 0);
}
UnlockForRead(id);
}

Powered by Google App Engine
This is Rietveld 408576698