Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
SkImage_Lazy::Validator Struct Reference

#include <SkImage_Lazy.h>

Public Member Functions

 Validator (sk_sp< SharedGenerator >, const SkColorType *, sk_sp< SkColorSpace >)
 
 operator bool () const
 

Public Attributes

sk_sp< SharedGeneratorfSharedGenerator
 
SkImageInfo fInfo
 
sk_sp< SkColorSpacefColorSpace
 
uint32_t fUniqueID
 

Detailed Description

Definition at line 40 of file SkImage_Lazy.h.

Constructor & Destructor Documentation

◆ Validator()

SkImage_Lazy::Validator::Validator ( sk_sp< SharedGenerator gen,
const SkColorType colorType,
sk_sp< SkColorSpace colorSpace 
)

Definition at line 42 of file SkImage_Lazy.cpp.

44 : fSharedGenerator(std::move(gen)) {
45 if (!fSharedGenerator) {
46 return;
47 }
48
49 // The following generator accessors are safe without acquiring the mutex (const getters).
50 // TODO: refactor to use a ScopedGenerator instead, for clarity.
51 fInfo = fSharedGenerator->fGenerator->getInfo();
52 if (fInfo.isEmpty()) {
54 return;
55 }
56
58
59 if (colorType && (*colorType == fInfo.colorType())) {
60 colorType = nullptr;
61 }
62
63 if (colorType || colorSpace) {
64 if (colorType) {
66 }
67 if (colorSpace) {
69 }
71 }
72}
std::unique_ptr< SkImageGenerator > fGenerator
Definition: SkImage_Lazy.h:117
SkColorSpace * colorSpace() const
Definition: SkImage.cpp:156
SkColorType colorType() const
Definition: SkImage.cpp:152
static uint32_t ImageID()
Definition: SkPixelRef.cpp:19
void reset(T *ptr=nullptr)
Definition: SkRefCnt.h:310
Definition: gen.py:1
bool isEmpty() const
Definition: SkImageInfo.h:399
SkImageInfo makeColorSpace(sk_sp< SkColorSpace > cs) const
SkColorType colorType() const
Definition: SkImageInfo.h:373
SkImageInfo makeColorType(SkColorType newColorType) const
Definition: SkImageInfo.h:475
sk_sp< SharedGenerator > fSharedGenerator
Definition: SkImage_Lazy.h:45

Member Function Documentation

◆ operator bool()

SkImage_Lazy::Validator::operator bool ( ) const
inlineexplicit

Definition at line 43 of file SkImage_Lazy.h.

43{ return fSharedGenerator.get(); }
T * get() const
Definition: SkRefCnt.h:303

Member Data Documentation

◆ fColorSpace

sk_sp<SkColorSpace> SkImage_Lazy::Validator::fColorSpace

Definition at line 47 of file SkImage_Lazy.h.

◆ fInfo

SkImageInfo SkImage_Lazy::Validator::fInfo

Definition at line 46 of file SkImage_Lazy.h.

◆ fSharedGenerator

sk_sp<SharedGenerator> SkImage_Lazy::Validator::fSharedGenerator

Definition at line 45 of file SkImage_Lazy.h.

◆ fUniqueID

uint32_t SkImage_Lazy::Validator::fUniqueID

Definition at line 48 of file SkImage_Lazy.h.


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