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

Unified Diff: services/ui/public/cpp/output_surface.cc

Issue 2260943002: Move default begin frame sources out to mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: services/ui/public/cpp/output_surface.cc
diff --git a/services/ui/public/cpp/output_surface.cc b/services/ui/public/cpp/output_surface.cc
index ed236960c10d6f4935320075bfb974501dc2f208..50a1372f437d5c6800df8664c2544f4f0bb69e99 100644
--- a/services/ui/public/cpp/output_surface.cc
+++ b/services/ui/public/cpp/output_surface.cc
@@ -8,6 +8,7 @@
#include "cc/output/compositor_frame.h"
#include "cc/output/output_surface_client.h"
#include "services/ui/public/cpp/context_provider.h"
+#include "services/ui/public/cpp/gpu_service.h"
#include "services/ui/public/cpp/window_surface.h"
namespace ui {
@@ -19,6 +20,11 @@ OutputSurface::OutputSurface(GpuService* gpu_service,
nullptr),
surface_(std::move(surface)) {
capabilities_.delegated_rendering = true;
+
+ // TODO(enne): Get this from the WindowSurface via ServerWindowSurface.
+ begin_frame_source_.reset(new cc::DelayBasedBeginFrameSource(
+ base::MakeUnique<cc::DelayBasedTimeSource>(
+ gpu_service->main_task_runner().get())));
Fady Samuel 2016/08/22 15:16:52 We shouldn't be giving it the main task runner rig
}
OutputSurface::~OutputSurface() {}
@@ -26,10 +32,12 @@ OutputSurface::~OutputSurface() {}
bool OutputSurface::BindToClient(cc::OutputSurfaceClient* client) {
surface_->BindToThread();
surface_->set_client(this);
+ client->SetBeginFrameSource(begin_frame_source_.get());
sadrul 2016/08/22 14:46:40 Should |begin_frame_source_| be created here? (con
Fady Samuel 2016/08/22 15:16:52 +1
return cc::OutputSurface::BindToClient(client);
}
void OutputSurface::DetachFromClient() {
+ client_->SetBeginFrameSource(nullptr);
surface_.reset();
cc::OutputSurface::DetachFromClient();
}

Powered by Google App Engine
This is Rietveld 408576698