Flutter Engine
The Flutter Engine
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"
10
11namespace impeller {
12
13class AiksContext;
14
15class DlImageImpeller final : public flutter::DlImage {
16 public:
18 std::shared_ptr<Texture> texture,
20
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,
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_
Represents an image whose allocation is (usually) resident on device memory.
Definition: dl_image.h:30
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....
SkISize dimensions() const override
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
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:55
Definition: SkSize.h:16