Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
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;
14class Context;
15class ContentContext;
16
18 public:
19 // |DlImage|
20 Type GetImageType() const override { return Type::kImpeller; }
21
22 // |DlImage|
23 const DlImageImpeller* asImpellerImage() const override { return this; }
24
25 // |DlImage|
26 bool isTextureBacked() const override { return true; }
27
28 virtual std::shared_ptr<Texture> GetImpellerTexture(
29 const std::shared_ptr<Context>& context) const = 0;
30
31 std::shared_ptr<Texture> GetCachedTexture(
32 const ContentContext& renderer) const;
33
34 static sk_sp<DlImageImpeller> Make(
35 std::shared_ptr<Texture> texture,
37
38 static sk_sp<DlImageImpeller> MakeFromYUVTextures(
39 AiksContext* aiks_context,
40 std::shared_ptr<Texture> y_texture,
41 std::shared_ptr<Texture> uv_texture,
42 YUVColorSpace yuv_color_space);
43};
44
46 public:
47 DlImageImpellerTexture(std::shared_ptr<Texture> texture,
49
51
52 // |DlImageImpeller|
53 std::shared_ptr<Texture> GetImpellerTexture(
54 const std::shared_ptr<Context>& context) const override;
55
56 flutter::DlColorSpace GetColorSpace() const override;
57 bool isOpaque() const override;
58 bool isUIThreadSafe() const override;
59 flutter::DlISize GetSize() const override;
60 size_t GetApproximateByteSize() const override;
61 OwningContext owning_context() const override { return owning_context_; }
62
63 private:
64 std::shared_ptr<Texture> texture_;
65 OwningContext owning_context_;
66
68 DlImageImpellerTexture& operator=(const DlImageImpellerTexture&) = delete;
69};
70
71} // namespace impeller
72
73#endif // FLUTTER_IMPELLER_DISPLAY_LIST_DL_IMAGE_IMPELLER_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
virtual OwningContext owning_context() const
Definition dl_image.h:136
std::shared_ptr< Texture > GetCachedTexture(const ContentContext &renderer) const
virtual std::shared_ptr< Texture > GetImpellerTexture(const std::shared_ptr< Context > &context) const =0
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
Returns true if the image is backed by a GPU texture.
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
const DlImageImpeller * asImpellerImage() const override
Safe downcast to DlImageImpeller.
Type GetImageType() const override
Returns the backend type of this image.
flutter::DlColorSpace GetColorSpace() const override
Gets the color space of the image.
bool isUIThreadSafe() const override
If the underlying platform image held by this object has no threading requirements for the release of...
flutter::DlISize GetSize() const override
bool isOpaque() const override
If the pixel format of this image ignores alpha, this returns true. This method might conservatively ...
std::shared_ptr< Texture > GetImpellerTexture(const std::shared_ptr< Context > &context) const override
size_t GetApproximateByteSize() const override
OwningContext owning_context() const override
FlTexture * texture
DlColorSpace
Definition dl_color.h:13
YUVColorSpace
Definition color.h:54