diff options
Diffstat (limited to 'chromium/components/viz/service/display/display.h')
-rw-r--r-- | chromium/components/viz/service/display/display.h | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/chromium/components/viz/service/display/display.h b/chromium/components/viz/service/display/display.h index 7759c67aa47..51312be163e 100644 --- a/chromium/components/viz/service/display/display.h +++ b/chromium/components/viz/service/display/display.h @@ -8,16 +8,19 @@ #include <memory> #include <vector> +#include "base/containers/circular_deque.h" #include "base/macros.h" #include "base/observer_list.h" -#include "cc/resources/display_resource_provider.h" +#include "base/single_thread_task_runner.h" #include "components/viz/common/frame_sinks/begin_frame_source.h" #include "components/viz/common/gpu/context_lost_observer.h" #include "components/viz/common/resources/returned_resource.h" #include "components/viz/common/surfaces/frame_sink_id.h" #include "components/viz/common/surfaces/surface_id.h" +#include "components/viz/service/display/display_resource_provider.h" #include "components/viz/service/display/display_scheduler.h" #include "components/viz/service/display/output_surface_client.h" +#include "components/viz/service/display/software_output_device_client.h" #include "components/viz/service/display/surface_aggregator.h" #include "components/viz/service/surfaces/latest_local_surface_id_lookup_delegate.h" #include "components/viz/service/surfaces/surface_manager.h" @@ -26,11 +29,6 @@ #include "ui/gfx/color_space.h" #include "ui/latency/latency_info.h" -namespace cc { -class DisplayResourceProvider; -class RendererSettings; -} // namespace cc - namespace gfx { class Size; } @@ -38,8 +36,11 @@ class Size; namespace viz { class DirectRenderer; class DisplayClient; +class DisplayResourceProvider; class OutputSurface; +class RendererSettings; class SharedBitmapManager; +class SkiaOutputSurface; class SoftwareRenderer; class VIZ_SERVICE_EXPORT DisplayObserver { @@ -55,18 +56,22 @@ class VIZ_SERVICE_EXPORT DisplayObserver { class VIZ_SERVICE_EXPORT Display : public DisplaySchedulerClient, public OutputSurfaceClient, public ContextLostObserver, - public LatestLocalSurfaceIdLookupDelegate { + public LatestLocalSurfaceIdLookupDelegate, + public SoftwareOutputDeviceClient { public: // The |begin_frame_source| and |scheduler| may be null (together). In that // case, DrawAndSwap must be called externally when needed. // The |current_task_runner| may be null if the Display is on a thread without // a MessageLoop. + // TODO(penghuang): Remove skia_output_surface when all DirectRenderer + // subclasses are replaced by SkiaRenderer. Display(SharedBitmapManager* bitmap_manager, const RendererSettings& settings, const FrameSinkId& frame_sink_id, std::unique_ptr<OutputSurface> output_surface, std::unique_ptr<DisplayScheduler> scheduler, - scoped_refptr<base::SingleThreadTaskRunner> current_task_runner); + scoped_refptr<base::SingleThreadTaskRunner> current_task_runner, + SkiaOutputSurface* skia_output_surface = nullptr); ~Display() override; @@ -101,19 +106,24 @@ class VIZ_SERVICE_EXPORT Display : public DisplaySchedulerClient, // OutputSurfaceClient implementation. void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; - void DidReceiveSwapBuffersAck(uint64_t swap_id) override; + void DidReceiveSwapBuffersAck() override; void DidReceiveTextureInUseResponses( const gpu::TextureInUseResponses& responses) override; void DidReceiveCALayerParams( const gfx::CALayerParams& ca_layer_params) override; void DidReceivePresentationFeedback( - uint64_t swap_id, const gfx::PresentationFeedback& feedback) override; + void DidFinishLatencyInfo( + const std::vector<ui::LatencyInfo>& latency_info) override; // LatestLocalSurfaceIdLookupDelegate implementation. LocalSurfaceId GetSurfaceAtAggregation( const FrameSinkId& frame_sink_id) const override; + // SoftwareOutputDeviceClient implementation + void SoftwareDeviceUpdatedCALayerParams( + const gfx::CALayerParams& ca_layer_params) override; + bool has_scheduler() const { return !!scheduler_; } DirectRenderer* renderer_for_testing() const { return renderer_.get(); } @@ -144,9 +154,10 @@ class VIZ_SERVICE_EXPORT Display : public DisplaySchedulerClient, bool swapped_since_resize_ = false; bool output_is_secure_ = false; + SkiaOutputSurface* skia_output_surface_; std::unique_ptr<OutputSurface> output_surface_; std::unique_ptr<DisplayScheduler> scheduler_; - std::unique_ptr<cc::DisplayResourceProvider> resource_provider_; + std::unique_ptr<DisplayResourceProvider> resource_provider_; std::unique_ptr<SurfaceAggregator> aggregator_; // This may be null if the Display is on a thread without a MessageLoop. scoped_refptr<base::SingleThreadTaskRunner> current_task_runner_; @@ -154,12 +165,8 @@ class VIZ_SERVICE_EXPORT Display : public DisplaySchedulerClient, SoftwareRenderer* software_renderer_ = nullptr; std::vector<ui::LatencyInfo> stored_latency_info_; - using PresentedCallbacks = std::vector<Surface::PresentedCallback>; - PresentedCallbacks presented_callbacks_; - PresentedCallbacks active_presented_callbacks_; - // TODO(penghuang): Remove it when we can get accurate presentation time from - // GPU for every SwapBuffers. https://crbug.com/776877 - std::vector<PresentedCallbacks> previous_presented_callbacks_; + base::circular_deque<std::vector<Surface::PresentedCallback>> + pending_presented_callbacks_; private: DISALLOW_COPY_AND_ASSIGN(Display); |