Flutter Engine
The Flutter Engine
Classes | Functions
SkGlyphCacheBench.cpp File Reference
#include "src/core/SkStrike.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkFontMgr.h"
#include "include/core/SkGraphics.h"
#include "include/core/SkTypeface.h"
#include "include/private/chromium/SkChromeRemoteGlyphCache.h"
#include "src/base/SkTLazy.h"
#include "src/core/SkStrikeSpec.h"
#include "src/core/SkTaskGroup.h"
#include "tools/Resources.h"
#include "tools/ToolUtils.h"
#include "tools/fonts/FontToolUtils.h"
#include "tools/text/SkTextBlobTrace.h"

Go to the source code of this file.

Classes

class  SkGlyphCacheBasic
 
class  SkGlyphCacheStressTest
 

Functions

static void do_font_stuff (SkFont *font)
 
BenchmarkCreateDiffCanvasBench (SkString name, std::function< std::unique_ptr< SkStreamAsset >()> dataSrc)
 
 DEF_BENCH (return CreateDiffCanvasBench(SkString("SkDiffBench-lorem_ipsum"), [](){ return GetResourceAsStream("diff_canvas_traces/lorem_ipsum.trace");}))
 

Function Documentation

◆ CreateDiffCanvasBench()

Benchmark * CreateDiffCanvasBench ( SkString  name,
std::function< std::unique_ptr< SkStreamAsset >()>  dataSrc 
)

Definition at line 255 of file SkGlyphCacheBench.cpp.

256 {
257 return new DiffCanvasBench(std::move(name), std::move(dataSrc));
258}
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ DEF_BENCH()

DEF_BENCH ( return   CreateDiffCanvasBenchSkString("SkDiffBench-lorem_ipsum"),[](){ return GetResourceAsStream("diff_canvas_traces/lorem_ipsum.trace");})

◆ do_font_stuff()

static void do_font_stuff ( SkFont font)
static

Definition at line 27 of file SkGlyphCacheBench.cpp.

27 {
28 SkPaint defaultPaint;
29 for (SkScalar i = 8; i < 64; i++) {
30 font->setSize(i);
31 auto strikeSpec = SkStrikeSpec::MakeMask(
35 for (int c = ' '; c < 'z'; c++) {
36 glyphs[c] = SkPackedGlyphID{font->unicharToGlyph(c)};
37 }
38 constexpr size_t glyphCount = 'z' - ' ';
39 SkSpan<const SkPackedGlyphID> glyphIDs{&glyphs[SkTo<int>(' ')], glyphCount};
41 for (int lookups = 0; lookups < 10; lookups++) {
42 (void)images.glyphs(glyphIDs);
43 }
44 }
45}
uint16_t glyphs[5]
Definition: FontMgrTest.cpp:46
@ kUnknown_SkPixelGeometry
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
static SkStrikeSpec MakeMask(const SkFont &font, const SkPaint &paint, const SkSurfaceProps &surfaceProps, SkScalerContextFlags scalerContextFlags, const SkMatrix &deviceMatrix)
float SkScalar
Definition: extension.cpp:12
std::array< MockImage, 3 > images
Definition: mock_vulkan.cc:41
font
Font Metadata and Metrics.