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

Side by Side Diff: cc/surfaces/direct_compositor_frame_sink.cc

Issue 2807653003: Move Work From CompositorFrameSinkSupport() To Init() (Closed)
Patch Set: Add CompositorFrameSinkSupport::Create Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/surfaces/direct_compositor_frame_sink.h" 5 #include "cc/surfaces/direct_compositor_frame_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/compositor_frame_sink_client.h" 9 #include "cc/output/compositor_frame_sink_client.h"
10 #include "cc/surfaces/display.h" 10 #include "cc/surfaces/display.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return false; 62 return false;
63 63
64 // We want the Display's output surface to hear about lost context, and since 64 // We want the Display's output surface to hear about lost context, and since
65 // this shares a context with it, we should not be listening for lost context 65 // this shares a context with it, we should not be listening for lost context
66 // callbacks on the context here. 66 // callbacks on the context here.
67 if (auto* cp = context_provider()) 67 if (auto* cp = context_provider())
68 cp->SetLostContextCallback(base::Closure()); 68 cp->SetLostContextCallback(base::Closure());
69 69
70 constexpr bool is_root = true; 70 constexpr bool is_root = true;
71 constexpr bool handles_frame_sink_id_invalidation = false; 71 constexpr bool handles_frame_sink_id_invalidation = false;
72 support_ = base::MakeUnique<CompositorFrameSinkSupport>( 72 support_ = CompositorFrameSinkSupport::Create(
73 this, surface_manager_, frame_sink_id_, is_root, 73 this, surface_manager_, frame_sink_id_, is_root,
74 handles_frame_sink_id_invalidation, 74 handles_frame_sink_id_invalidation,
75 capabilities_.delegated_sync_points_required); 75 capabilities_.delegated_sync_points_required);
76 begin_frame_source_ = base::MakeUnique<ExternalBeginFrameSource>(this); 76 begin_frame_source_ = base::MakeUnique<ExternalBeginFrameSource>(this);
77 client_->SetBeginFrameSource(begin_frame_source_.get()); 77 client_->SetBeginFrameSource(begin_frame_source_.get());
78 78
79 // Avoid initializing GL context here, as this should be sharing the 79 // Avoid initializing GL context here, as this should be sharing the
80 // Display's context. 80 // Display's context.
81 display_->Initialize(this, surface_manager_); 81 display_->Initialize(this, surface_manager_);
82 return true; 82 return true;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 support_->SetNeedsBeginFrame(needs_begin_frame); 154 support_->SetNeedsBeginFrame(needs_begin_frame);
155 } 155 }
156 156
157 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) { 157 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) {
158 // If there was damage, SubmitCompositorFrame includes the ack. 158 // If there was damage, SubmitCompositorFrame includes the ack.
159 if (!ack.has_damage) 159 if (!ack.has_damage)
160 support_->BeginFrameDidNotSwap(ack); 160 support_->BeginFrameDidNotSwap(ack);
161 } 161 }
162 162
163 } // namespace cc 163 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support_unittest.cc ('k') | cc/test/test_compositor_frame_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698