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

Unified Diff: cc/surfaces/direct_compositor_frame_sink.cc

Issue 2485473003: Remove SurfaceFactory::Create and SurfaceFactory::Destroy (Closed)
Patch Set: up Created 4 years, 1 month 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/direct_compositor_frame_sink.cc
diff --git a/cc/surfaces/direct_compositor_frame_sink.cc b/cc/surfaces/direct_compositor_frame_sink.cc
index 5dfd7e0e356fc7cf216f4a4d109fa51551dd429d..3b047d1454a427788cacf81aacccbdbfbf6b9b5c 100644
--- a/cc/surfaces/direct_compositor_frame_sink.cc
+++ b/cc/surfaces/direct_compositor_frame_sink.cc
@@ -82,8 +82,6 @@ void DirectCompositorFrameSink::DetachFromClient() {
// Unregister the SurfaceFactoryClient here instead of the dtor so that only
// one client is alive for this namespace at any given time.
surface_manager_->UnregisterSurfaceFactoryClient(frame_sink_id_);
- if (delegated_local_frame_id_.is_valid())
- factory_.Destroy(delegated_local_frame_id_);
CompositorFrameSink::DetachFromClient();
}
@@ -91,11 +89,7 @@ void DirectCompositorFrameSink::DetachFromClient() {
void DirectCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) {
- if (delegated_local_frame_id_.is_valid()) {
- factory_.Destroy(delegated_local_frame_id_);
- }
delegated_local_frame_id_ = surface_id_allocator_.GenerateId();
- factory_.Create(delegated_local_frame_id_);
last_swap_frame_size_ = frame_size;
}
display_->SetSurfaceId(SurfaceId(frame_sink_id_, delegated_local_frame_id_),
@@ -144,7 +138,8 @@ void DirectCompositorFrameSink::DisplayDidDrawAndSwap() {
}
void DirectCompositorFrameSink::DidDrawCallback() {
- client_->DidReceiveCompositorFrameAck();
+ if (client_)
Fady Samuel 2016/11/10 23:33:36 nit: is this check necessary?
danakj 2016/11/10 23:57:58 Should we remove ourselves somehow in DetachFromCl
Saman Sami 2016/11/11 17:49:58 Done.
+ client_->DidReceiveCompositorFrameAck();
}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698