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

#include <GrAtlasTools.h>

Static Public Member Functions

static void Dump (const GrAtlasManager *, GrDirectContext *)
 
static void SetAtlasDimensionsToMinimum (GrAtlasManager *)
 
static void SetMaxPages (GrAtlasManager *, uint32_t maxPages)
 

Detailed Description

Definition at line 18 of file GrAtlasTools.h.

Member Function Documentation

◆ Dump()

void GrAtlasManagerTools::Dump ( const GrAtlasManager am,
GrDirectContext context 
)
static

Definition at line 79 of file GrAtlasTools.cpp.

79 {
80 SkASSERT(am);
81 static int gDumpCount = 0;
82 for (int i = 0; i < skgpu::kMaskFormatCount; ++i) {
83 if (am->fAtlases[i]) {
84 const GrSurfaceProxyView* views = am->fAtlases[i]->getViews();
85 for (uint32_t pageIdx = 0; pageIdx < am->fAtlases[i]->numActivePages(); ++pageIdx) {
86 SkASSERT(views[pageIdx].proxy());
87 SkString filename;
88#ifdef SK_BUILD_FOR_ANDROID
89 filename.printf("/sdcard/fontcache_%d%d%d.png", gDumpCount, i, pageIdx);
90#else
91 filename.printf("fontcache_%d%d%u.png", gDumpCount, i, pageIdx);
92#endif
93 SkColorType ct = MaskFormatToColorType(GrAtlasManager::AtlasIndexToMaskFormat(i));
95 context, views[pageIdx], SkColorTypeToGrColorType(ct), filename.c_str());
96 }
97 }
98 }
99 ++gDumpCount;
100}
static bool save_pixels(GrDirectContext *dContext, GrSurfaceProxyView view, GrColorType colorType, const char *filename)
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
Definition: GrTypesPriv.h:629
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkColorType
Definition: SkColorType.h:19
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534
const char * c_str() const
Definition: SkString.h:133
static constexpr SkColorType MaskFormatToColorType(MaskFormat format)
Definition: AtlasTypes.h:122
static const int kMaskFormatCount
Definition: AtlasTypes.h:105

◆ SetAtlasDimensionsToMinimum()

void GrAtlasManagerTools::SetAtlasDimensionsToMinimum ( GrAtlasManager am)
static

Definition at line 102 of file GrAtlasTools.cpp.

102 {
103 SkASSERT(am);
104 // Delete any old atlases.
105 // This should be safe to do as long as we are not in the middle of a flush.
106 for (int i = 0; i < skgpu::kMaskFormatCount; i++) {
107 am->fAtlases[i] = nullptr;
108 }
109
110 // Set all the atlas sizes to 1x1 plot each.
111 new (&am->fAtlasConfig) GrDrawOpAtlasConfig{};
112}

◆ SetMaxPages()

void GrAtlasManagerTools::SetMaxPages ( GrAtlasManager am,
uint32_t  maxPages 
)
static

Definition at line 114 of file GrAtlasTools.cpp.

114 {
115 SkASSERT(am);
116 for (int i = 0; i < skgpu::kMaskFormatCount; i++) {
117 if (am->fAtlases[i]) {
118 GrDrawOpAtlasTools::SetMaxPages(am->fAtlases[i].get(), maxPages);
119 }
120 }
121}
static void SetMaxPages(GrDrawOpAtlas *, uint32_t maxPages)

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