40 auto load_upper_from_base = [&]() {
42 if (fBaseStorage.
getPixels() ==
nullptr) {
44 (void)
image->getROPixels(dContext, &fBaseStorage);
52 if (!
inv.decomposeScale(&
scale,
nullptr)) {
76 load_upper_from_base();
82 load_upper_from_base();
89 if (fCurrMip->
getLevel(levelNum - 1, &levelRec)) {
92 load_upper_from_base();
98 if (fCurrMip->
getLevel(levelNum, &levelRec)) {
115 return access->fUpper.
addr() ? access :
nullptr;
static SkM44 inv(const SkM44 &m)
#define sk_float_round2int(x)
#define sk_float_floor2int(x)
static SkImage_Base * as_IB(SkImage *image)
static sk_sp< const SkMipmap > try_load_mips(const SkImage_Base *image)
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
const SkImageInfo & info() const
virtual GrDirectContext * directContext() const
static SkMatrix Scale(SkScalar sx, SkScalar sy)
float lowerWeight() const
static SkMipmapAccessor * Make(SkArenaAlloc *, const SkImage *, const SkMatrix &inv, SkMipmapMode)
std::pair< SkPixmap, SkMatrix > level() const
SkMipmapAccessor(const SkImage_Base *, const SkMatrix &inv, SkMipmapMode requestedMode)
static const SkMipmap * AddAndRef(const SkImage_Base *, SkResourceCache *localCache=nullptr)
static const SkMipmap * FindAndRef(const SkBitmapCacheDesc &, SkResourceCache *localCache=nullptr)
static float ComputeLevel(SkSize scaleSize)
bool getLevel(int index, Level *) const
const void * addr() const
void reset(T *ptr=nullptr)
sk_sp< const SkImage > image
static SkBitmapCacheDesc Make(const SkImage *)