Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
dl_image_skia.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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 FLUTTER_DISPLAY_LIST_IMAGE_DL_IMAGE_SKIA_H_
6#define FLUTTER_DISPLAY_LIST_IMAGE_DL_IMAGE_SKIA_H_
7
10
11namespace flutter {
12
13class DlImageSkia : public DlImage {
14 public:
15 static sk_sp<DlImage> Make(const SkImage* image);
16 static sk_sp<DlImage> Make(sk_sp<SkImage> image);
17
18 explicit DlImageSkia(sk_sp<SkImage> image);
19
20 // |DlImage|
21 ~DlImageSkia() override;
22
23 // |DlImage|
24 Type GetImageType() const override { return Type::kSkia; }
25 // |DlImage|
26 const DlImageSkia* asSkiaImage() const override { return this; }
27
28 virtual sk_sp<SkImage> skia_image() const;
29
30 // |DlImage|
31 bool isTextureBacked() const override;
32
33 // |DlImage|
34 bool isOpaque() const override;
35
36 // |DlImage|
37 bool isUIThreadSafe() const override;
38
39 // |DlImage|
40 DlISize GetSize() const override;
41
42 // |DlImage|
43 size_t GetApproximateByteSize() const override;
44
45 // |DlImage|
46 DlColorSpace GetColorSpace() const override;
47
48 private:
49 sk_sp<SkImage> image_;
50
52};
53
54} // namespace flutter
55
56#endif // FLUTTER_DISPLAY_LIST_IMAGE_DL_IMAGE_SKIA_H_
Represents an image whose allocation is (usually) resident on device memory.
Definition dl_image.h:34
Type
The backend type of this image.
Definition dl_image.h:44
bool isOpaque() const override
If the pixel format of this image ignores alpha, this returns true. This method might conservatively ...
~DlImageSkia() override
Type GetImageType() const override
Returns the backend type of this image.
const DlImageSkia * asSkiaImage() const override
Safe downcast to DlImageSkia.
size_t GetApproximateByteSize() const override
bool isUIThreadSafe() const override
If the underlying platform image held by this object has no threading requirements for the release of...
DlISize GetSize() const override
virtual sk_sp< SkImage > skia_image() const
bool isTextureBacked() const override
Returns true if the image is backed by a GPU texture.
DlColorSpace GetColorSpace() const override
Gets the color space of the image.
static sk_sp< DlImage > Make(const SkImage *image)
FlutterVulkanImage * image
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
DlColorSpace
Definition dl_color.h:13