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

Unified Diff: cc/surfaces/surface_factory.cc

Issue 2403573002: cc: Introduce mechanism to observe CompositorFrames submitted to new surfaceIDs (Closed)
Patch Set: Created 4 years, 2 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/surfaces/surface_factory.cc
diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
index ed66e1bd31989d7f62fd30eb108304503930c0fb..603cf82074645ddf6ff500d5e2876c616220c7fb 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -76,6 +76,18 @@ void SurfaceFactory::SubmitCompositorFrame(const LocalFrameId& local_frame_id,
OwningSurfaceMap::iterator it = surface_map_.find(local_frame_id);
DCHECK(it != surface_map_.end());
DCHECK(it->second->factory().get() == this);
+ const CompositorFrame& previous_frame = it->second->GetEligibleFrame();
vmpstr 2016/10/11 21:59:04 Can you add a comment explaining this logic, pleas
Fady Samuel 2016/10/11 23:11:45 Done.
+ if (!previous_frame.delegated_frame_data) {
+ float device_scale_factor = frame.metadata.device_scale_factor;
+ gfx::Size frame_size;
+ if (frame.delegated_frame_data &&
+ frame.delegated_frame_data->render_pass_list.size() > 0) {
vmpstr 2016/10/11 21:59:04 nit: !frame.delegated_frame_data->render_pass_list
Fady Samuel 2016/10/11 23:11:45 Done.
+ frame_size =
+ frame.delegated_frame_data->render_pass_list[0]->output_rect.size();
+ }
+ manager_->SurfaceCreated(it->second->surface_id(), frame_size,
+ device_scale_factor);
+ }
it->second->QueueFrame(std::move(frame), callback);
if (!manager_->SurfaceModified(SurfaceId(frame_sink_id_, local_frame_id))) {
TRACE_EVENT_INSTANT0("cc", "Damage not visible.", TRACE_EVENT_SCOPE_THREAD);

Powered by Google App Engine
This is Rietveld 408576698