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

Unified Diff: cc/surfaces/display.h

Issue 2029323004: Get rid of virtual Display::CreateScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onscreendisplayclient
Patch Set: displaytest: androids 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: cc/surfaces/display.h
diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h
index 204cfb4ccd36ee73c6d43b96eb2b4439374dacd4..3a65bc1303a9c7141db44f5f7845373afb2ef3d5 100644
--- a/cc/surfaces/display.h
+++ b/cc/surfaces/display.h
@@ -52,21 +52,33 @@ class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
public RendererClient,
public SurfaceDamageObserver {
public:
+ // When |begin_frame_source| is null, no scheduler is created, and the
+ // owner of this class is responsible for calling DrawAndSwap when needed.
Display(SurfaceManager* manager,
SharedBitmapManager* bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
const RendererSettings& settings,
uint32_t compositor_surface_namespace,
base::SingleThreadTaskRunner* task_runner,
+ BeginFrameSource* begin_frame_source,
std::unique_ptr<OutputSurface> output_surface);
+
+ // For tests. A delegating constructor that overrides the scheduler
+ // used in the Display. For tests.
+ Display(SurfaceManager* manager,
+ SharedBitmapManager* bitmap_manager,
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ const RendererSettings& settings,
+ uint32_t compositor_surface_namespace,
+ base::SingleThreadTaskRunner* task_runner,
+ BeginFrameSource* begin_frame_source,
+ std::unique_ptr<OutputSurface> output_surface,
+ std::unique_ptr<DisplayScheduler> display_scheduler_for_tests);
+
~Display() override;
bool Initialize(DisplayClient* client);
- // When this variant is used, no DisplayScheduler is created, and the caller
- // is responsible for calling DrawAndSwap when required.
- bool InitializeSynchronous(DisplayClient* client);
-
// device_scale_factor is used to communicate to the external window system
// what scale this was rendered at.
void SetSurfaceId(SurfaceId id, float device_scale_factor);
@@ -81,7 +93,7 @@ class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
// 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;
@@ -110,9 +122,9 @@ class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
}
protected:
- // Virtual for tests.
- virtual void CreateScheduler();
+ DisplayScheduler* SchedulerForTesting() { return scheduler_.get(); }
+ private:
void InitializeRenderer();
void UpdateRootSurfaceResourcesLocked();
@@ -130,9 +142,6 @@ class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
gfx::Size enlarge_texture_amount_;
bool output_is_secure_ = false;
- // TODO(danakj): Not needed if we create the scheduler from the constructor.
- base::SingleThreadTaskRunner* task_runner_;
-
std::unique_ptr<OutputSurface> output_surface_;
// An internal synthetic BFS. May be null when not used.
std::unique_ptr<BeginFrameSource> internal_begin_frame_source_;

Powered by Google App Engine
This is Rietveld 408576698