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

Unified Diff: components/mus/surfaces/top_level_display_client.cc

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Display member destruction order Created 4 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: components/mus/surfaces/top_level_display_client.cc
diff --git a/components/mus/surfaces/top_level_display_client.cc b/components/mus/surfaces/top_level_display_client.cc
index 537e08904d9b1106f77b0db5740e4e8d0f995fab..b70f8b34b4df1160c9a98c2a71410277773d95c6 100644
--- a/components/mus/surfaces/top_level_display_client.cc
+++ b/components/mus/surfaces/top_level_display_client.cc
@@ -42,12 +42,14 @@ TopLevelDisplayClient::TopLevelDisplayClient(
factory_(surfaces_state->manager(), this),
cc_id_(static_cast<uint64_t>(surfaces_state->next_id_namespace()) << 32) {
factory_.Create(cc_id_);
+ surfaces_state_->manager()->RegisterSurfaceIdNamespace(cc_id_.id_namespace());
display_.reset(new cc::Display(this, surfaces_state_->manager(), nullptr,
- nullptr, cc::RendererSettings()));
+ nullptr, cc::RendererSettings(),
+ cc_id_.id_namespace()));
scoped_refptr<SurfacesContextProvider> surfaces_context_provider(
- new SurfacesContextProvider(this, widget, gpu_state));
+ new SurfacesContextProvider(widget, gpu_state));
// TODO(rjkroege): If there is something better to do than CHECK, add it.
CHECK(surfaces_context_provider->BindToCurrentThread());
@@ -55,27 +57,21 @@ TopLevelDisplayClient::TopLevelDisplayClient(
if (surfaces_context_provider->ContextCapabilities().gpu.surfaceless) {
#if defined(USE_OZONE)
output_surface = base::WrapUnique(new DirectOutputSurfaceOzone(
- surfaces_context_provider, widget, GL_TEXTURE_2D, GL_RGB));
+ surfaces_context_provider, widget, task_runner_.get(), GL_TEXTURE_2D,
+ GL_RGB));
#else
NOTREACHED();
#endif
} else {
- output_surface =
- base::WrapUnique(new DirectOutputSurface(surfaces_context_provider));
+ output_surface = base::WrapUnique(
+ new DirectOutputSurface(surfaces_context_provider, task_runner_.get()));
}
int max_frames_pending = output_surface->capabilities().max_frames_pending;
DCHECK_GT(max_frames_pending, 0);
- synthetic_frame_source_.reset(new cc::SyntheticBeginFrameSource(
- task_runner_.get(), cc::BeginFrameArgs::DefaultInterval()));
-
- scheduler_.reset(
- new cc::DisplayScheduler(display_.get(), synthetic_frame_source_.get(),
- task_runner_.get(), max_frames_pending));
-
if (gpu_state->HardwareRenderingAvailable()) {
- display_->Initialize(std::move(output_surface), scheduler_.get());
+ display_->Initialize(std::move(output_surface), task_runner_.get());
} else {
// TODO(rjkroege): Implement software compositing.
}
@@ -86,6 +82,8 @@ TopLevelDisplayClient::TopLevelDisplayClient(
}
TopLevelDisplayClient::~TopLevelDisplayClient() {
+ surfaces_state_->manager()->InvalidateSurfaceIdNamespace(
+ cc_id_.id_namespace());
factory_.Destroy(cc_id_);
}
@@ -107,9 +105,6 @@ void TopLevelDisplayClient::RequestCopyOfOutput(
factory_.RequestCopyOfSurface(cc_id_, std::move(output_request));
}
-void TopLevelDisplayClient::CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) {}
-
void TopLevelDisplayClient::OutputSurfaceLost() {
if (!display_) // Shutdown case
return;
@@ -119,20 +114,6 @@ void TopLevelDisplayClient::OutputSurfaceLost() {
void TopLevelDisplayClient::SetMemoryPolicy(
const cc::ManagedMemoryPolicy& policy) {}
-void TopLevelDisplayClient::OnVSyncParametersUpdated(int64_t timebase,
- int64_t interval) {
- auto timebase_time_ticks = base::TimeTicks::FromInternalValue(timebase);
- auto interval_time_delta = base::TimeDelta::FromInternalValue(interval);
-
- if (interval_time_delta.is_zero()) {
- // TODO(brianderson): We should not be receiving 0 intervals.
- interval_time_delta = cc::BeginFrameArgs::DefaultInterval();
- }
-
- synthetic_frame_source_->OnUpdateVSyncParameters(timebase_time_ticks,
- interval_time_delta);
-}
-
void TopLevelDisplayClient::ReturnResources(
const cc::ReturnedResourceArray& resources) {
// TODO(fsamuel): Implement this.
« no previous file with comments | « components/mus/surfaces/top_level_display_client.h ('k') | content/browser/compositor/browser_compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698