bitmap_request.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2020 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 COMPONENTS_PAINT_PREVIEW_PLAYER_BITMAP_REQUEST_H_
  5. #define COMPONENTS_PAINT_PREVIEW_PLAYER_BITMAP_REQUEST_H_
  6. #include "base/callback.h"
  7. #include "base/unguessable_token.h"
  8. #include "components/services/paint_preview_compositor/public/mojom/paint_preview_compositor.mojom.h"
  9. #include "third_party/abseil-cpp/absl/types/optional.h"
  10. #include "third_party/skia/include/core/SkBitmap.h"
  11. #include "ui/gfx/geometry/rect.h"
  12. namespace paint_preview {
  13. struct BitmapRequest {
  14. using BitmapRequestCallback =
  15. base::OnceCallback<void(mojom::PaintPreviewCompositor::BitmapStatus,
  16. const SkBitmap&)>;
  17. BitmapRequest(const absl::optional<base::UnguessableToken>& frame_guid,
  18. const gfx::Rect& clip_rect,
  19. float scale_factor,
  20. BitmapRequestCallback callback,
  21. bool run_callback_on_default_task_runner);
  22. ~BitmapRequest();
  23. BitmapRequest& operator=(BitmapRequest&& other) noexcept;
  24. BitmapRequest(BitmapRequest&& other) noexcept;
  25. absl::optional<base::UnguessableToken> frame_guid;
  26. gfx::Rect clip_rect;
  27. float scale_factor;
  28. BitmapRequestCallback callback;
  29. bool run_callback_on_default_task_runner;
  30. };
  31. } // namespace paint_preview
  32. #endif // COMPONENTS_PAINT_PREVIEW_PLAYER_BITMAP_REQUEST_H_