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

Unified Diff: cc/surfaces/surface_factory.cc

Issue 2834553002: Replace CompositorFrameSinkSupport::WillDrawSurface With RepeatingCallback (Closed)
Patch Set: Fix render_widget_host_view_aura_unittest 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 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 45eb882119bf9380a13729493a72217345c41991..1a38e516d5055af7e068e805b230b19cff4b9216 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -44,7 +44,8 @@ void SurfaceFactory::EvictSurface() {
void SurfaceFactory::SubmitCompositorFrame(
const LocalSurfaceId& local_surface_id,
CompositorFrame frame,
- const DrawCallback& callback) {
+ const DrawCallback& callback,
+ const WillDrawCallback& will_draw_callback) {
TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame");
DCHECK(local_surface_id.is_valid());
@@ -64,7 +65,7 @@ void SurfaceFactory::SubmitCompositorFrame(
} else {
surface = Create(local_surface_id);
}
- surface->QueueFrame(std::move(frame), callback);
+ surface->QueueFrame(std::move(frame), callback, will_draw_callback);
if (current_surface_ && create_new_surface) {
surface->SetPreviousFrameSurface(current_surface_.get());
@@ -91,11 +92,6 @@ void SurfaceFactory::ClearSurface() {
manager_->SurfaceModified(current_surface_->surface_id());
}
-void SurfaceFactory::WillDrawSurface(const LocalSurfaceId& id,
- const gfx::Rect& damage_rect) {
- client_->WillDrawSurface(id, damage_rect);
-}
-
void SurfaceFactory::ReceiveFromChild(
const TransferableResourceArray& resources) {
holder_.ReceiveFromChild(resources);
@@ -131,7 +127,7 @@ void SurfaceFactory::OnSurfaceActivated(Surface* surface) {
surface->active_referenced_surfaces());
if (!manager_->SurfaceModified(surface->surface_id())) {
TRACE_EVENT_INSTANT0("cc", "Damage not visible.", TRACE_EVENT_SCOPE_THREAD);
- surface->RunDrawCallbacks();
+ surface->RunDrawCallback();
}
}

Powered by Google App Engine
This is Rietveld 408576698