Flutter Engine
The Flutter Engine
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
5#include "flutter/lib/ui/painting/display_list_image_gpu.h"
6
7namespace flutter {
8
10 if (!image.skia_object()) {
11 return nullptr;
12 }
13 return sk_sp<DlImageGPU>(new DlImageGPU(std::move(image)));
14}
15
16DlImageGPU::DlImageGPU(SkiaGPUObject<SkImage> image)
17 : image_(std::move(image)) {}
18
19// |DlImage|
21
22// |DlImage|
24 return image_.skia_object();
25};
26
27// |DlImage|
28std::shared_ptr<impeller::Texture> DlImageGPU::impeller_texture() const {
29 return nullptr;
30}
31
32// |DlImage|
34 if (auto image = skia_image()) {
35 return image->isOpaque();
36 }
37 return false;
38}
39
40// |DlImage|
42 if (auto image = skia_image()) {
43 return image->isTextureBacked();
44 }
45 return false;
46}
47
48// |DlImage|
50 return true;
51}
52
53// |DlImage|
55 const auto image = skia_image();
57}
58
59// |DlImage|
61 auto size = sizeof(*this);
62 if (auto image = skia_image()) {
63 const auto& info = image->imageInfo();
64 const auto kMipmapOverhead = image->hasMipmaps() ? 4.0 / 3.0 : 1.0;
65 const size_t image_byte_size = info.computeMinByteSize() * kMipmapOverhead;
66 size += image_byte_size;
67 }
68 return size;
69}
70
71} // namespace flutter
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
const SkImageInfo & imageInfo() const
Definition: SkImage.h:279
SkISize dimensions() const
Definition: SkImage.h:297
bool isOpaque() const
Definition: SkImage.h:375
virtual bool isTextureBacked() const =0
bool hasMipmaps() const
Definition: SkImage.cpp:292
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 ...
static sk_sp< DlImageGPU > Make(SkiaGPUObject< SkImage > image)
SkISize dimensions() 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....
sk_sp< SkiaObjectType > skia_object() const
sk_sp< const SkImage > image
Definition: SkRecords.h:269
it will be possible to load the file into Perfetto s trace viewer 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: switches.h:259
Definition: ref_ptr.h:256
Definition: SkSize.h:16
static constexpr SkISize MakeEmpty()
Definition: SkSize.h:22