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