Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
sk_gpu_test::LazyYUVImage Class Reference

#include <YUVUtils.h>

Public Types

enum class  Type { kFromPixmaps , kFromGenerator , kFromTextures , kFromImages }
 

Public Member Functions

SkISize dimensions () const
 
sk_sp< SkImagerefImage (GrRecordingContext *rContext, Type)
 

Static Public Member Functions

static std::unique_ptr< LazyYUVImageMake (sk_sp< SkData > data, skgpu::Mipmapped=skgpu::Mipmapped::kNo, sk_sp< SkColorSpace >=nullptr)
 
static std::unique_ptr< LazyYUVImageMake (SkYUVAPixmaps, skgpu::Mipmapped=skgpu::Mipmapped::kNo, sk_sp< SkColorSpace >=nullptr)
 

Detailed Description

Definition at line 40 of file YUVUtils.h.

Member Enumeration Documentation

◆ Type

Enumerator
kFromPixmaps 
kFromGenerator 
kFromTextures 
kFromImages 

Definition at line 50 of file YUVUtils.h.

Member Function Documentation

◆ dimensions()

SkISize sk_gpu_test::LazyYUVImage::dimensions ( ) const
inline

Definition at line 52 of file YUVUtils.h.

52{ return fPixmaps.yuvaInfo().dimensions(); }
SkISize dimensions() const
Definition SkYUVAInfo.h:171
const SkYUVAInfo & yuvaInfo() const

◆ Make() [1/2]

std::unique_ptr< LazyYUVImage > sk_gpu_test::LazyYUVImage::Make ( sk_sp< SkData data,
skgpu::Mipmapped  mipmapped = skgpu::Mipmapped::kNo,
sk_sp< SkColorSpace cs = nullptr 
)
static

Definition at line 200 of file YUVUtils.cpp.

202 {
203 std::unique_ptr<LazyYUVImage> image(new LazyYUVImage());
204 if (image->reset(std::move(data), mipmapped, std::move(cs))) {
205 return image;
206 } else {
207 return nullptr;
208 }
209}
sk_sp< SkImage > image
Definition examples.cpp:29

◆ Make() [2/2]

std::unique_ptr< LazyYUVImage > sk_gpu_test::LazyYUVImage::Make ( SkYUVAPixmaps  pixmaps,
skgpu::Mipmapped  mipmapped = skgpu::Mipmapped::kNo,
sk_sp< SkColorSpace cs = nullptr 
)
static

Definition at line 211 of file YUVUtils.cpp.

213 {
214 std::unique_ptr<LazyYUVImage> image(new LazyYUVImage());
215 if (image->reset(std::move(pixmaps), mipmapped, std::move(cs))) {
216 return image;
217 } else {
218 return nullptr;
219 }
220}

◆ refImage()

sk_sp< SkImage > sk_gpu_test::LazyYUVImage::refImage ( GrRecordingContext rContext,
Type  type 
)

Definition at line 222 of file YUVUtils.cpp.

222 {
223 if (this->ensureYUVImage(rContext, type)) {
224 size_t idx = static_cast<size_t>(type);
225 SkASSERT(idx < std::size(fYUVImage));
226 return fYUVImage[idx];
227 } else {
228 return nullptr;
229 }
230}
#define SkASSERT(cond)
Definition SkAssert.h:116

The documentation for this class was generated from the following files: