1 // Copyright 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_OVERLAY_PROCESSOR_SURFACE_CONTROL_H_
6 #define COMPONENTS_VIZ_SERVICE_DISPLAY_OVERLAY_PROCESSOR_SURFACE_CONTROL_H_
7 
8 #include "components/viz/service/display/overlay_processor_using_strategy.h"
9 
10 namespace viz {
11 
12 // This is an overlay processor implementation for Android SurfaceControl.
13 class VIZ_SERVICE_EXPORT OverlayProcessorSurfaceControl
14     : public OverlayProcessorUsingStrategy {
15  public:
16   OverlayProcessorSurfaceControl();
17   ~OverlayProcessorSurfaceControl() override;
18 
19   bool IsOverlaySupported() const override;
20 
21   bool NeedsSurfaceDamageRectList() const override;
22 
23   // Override OverlayProcessorUsingStrategy.
24   void SetDisplayTransformHint(gfx::OverlayTransform transform) override;
25   void SetViewportSize(const gfx::Size& size) override;
26   void AdjustOutputSurfaceOverlay(
27       base::Optional<OutputSurfaceOverlayPlane>* output_surface_plane) override;
28   void CheckOverlaySupport(
29       const OverlayProcessorInterface::OutputSurfaceOverlayPlane* primary_plane,
30       OverlayCandidateList* candidates) override;
31   gfx::Rect GetOverlayDamageRectForOutputSurface(
32       const OverlayCandidate& overlay) const override;
33 
34  private:
35   gfx::OverlayTransform display_transform_ = gfx::OVERLAY_TRANSFORM_NONE;
36   gfx::Size viewport_size_;
37 };
38 }  // namespace viz
39 
40 #endif  // COMPONENTS_VIZ_SERVICE_DISPLAY_OVERLAY_PROCESSOR_SURFACE_CONTROL_H_
41