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

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

Issue 2807653003: Move Work From CompositorFrameSinkSupport() To Init() (Closed)
Patch Set: More Init 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_ = base::MakeUnique<CompositorFrameSinkSupport>(
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 support_->Init();
76 begin_frame_source_ = base::MakeUnique<ExternalBeginFrameSource>(this); 77 begin_frame_source_ = base::MakeUnique<ExternalBeginFrameSource>(this);
77 client_->SetBeginFrameSource(begin_frame_source_.get()); 78 client_->SetBeginFrameSource(begin_frame_source_.get());
78 79
79 // Avoid initializing GL context here, as this should be sharing the 80 // Avoid initializing GL context here, as this should be sharing the
80 // Display's context. 81 // Display's context.
81 display_->Initialize(this, surface_manager_); 82 display_->Initialize(this, surface_manager_);
82 return true; 83 return true;
83 } 84 }
84 85
85 void DirectCompositorFrameSink::DetachFromClient() { 86 void DirectCompositorFrameSink::DetachFromClient() {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 support_->SetNeedsBeginFrame(needs_begin_frame); 155 support_->SetNeedsBeginFrame(needs_begin_frame);
155 } 156 }
156 157
157 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) { 158 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) {
158 // If there was damage, SubmitCompositorFrame includes the ack. 159 // If there was damage, SubmitCompositorFrame includes the ack.
159 if (!ack.has_damage) 160 if (!ack.has_damage)
160 support_->BeginFrameDidNotSwap(ack); 161 support_->BeginFrameDidNotSwap(ack);
161 } 162 }
162 163
163 } // namespace cc 164 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698