Definition at line 313 of file TessellateBench.cpp.
◆ TessPrepareBench()
skgpu::ganesh::TessPrepareBench::TessPrepareBench |
( |
MakePathStrokesFn |
makePathStrokesFn, |
|
|
PatchAttribs |
attribs, |
|
|
float |
matrixScale, |
|
|
const char * |
suffix |
|
) |
| |
|
inline |
Definition at line 315 of file TessellateBench.cpp.
319 : fMakePathStrokesFn(makePathStrokesFn)
320 , fPatchAttribs(attribs)
321 , fMatrixScale(matrixScale) {
322 fName.
printf(
"tessellate_%s", suffix);
323 }
void printf(const char format[],...) SK_PRINTF_LIKE(2
◆ isSuitableFor()
bool skgpu::ganesh::TessPrepareBench::isSuitableFor |
( |
Backend |
backend | ) |
|
|
inlinefinalprivatevirtual |
◆ onDelayedSetup()
void skgpu::ganesh::TessPrepareBench::onDelayedSetup |
( |
| ) |
|
|
inlineoverrideprivatevirtual |
Reimplemented from Benchmark.
Definition at line 329 of file TessellateBench.cpp.
329 {
331 if (!fTarget->mockContext()) {
332 SkDebugf(
"ERROR: could not create mock context.");
333 return;
334 }
335
336 fPathStrokes = fMakePathStrokesFn();
337 for (size_t i = 0; i < fPathStrokes.size(); ++i) {
338 if (i + 1 < fPathStrokes.size()) {
339 fPathStrokes[i].fNext = &fPathStrokes[i + 1];
340 }
341 fTotalVerbCount += fPathStrokes[i].fPath.countVerbs();
342 }
343
344 fTessellator = std::make_unique<StrokeTessellator>(fPatchAttribs);
345 }
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static sk_sp< GrDirectContext > make_mock_context()
◆ onDraw()
void skgpu::ganesh::TessPrepareBench::onDraw |
( |
int |
loops, |
|
|
SkCanvas * |
|
|
) |
| |
|
inlinefinalprivatevirtual |
Implements Benchmark.
Definition at line 347 of file TessellateBench.cpp.
347 {
348 for (int i = 0; i < loops; ++i) {
349 fTessellator->prepare(fTarget.get(),
351 fPathStrokes.data(),
352 fTotalVerbCount);
353 fTarget->resetAllocator();
354 }
355 }
static SkMatrix Scale(SkScalar sx, SkScalar sy)
◆ onGetName()
const char * skgpu::ganesh::TessPrepareBench::onGetName |
( |
| ) |
|
|
inlineoverrideprivatevirtual |
The documentation for this class was generated from the following file: