Flutter Engine
 
Loading...
Searching...
No Matches
dl_image_skia.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
11DlImageSkia::DlImageSkia(sk_sp<SkImage> image) : image_(std::move(image)) {}
12
13// |DlImage|
15
16// |DlImage|
17sk_sp<SkImage> DlImageSkia::skia_image() const {
18 return image_;
19};
20
21// |DlImage|
22std::shared_ptr<impeller::Texture> DlImageSkia::impeller_texture() const {
23 return nullptr;
24}
25
26// |DlImage|
28 return image_ ? image_->isOpaque() : false;
29}
30
31// |DlImage|
33 return image_ ? image_->isTextureBacked() : false;
34}
35
36// |DlImage|
38 // Technically if the image is null then we are thread-safe, and possibly
39 // if the image is constructed from a heap raster as well, but there
40 // should never be a leak of an instance of this class into any data that
41 // is shared with the UI thread, regardless of value.
42 // All images intended to be shared with the UI thread should be constructed
43 // via one of the DlImage subclasses designed for that purpose.
44 return false;
45}
46
47// |DlImage|
49 return image_ ? ToDlISize(image_->dimensions()) : DlISize();
50}
51
52// |DlImage|
54 auto size = sizeof(*this);
55 if (image_) {
56 const auto& info = image_->imageInfo();
57 const auto kMipmapOverhead = image_->hasMipmaps() ? 4.0 / 3.0 : 1.0;
58 const size_t image_byte_size = info.computeMinByteSize() * kMipmapOverhead;
59 size += image_byte_size;
60 }
61 return size;
62}
63
64} // namespace flutter
bool isOpaque() const override
If the pixel format of this image ignores alpha, this returns true. This method might conservatively ...
~DlImageSkia() 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....
size_t GetApproximateByteSize() const override
DlImageSkia(sk_sp< SkImage > image)
bool isUIThreadSafe() const override
If the underlying platform image held by this object has no threading requirements for the release of...
DlISize GetSize() const override
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....
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