1 /*
2 * Copyright 2023 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "include/core/SkColorSpace.h"
9 #include "include/core/SkImage.h"
10 #include "include/core/SkPicture.h"
11 #include "include/core/SkRefCnt.h"
12 #include "include/core/SkSurfaceProps.h"
13 #include "src/image/SkImage_Picture.h"
14
15 #include <utility>
16
17 class SkMatrix;
18 class SkPaint;
19 struct SkISize;
20
21 namespace SkImages {
22
DeferredFromPicture(sk_sp<SkPicture> picture,const SkISize & dimensions,const SkMatrix * matrix,const SkPaint * paint,BitDepth bitDepth,sk_sp<SkColorSpace> colorSpace)23 sk_sp<SkImage> DeferredFromPicture(sk_sp<SkPicture> picture,
24 const SkISize& dimensions,
25 const SkMatrix* matrix,
26 const SkPaint* paint,
27 BitDepth bitDepth,
28 sk_sp<SkColorSpace> colorSpace) {
29 return SkImage_Picture::Make(std::move(picture), dimensions, matrix, paint, bitDepth,
30 std::move(colorSpace), {});
31 }
32
DeferredFromPicture(sk_sp<SkPicture> picture,const SkISize & dimensions,const SkMatrix * matrix,const SkPaint * paint,BitDepth bitDepth,sk_sp<SkColorSpace> colorSpace,SkSurfaceProps props)33 sk_sp<SkImage> DeferredFromPicture(sk_sp<SkPicture> picture,
34 const SkISize& dimensions,
35 const SkMatrix* matrix,
36 const SkPaint* paint,
37 BitDepth bitDepth,
38 sk_sp<SkColorSpace> colorSpace,
39 SkSurfaceProps props) {
40 return SkImage_Picture::Make(std::move(picture), dimensions, matrix, paint, bitDepth,
41 std::move(colorSpace), props);
42 }
43
44 } // namespace SkImages
45