dc_renderer_layer_params.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright 2017 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. #ifndef UI_GL_DC_RENDERER_LAYER_PARAMS_H_
  5. #define UI_GL_DC_RENDERER_LAYER_PARAMS_H_
  6. #include <array>
  7. #include "base/callback.h"
  8. #include "base/memory/ref_counted.h"
  9. #include "third_party/abseil-cpp/absl/types/optional.h"
  10. #include "third_party/skia/include/core/SkColor.h"
  11. #include "ui/gfx/geometry/point.h"
  12. #include "ui/gfx/geometry/rect.h"
  13. #include "ui/gfx/geometry/rect_f.h"
  14. #include "ui/gfx/geometry/transform.h"
  15. #include "ui/gfx/hdr_metadata.h"
  16. #include "ui/gfx/video_types.h"
  17. #include "ui/gl/gl_export.h"
  18. namespace gl {
  19. class GLImage;
  20. }
  21. namespace ui {
  22. struct GL_EXPORT DCRendererLayerParams {
  23. DCRendererLayerParams();
  24. ~DCRendererLayerParams();
  25. // Images to display in overlay. There can either be two software video
  26. // buffers for Y and UV planes, an NV12 hardware video image, or a swap chain
  27. // image. If a single image is specified, the second one must be nullptr.
  28. enum : size_t { kNumImages = 2 };
  29. using OverlayImages = std::array<scoped_refptr<gl::GLImage>, kNumImages>;
  30. OverlayImages images;
  31. // Stacking order relative to backbuffer which has z-order 0.
  32. int z_order = 1;
  33. // What part of the content to display in pixels.
  34. gfx::Rect content_rect;
  35. // Bounds of the overlay in pre-transform space.
  36. gfx::Rect quad_rect;
  37. // 2D flattened transform that maps |quad_rect| to root target space,
  38. // after applying the |quad_rect.origin()| as an offset.
  39. gfx::Transform transform;
  40. // If present, then clip to |clip_rect| in root target space.
  41. absl::optional<gfx::Rect> clip_rect;
  42. gfx::ProtectedVideoType protected_video_type =
  43. gfx::ProtectedVideoType::kClear;
  44. gfx::HDRMetadata hdr_metadata;
  45. bool is_video_fullscreen_mode;
  46. };
  47. } // namespace ui
  48. #endif // UI_GL_DC_RENDERER_LAYER_PARAMS_H_