Flutter Engine
 
Loading...
Searching...
No Matches
display_list_image_gpu.cc
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
6
8
9namespace flutter {
10
12 if (!image.skia_object()) {
13 return nullptr;
14 }
15 return sk_sp<DlImageGPU>(new DlImageGPU(std::move(image)));
16}
17
18DlImageGPU::DlImageGPU(SkiaGPUObject<SkImage> image)
19 : image_(std::move(image)) {}
20
21// |DlImage|
23
24// |DlImage|
25sk_sp<SkImage> DlImageGPU::skia_image() const {
26 return image_.skia_object();
27};
28
29// |DlImage|
30std::shared_ptr<impeller::Texture> DlImageGPU::impeller_texture() const {
31 return nullptr;
32}
33
34// |DlImage|
36 if (auto image = skia_image()) {
37 return image->isOpaque();
38 }
39 return false;
40}
41
42// |DlImage|
44 if (auto image = skia_image()) {
45 return image->isTextureBacked();
46 }
47 return false;
48}
49
50// |DlImage|
52 return true;
53}
54
55// |DlImage|
57 const auto image = skia_image();
58 return image ? ToDlISize(image->dimensions()) : DlISize();
59}
60
61// |DlImage|
63 auto size = sizeof(*this);
64 if (auto image = skia_image()) {
65 const auto& info = image->imageInfo();
66 const auto kMipmapOverhead = image->hasMipmaps() ? 4.0 / 3.0 : 1.0;
67 const size_t image_byte_size = info.computeMinByteSize() * kMipmapOverhead;
68 size += image_byte_size;
69 }
70 return size;
71}
72
73} // namespace flutter
sk_sp< SkImage > skia_image() const override
If this display list image is meant to be used by the Skia backend, an SkImage instance....
virtual size_t GetApproximateByteSize() const override
bool isTextureBacked() const override
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 ...
DlISize GetSize() const override
static sk_sp< DlImageGPU > Make(SkiaGPUObject< SkImage > image)
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....
sk_sp< SkiaObjectType > skia_object() const
FlutterVulkanImage * image
const DlISize & ToDlISize(const SkISize &size)
impeller::ISize32 DlISize
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition ref_ptr.h:261