Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkMipmapBuilder Class Reference

#include <SkMipmapBuilder.h>

Public Member Functions

 SkMipmapBuilder (const SkImageInfo &)
 
 ~SkMipmapBuilder ()
 
int countLevels () const
 
SkPixmap level (int index) const
 
sk_sp< SkImageattachTo (const sk_sp< const SkImage > &src)
 

Detailed Description

Definition at line 18 of file SkMipmapBuilder.h.

Constructor & Destructor Documentation

◆ SkMipmapBuilder()

SkMipmapBuilder::SkMipmapBuilder ( const SkImageInfo info)

Definition at line 15 of file SkMipmapBuilder.cpp.

15 {
16 fMM = sk_sp<SkMipmap>(SkMipmap::Build({info, nullptr, 0},
17 /* factoryProc= */ nullptr,
18 /* computeContents= */ false));
19}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
static SkMipmap * Build(const SkPixmap &src, SkDiscardableFactoryProc, bool computeContents=true)
Definition: SkMipmap.cpp:45

◆ ~SkMipmapBuilder()

SkMipmapBuilder::~SkMipmapBuilder ( )

Definition at line 21 of file SkMipmapBuilder.cpp.

21{}

Member Function Documentation

◆ attachTo()

sk_sp< SkImage > SkMipmapBuilder::attachTo ( const sk_sp< const SkImage > &  src)

If these levels are compatible with src, return a new Image that combines src's base level with these levels as mip levels. If not compatible, this returns nullptr.

Definition at line 37 of file SkMipmapBuilder.cpp.

37 {
38 return src->withMipmaps(fMM);
39}

◆ countLevels()

int SkMipmapBuilder::countLevels ( ) const

Definition at line 23 of file SkMipmapBuilder.cpp.

23 {
24 return fMM ? fMM->countLevels() : 0;
25}
int countLevels() const
Definition: SkMipmap.cpp:276

◆ level()

SkPixmap SkMipmapBuilder::level ( int  index) const

Definition at line 27 of file SkMipmapBuilder.cpp.

27 {
28 SkPixmap pm;
29
31 if (fMM && fMM->getLevel(index, &level)) {
32 pm = level.fPixmap;
33 }
34 return pm;
35}
SkPixmap level(int index) const
bool getLevel(int index, Level *) const
Definition: SkMipmap.cpp:280

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