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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2140783002: services/ui: Detect when a video is playing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot merge Created 4 years, 5 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 | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index e3dcf264a5148a864be5242df23980753fecc9c4..b32ed4e00bcbb3aa36ed3c7f8611da47db624879 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -165,7 +165,9 @@ DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer,
"Scheduling.%s.PendingTreeDuration");
LayerTreeHostImpl::FrameData::FrameData()
- : render_surface_layer_list(nullptr), has_no_damage(false) {}
+ : render_surface_layer_list(nullptr),
+ has_no_damage(false),
+ may_contain_video(false) {}
LayerTreeHostImpl::FrameData::~FrameData() {}
@@ -912,6 +914,8 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
DCHECK_EQ(active_tree_.get(), it->layer_tree_impl());
frame->will_draw_layers.push_back(*it);
+ if (it->may_contain_video())
+ frame->may_contain_video = true;
it->AppendQuads(target_render_pass, &append_quads_data);
}
@@ -1100,6 +1104,7 @@ DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) {
frame->render_passes.clear();
frame->will_draw_layers.clear();
frame->has_no_damage = false;
+ frame->may_contain_video = false;
if (active_tree_->RootRenderSurface()) {
gfx::Rect device_viewport_damage_rect = viewport_damage_rect_;
@@ -1815,6 +1820,7 @@ bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
return false;
}
CompositorFrameMetadata metadata = MakeCompositorFrameMetadata();
+ metadata.may_contain_video = frame.may_contain_video;
active_tree()->FinishSwapPromises(&metadata);
for (auto& latency : metadata.latency_info) {
TRACE_EVENT_WITH_FLOW1("input,benchmark",
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698