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

Unified Diff: cc/resources/resource_provider.cc

Issue 2559523002: Send overlay promotion hints from to GLStreamTextureImage. (Closed)
Patch Set: fiddled with GLboolean for windows compiler 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..6547109d3a5f35a9a409073f1a0bc3d6b93041c2 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->OverlayPromotionHintCHROMIUM(resource->gl_id, promotable,
+ promotable ? iter->second.x() : 0,
+ promotable ? iter->second.y() : 0);
}
UnlockForRead(id);
}
« no previous file with comments | « cc/resources/resource_provider.h ('k') | components/display_compositor/compositor_overlay_candidate_validator_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698