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

Unified Diff: cc/surfaces/display.h

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase; refactor mus output surface Created 4 years, 9 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/display.h
diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h
index 4646179d0a4d0cd010f32b66f5fd7d06237415ed..57f5cc7ca671850e9bb0a319d59bc2a6716ec1f0 100644
--- a/cc/surfaces/display.h
+++ b/cc/surfaces/display.h
@@ -55,11 +55,12 @@ class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
SurfaceManager* manager,
SharedBitmapManager* bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- const RendererSettings& settings);
+ const RendererSettings& settings,
+ uint32_t compositor_surface_namespace);
~Display() override;
bool Initialize(scoped_ptr<OutputSurface> output_surface,
- DisplayScheduler* scheduler);
+ base::SingleThreadTaskRunner* task_runner);
// device_scale_factor is used to communicate to the external window system
// what scale this was rendered at.
@@ -71,10 +72,12 @@ class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
// DisplaySchedulerClient implementation.
bool DrawAndSwap() override;
+ void UpdateSchedulerBeginFrameSource(BeginFrameSource* source) override;
// OutputSurfaceClient implementation.
void CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) override;
+ base::TimeDelta interval) override {}
+ void SetBeginFrameSource(BeginFrameSource* source) override;
void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override;
void DidSwapBuffers() override;
void DidSwapBuffersComplete() override;
@@ -96,28 +99,39 @@ class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
// SurfaceDamageObserver implementation.
void OnSurfaceDamaged(SurfaceId surface, bool* changed) override;
- private:
+ protected:
+ // Virtual for tests.
+ virtual void CreateScheduler(base::SingleThreadTaskRunner* task_runner);
+
void InitializeRenderer();
void UpdateRootSurfaceResourcesLocked();
DisplayClient* client_;
- SurfaceManager* manager_;
+ SurfaceManager* surface_manager_;
SharedBitmapManager* bitmap_manager_;
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;
RendererSettings settings_;
SurfaceId current_surface_id_;
+ uint32_t compositor_surface_namespace_;
gfx::Size current_surface_size_;
float device_scale_factor_;
bool swapped_since_resize_;
gfx::Rect external_clip_;
scoped_ptr<OutputSurface> output_surface_;
- DisplayScheduler* scheduler_;
+ scoped_ptr<DisplayScheduler> scheduler_;
+ // A synthetic BFS for when vsync is disabled. May be null when not used.
+ scoped_ptr<BeginFrameSource> unthrottled_begin_frame_source_;
+ // The real BFS tied to vsync provided by the BrowserCompositorOutputSurface.
+ BeginFrameSource* vsync_begin_frame_source_;
+ // The BFS that the scheduler wants to use for this display.
+ BeginFrameSource* scheduler_begin_frame_source_;
sunnyps 2016/04/01 22:35:25 Not sure why the scheduler will ever tell a Displa
enne (OOO) 2016/04/02 00:18:38 Ok, then I think I misunderstood how you wanted to
sunnyps 2016/04/02 00:47:15 Can you also update the CL description to reflect
enne (OOO) 2016/04/04 18:12:33 Done, thanks for noticing that. :)
scoped_ptr<ResourceProvider> resource_provider_;
scoped_ptr<SurfaceAggregator> aggregator_;
scoped_ptr<DirectRenderer> renderer_;
scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_;
std::vector<ui::LatencyInfo> stored_latency_info_;
+ private:
DISALLOW_COPY_AND_ASSIGN(Display);
};

Powered by Google App Engine
This is Rietveld 408576698