13#if defined(SK_BUILD_FOR_ANDROID)
14static constexpr const char*
kBenchFile =
"/data/local/tmp/bench.json";
16static constexpr const char*
kBenchFile =
"/tmp/bench.json";
23 const char*
onGetName()
override {
return "json_skjson"; }
41 for (
int i = 0;
i < loops;
i++) {
60#include "rapidjson/document.h"
66 const char*
onGetName()
override {
return "json_rapidjson"; }
74 auto* data8 =
reinterpret_cast<uint8_t*
>(fCStringData->writable_data());
76 data8[
stream->getLength()] =
'\0';
84 fCStringData =
nullptr;
88 if (!fCStringData)
return;
90 for (
int i = 0;
i < loops;
i++) {
91 rapidjson::Document doc;
92 doc.Parse(
static_cast<const char*
>(fCStringData->data()));
93 if (doc.HasParseError()) {
118 const char*
onGetName()
override {
return "json_pjson"; }
126 auto* data8 =
reinterpret_cast<uint8_t*
>(fCStringData->writable_data());
128 data8[
stream->getLength()] =
'\0';
136 fCStringData =
nullptr;
140 if (!fCStringData)
return;
142 for (
int i = 0;
i < loops;
i++) {
146 if (!doc.deserialize_in_place(
static_cast<char*
>(
data->writable_data()))) {
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static constexpr const char * kBenchFile
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define INHERITED(method,...)
virtual void onPerCanvasPostDraw(SkCanvas *)
virtual void onDraw(int loops, SkCanvas *)=0
virtual bool isSuitableFor(Backend backend)
virtual void onPerCanvasPreDraw(SkCanvas *)
virtual const char * onGetName()=0
bool isSuitableFor(Backend backend) override
const char * onGetName() override
void onPerCanvasPreDraw(SkCanvas *) override
void onPerCanvasPostDraw(SkCanvas *) override
void onDraw(int loops, SkCanvas *) override
static sk_sp< SkData > MakeUninitialized(size_t length)
const void * data() const
static sk_sp< SkData > MakeWithCopy(const void *data, size_t length)
static sk_sp< SkData > MakeFromFileName(const char path[])
static std::unique_ptr< SkStreamAsset > MakeFromFile(const char path[])
std::shared_ptr< const fml::Mapping > data