Flutter Engine
 
Loading...
Searching...
No Matches
dl_image_impeller.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_IMPELLER_DISPLAY_LIST_DL_IMAGE_IMPELLER_H_
6#define FLUTTER_IMPELLER_DISPLAY_LIST_DL_IMAGE_IMPELLER_H_
7
10
11namespace impeller {
12
13class AiksContext;
14
15class DlImageImpeller final : public flutter::DlImage {
16 public:
17 static sk_sp<DlImageImpeller> Make(
18 std::shared_ptr<Texture> texture,
20#if FML_OS_IOS_SIMULATOR
21 ,
22 bool is_fake_image = false
23#endif // FML_OS_IOS_SIMULATOR
24 );
25
26 static sk_sp<DlImageImpeller> MakeFromYUVTextures(
27 AiksContext* aiks_context,
28 std::shared_ptr<Texture> y_texture,
29 std::shared_ptr<Texture> uv_texture,
30 YUVColorSpace yuv_color_space);
31
32 // |DlImage|
33 ~DlImageImpeller() override;
34
35 // |DlImage|
36 sk_sp<SkImage> skia_image() const override;
37
38 // |DlImage|
39 std::shared_ptr<impeller::Texture> impeller_texture() const override;
40
41 // |DlImage|
42 bool isOpaque() const override;
43
44 // |DlImage|
45 bool isTextureBacked() const override;
46
47 // |DlImage|
48 bool isUIThreadSafe() const override;
49
50 // |DlImage|
51 flutter::DlISize GetSize() const override;
52
53 // |DlImage|
54 size_t GetApproximateByteSize() const override;
55
56 // |DlImage|
57 OwningContext owning_context() const override { return owning_context_; }
58
59#if FML_OS_IOS_SIMULATOR
60 // |DlImage|
61 bool IsFakeImage() const override { return is_fake_image_; }
62#endif // FML_OS_IOS_SIMULATOR
63
64 private:
65 std::shared_ptr<Texture> texture_;
66 OwningContext owning_context_;
67#if FML_OS_IOS_SIMULATOR
68 bool is_fake_image_ = false;
69#endif // FML_OS_IOS_SIMULATOR
70
71 explicit DlImageImpeller(std::shared_ptr<Texture> texture,
73#if FML_OS_IOS_SIMULATOR
74 ,
75 bool is_fake_image = false
76#endif // FML_OS_IOS_SIMULATOR
77 );
78
79 DlImageImpeller(const DlImageImpeller&) = delete;
80
81 DlImageImpeller& operator=(const DlImageImpeller&) = delete;
82};
83
84} // namespace impeller
85
86#endif // FLUTTER_IMPELLER_DISPLAY_LIST_DL_IMAGE_IMPELLER_H_
Represents an image whose allocation is (usually) resident on device memory.
Definition dl_image.h:32
size_t GetApproximateByteSize() const override
static sk_sp< DlImageImpeller > MakeFromYUVTextures(AiksContext *aiks_context, std::shared_ptr< Texture > y_texture, std::shared_ptr< Texture > uv_texture, YUVColorSpace yuv_color_space)
bool isTextureBacked() const override
std::shared_ptr< impeller::Texture > impeller_texture() const override
If this display list image is meant to be used by the Impeller backend, an Impeller texture instance....
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
flutter::DlISize GetSize() const override
sk_sp< SkImage > skia_image() const override
If this display list image is meant to be used by the Skia backend, an SkImage instance....
bool isUIThreadSafe() const override
If the underlying platform image held by this object has no threading requirements for the release of...
bool isOpaque() const override
If the pixel format of this image ignores alpha, this returns true. This method might conservatively ...
OwningContext owning_context() const override
FlTexture * texture
YUVColorSpace
Definition color.h:54