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

Unified Diff: content/browser/compositor/browser_compositor_output_surface.cc

Issue 2029323004: Get rid of virtual Display::CreateScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onscreendisplayclient
Patch Set: displaytest: ownership-all-the-things Created 4 years, 7 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: content/browser/compositor/browser_compositor_output_surface.cc
diff --git a/content/browser/compositor/browser_compositor_output_surface.cc b/content/browser/compositor/browser_compositor_output_surface.cc
index 66183edd4d410ba9af3b3ff621f29128581b135e..361bbb98c06265b3d9ba63cfc6cf86f68d4157e6 100644
--- a/content/browser/compositor/browser_compositor_output_surface.cc
+++ b/content/browser/compositor/browser_compositor_output_surface.cc
@@ -12,6 +12,7 @@
#include "base/strings/string_number_conversions.h"
#include "cc/base/switches.h"
#include "cc/output/output_surface_client.h"
+#include "cc/scheduler/begin_frame_source.h"
#include "components/display_compositor/compositor_overlay_candidate_validator.h"
#include "content/browser/compositor/reflector_impl.h"
#include "content/common/gpu/client/context_provider_command_buffer.h"
@@ -21,14 +22,12 @@ namespace content {
BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
scoped_refptr<cc::ContextProvider> context_provider,
scoped_refptr<ui::CompositorVSyncManager> vsync_manager,
- base::SingleThreadTaskRunner* task_runner,
+ cc::SyntheticBeginFrameSource* begin_frame_source,
std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
overlay_candidate_validator)
: OutputSurface(std::move(context_provider), nullptr, nullptr),
vsync_manager_(std::move(vsync_manager)),
- synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource(
- task_runner,
- cc::BeginFrameArgs::DefaultInterval())),
+ synthetic_begin_frame_source_(begin_frame_source),
reflector_(nullptr),
use_begin_frame_scheduling_(
base::CommandLine::ForCurrentProcess()->HasSwitch(
@@ -40,12 +39,10 @@ BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
std::unique_ptr<cc::SoftwareOutputDevice> software_device,
const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
- base::SingleThreadTaskRunner* task_runner)
+ cc::SyntheticBeginFrameSource* begin_frame_source)
: OutputSurface(nullptr, nullptr, std::move(software_device)),
vsync_manager_(vsync_manager),
- synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource(
- task_runner,
- cc::BeginFrameArgs::DefaultInterval())),
+ synthetic_begin_frame_source_(begin_frame_source),
reflector_(nullptr),
use_begin_frame_scheduling_(
base::CommandLine::ForCurrentProcess()->HasSwitch(
@@ -56,12 +53,10 @@ BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider,
const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
- base::SingleThreadTaskRunner* task_runner)
+ cc::SyntheticBeginFrameSource* begin_frame_source)
: OutputSurface(std::move(vulkan_context_provider)),
vsync_manager_(vsync_manager),
- synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource(
- task_runner,
- cc::BeginFrameArgs::DefaultInterval())),
+ synthetic_begin_frame_source_(begin_frame_source),
reflector_(nullptr) {
Initialize();
}
@@ -88,9 +83,6 @@ bool BrowserCompositorOutputSurface::BindToClient(
if (!OutputSurface::BindToClient(client))
return false;
- // Pass begin frame source up to Display to use for DisplayScheduler.
- client->SetBeginFrameSource(synthetic_begin_frame_source_.get());
-
// Don't want vsync notifications until there is a client.
if (!use_begin_frame_scheduling_)
vsync_manager_->AddObserver(this);

Powered by Google App Engine
This is Rietveld 408576698