| Flutter Impeller |

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
8 #include "flutter/display_list/image/dl_image.h"
9 #include "impeller/core/texture.h"
10
11 namespace impeller {
12
13 class AiksContext;
14
15 class DlImageImpeller final : public flutter::DlImage {
16 public:
17 static sk_sp<DlImageImpeller> Make(
18 std::shared_ptr<Texture> texture,
19 OwningContext owning_context = OwningContext::kIO);
20
21 static sk_sp<DlImageImpeller> MakeFromYUVTextures(
22 AiksContext* aiks_context,
23 std::shared_ptr<Texture> y_texture,
24 std::shared_ptr<Texture> uv_texture,
25 YUVColorSpace yuv_color_space);
26
27 // |DlImage|
28 ~DlImageImpeller() override;
29
30 // |DlImage|
31 sk_sp<SkImage> skia_image() const override;
32
33 // |DlImage|
34 std::shared_ptr<impeller::Texture> impeller_texture() const override;
35
36 // |DlImage|
37 bool isOpaque() const override;
38
39 // |DlImage|
40 bool isTextureBacked() const override;
41
42 // |DlImage|
43 bool isUIThreadSafe() const override;
44
45 // |DlImage|
46 SkISize dimensions() const override;
47
48 // |DlImage|
49 size_t GetApproximateByteSize() const override;
50
51 // |DlImage|
52 OwningContext owning_context() const override { return owning_context_; }
53
54 private:
55 std::shared_ptr<Texture> texture_;
56 OwningContext owning_context_;
57
58 explicit DlImageImpeller(std::shared_ptr<Texture> texture,
59 OwningContext owning_context = OwningContext::kIO);
60
61 DlImageImpeller(const DlImageImpeller&) = delete;
62
63 DlImageImpeller& operator=(const DlImageImpeller&) = delete;
64 };
65
66 } // namespace impeller
67
68 #endif // FLUTTER_IMPELLER_DISPLAY_LIST_DL_IMAGE_IMPELLER_H_
impeller::AiksContext
Definition: aiks_context.h:19
impeller::DlImageImpeller::MakeFromYUVTextures
static sk_sp< DlImageImpeller > MakeFromYUVTextures(AiksContext *aiks_context, std::shared_ptr< Texture > y_texture, std::shared_ptr< Texture > uv_texture, YUVColorSpace yuv_color_space)
Definition: dl_image_impeller.cc:21
impeller::DlImageImpeller::isUIThreadSafe
bool isUIThreadSafe() const override
Definition: dl_image_impeller.cc:77
impeller::DlImageImpeller::dimensions
SkISize dimensions() const override
Definition: dl_image_impeller.cc:83
impeller::DlImageImpeller
Definition: dl_image_impeller.h:15
impeller::DlImageImpeller::Make
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
Definition: dl_image_impeller.cc:12
impeller::DlImageImpeller::owning_context
OwningContext owning_context() const override
Definition: dl_image_impeller.h:52
impeller::DlImageImpeller::isOpaque
bool isOpaque() const override
Definition: dl_image_impeller.cc:65
impeller::DlImageImpeller::impeller_texture
std::shared_ptr< impeller::Texture > impeller_texture() const override
Definition: dl_image_impeller.cc:60
impeller::DlImageImpeller::skia_image
sk_sp< SkImage > skia_image() const override
Definition: dl_image_impeller.cc:55
impeller::DlImageImpeller::isTextureBacked
bool isTextureBacked() const override
Definition: dl_image_impeller.cc:71
texture.h
impeller::YUVColorSpace
YUVColorSpace
Definition: color.h:55
impeller::DlImageImpeller::~DlImageImpeller
~DlImageImpeller() override
impeller
Definition: aiks_blend_unittests.cc:18
impeller::DlImageImpeller::GetApproximateByteSize
size_t GetApproximateByteSize() const override
Definition: dl_image_impeller.cc:89