52Image_YUVA::Image_YUVA(
const YUVAProxies& proxies,
57 yuva_alpha_type(yuvaInfo),
58 std::move(imageColorSpace)),
60 , fProxies(
std::move(proxies))
62 , fUVSubsampleFactors(
SkYUVAInfo::SubsamplingFactors(yuvaInfo.subsampling())) {
73 if (fProxies[
i].proxy()->isProtected()) {
79Image_YUVA::~Image_YUVA() =
default;
95 const int numPlanes = yuvaInfo.
numPlanes();
101 for (
int i = 0;
i < numPlanes; ++
i) {
102 if (!planes[
i] || !caps->
isTexturable(planes[
i].proxy()->textureInfo())) {
105 if (planes[
i].dimensions() != planeDimensions[
i]) {
108 pixmapChannelmasks[
i] = caps->
channelMask(planes[
i].proxy()->textureInfo());
115 expectedPlanes != numPlanes) {
119 if (planes[locations[kY].fPlane].dimensions() != yuvaInfo.
dimensions()) {
123 if (planes[locations[kU].fPlane].dimensions() != planes[locations[kV].fPlane].dimensions()) {
127 if (locations[
kA].fPlane >= 0 &&
128 planes[locations[
kA].fPlane].dimensions() != yuvaInfo.
dimensions()) {
138 YUVAProxies channelProxies;
140 auto [plane, channel] = locations[
i];
144 Swizzle channelSwizzle = planes[plane].swizzle().selectChannelInR((
int) channel);
145 channelProxies[
i] = planes[plane].replaceSwizzle(channelSwizzle);
146 }
else if (
i ==
kA) {
148 channelProxies[
i] = {};
150 SKGPU_LOG_W(
"YUVA channel %d does not have a valid location",
i);
157 std::move(imageColorSpace)));
177 if (
images[
i]->isAlphaOnly()) {
186 for (
int plane = 0; plane < yuvaInfo.
numPlanes(); ++plane) {
194size_t Image_YUVA::textureSize()
const {
207 for (
int j = 0; j <
i - 1; ++j) {
208 if (fProxies[
i].proxy() == fProxies[j].proxy()) {
214 if (fProxies[
i].proxy()->isInstantiated()) {
215 size += fProxies[
i].proxy()->texture()->gpuMemorySize();
217 size += fProxies[
i].proxy()->uninstantiatedGpuMemorySize();
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define SKGPU_LOG_W(fmt,...)
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
static unsigned repeat(SkFixed fx, int max)
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
static bool SkImageInfoIsValid(const SkImageInfo &info)
static SkImage_Base * as_IB(SkImage *image)
static constexpr auto kAssumedColorType
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
static constexpr int kMaxPlanes
YUVALocations toYUVALocations(const uint32_t *channelFlags) const
std::tuple< int, int > planeSubsamplingFactors(int planeIdx) const
int planeDimensions(SkISize planeDimensions[kMaxPlanes]) const
std::array< YUVALocation, kYUVAChannelCount > YUVALocations
static constexpr int kYUVAChannelCount
SkISize dimensions() const
virtual uint32_t channelMask(const TextureInfo &) const =0
bool isTexturable(const TextureInfo &) const
void linkDevices(const Image_Base *)
TextureProxyView makeSwizzle(Swizzle swizzle) const &
std::array< MockImage, 3 > images
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
sk_sp< const SkImage > image
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
const myers::Point & get(const myers::Segment &)
std::tuple< GrSurfaceProxyView, GrColorType > AsView(GrRecordingContext *rContext, const SkImage *img, skgpu::Mipmapped mipmapped, GrImageTexGenPolicy policy)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static bool AreValidLocations(const SkYUVAInfo::YUVALocations &locations, int *numPlanes=nullptr)