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

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

Issue 2143263002: cc: Remove OutputSurfaceClient::DidSwapBuffers(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removedidswap: fix-webview-swap 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 unified diff | Download patch
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/surface_display_output_surface.h" 5 #include "cc/surfaces/surface_display_output_surface.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_ack.h" 9 #include "cc/output/compositor_frame_ack.h"
10 #include "cc/surfaces/display.h" 10 #include "cc/surfaces/display.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (!delegated_surface_id_.is_null()) { 67 if (!delegated_surface_id_.is_null()) {
68 factory_.Destroy(delegated_surface_id_); 68 factory_.Destroy(delegated_surface_id_);
69 } 69 }
70 delegated_surface_id_ = surface_id_allocator_->GenerateId(); 70 delegated_surface_id_ = surface_id_allocator_->GenerateId();
71 factory_.Create(delegated_surface_id_); 71 factory_.Create(delegated_surface_id_);
72 last_swap_frame_size_ = frame_size; 72 last_swap_frame_size_ = frame_size;
73 } 73 }
74 display_->SetSurfaceId(delegated_surface_id_, 74 display_->SetSurfaceId(delegated_surface_id_,
75 frame.metadata.device_scale_factor); 75 frame.metadata.device_scale_factor);
76 76
77 client_->DidSwapBuffers();
78
79 factory_.SubmitCompositorFrame( 77 factory_.SubmitCompositorFrame(
80 delegated_surface_id_, std::move(frame), 78 delegated_surface_id_, std::move(frame),
81 base::Bind(&SurfaceDisplayOutputSurface::SwapBuffersComplete, 79 base::Bind(&SurfaceDisplayOutputSurface::SwapBuffersComplete,
82 base::Unretained(this))); 80 base::Unretained(this)));
83 } 81 }
84 82
85 bool SurfaceDisplayOutputSurface::BindToClient(OutputSurfaceClient* client) { 83 bool SurfaceDisplayOutputSurface::BindToClient(OutputSurfaceClient* client) {
86 DCHECK(thread_checker_.CalledOnValidThread()); 84 DCHECK(thread_checker_.CalledOnValidThread());
87 85
88 surface_manager_->RegisterSurfaceFactoryClient( 86 surface_manager_->RegisterSurfaceFactoryClient(
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 SetMemoryPolicy(policy); 155 SetMemoryPolicy(policy);
158 } 156 }
159 157
160 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) { 158 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) {
161 // TODO(danakj): Why the lost check? 159 // TODO(danakj): Why the lost check?
162 if (!output_surface_lost_) 160 if (!output_surface_lost_)
163 client_->DidSwapBuffersComplete(); 161 client_->DidSwapBuffersComplete();
164 } 162 }
165 163
166 } // namespace cc 164 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698