timerData.appendTimes(timer, fRepeats - 1 == i);
}
- const char* configName = usingGpu ? "gpu" : "raster";
+ SkString configName = fRenderer->getConfigName();
SkString result = timerData.getResult(fLogPerIter, fPrintMin, fRepeats,
- configName, fShowWallTime, fShowTruncatedWallTime,
+ configName.c_str(), fShowWallTime, fShowTruncatedWallTime,
fShowCpuTime, fShowTruncatedCpuTime,
usingGpu && fShowGpuTime);
result.append("\n");
return false;
}
+SkString RecordPictureRenderer::getConfigNameInternal() {
+ return SkString("record");
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////
bool PipePictureRenderer::render(const SkString* path) {
return true;
}
+SkString PipePictureRenderer::getConfigNameInternal() {
+ return SkString("pipe");
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////
void SimplePictureRenderer::init(SkPicture* picture) {
return true;
}
+SkString SimplePictureRenderer::getConfigNameInternal() {
+ return SkString("simple");
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////
TiledPictureRenderer::TiledPictureRenderer()
canvas->clipRect(clip);
return canvas;
}
+
+SkString TiledPictureRenderer::getConfigNameInternal() {
+ SkString name;
+ if (fTileMinPowerOf2Width > 0) {
+ name.append("pow2tile_");
+ name.appendf("%i", fTileMinPowerOf2Width);
+ } else {
+ name.append("tile_");
+ if (fTileWidthPercentage > 0) {
+ name.appendf("%.f%%", fTileWidthPercentage);
+ } else {
+ name.appendf("%i", fTileWidth);
+ }
+ }
+ name.append("x");
+ if (fTileHeightPercentage > 0) {
+ name.appendf("%.f%%", fTileHeightPercentage);
+ } else {
+ name.appendf("%i", fTileHeight);
+ }
+ return name;
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////
// Holds all of the information needed to draw a set of tiles.
SkDELETE_ARRAY(fPictureClones);
}
+SkString MultiCorePictureRenderer::getConfigNameInternal() {
+ SkString name = this->INHERITED::getConfigNameInternal();
+ name.appendf("_multi_%i_threads", fNumThreads);
+ return name;
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////
void PlaybackCreationRenderer::setup() {
return false;
}
+SkString PlaybackCreationRenderer::getConfigNameInternal() {
+ return SkString("playback_creation");
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////
// SkPicture variants for each BBoxHierarchy type
virtual SkString getNormalTimeFormat() { return SkString("%6.2f"); }
+ /**
+ * Reports the configuration of this PictureRenderer.
+ */
+ SkString getConfigName() {
+ SkString config = this->getConfigNameInternal();
+ if (kRTree_BBoxHierarchyType == fBBoxHierarchyType) {
+ config.append("_rtree");
+ }
+#if SK_SUPPORT_GPU
+ if (this->isUsingGpuDevice()) {
+ config.append("_gpu");
+ }
+#endif
+ return config;
+ }
+
#if SK_SUPPORT_GPU
bool isUsingGpuDevice() {
return kGPU_DeviceType == fDeviceType;
#endif
private:
+ virtual SkString getConfigNameInternal() = 0;
+
typedef SkRefCnt INHERITED;
};
virtual SkString getPerIterTimeFormat() SK_OVERRIDE { return SkString("%.4f"); }
virtual SkString getNormalTimeFormat() SK_OVERRIDE { return SkString("%6.4f"); }
+
+private:
+ virtual SkString getConfigNameInternal() SK_OVERRIDE;
};
class PipePictureRenderer : public PictureRenderer {
virtual bool render(const SkString*) SK_OVERRIDE;
private:
+ virtual SkString getConfigNameInternal() SK_OVERRIDE;
+
typedef PictureRenderer INHERITED;
};
virtual bool render(const SkString*) SK_OVERRIDE;
private:
+ virtual SkString getConfigNameInternal() SK_OVERRIDE;
+
typedef PictureRenderer INHERITED;
};
}
protected:
- virtual SkCanvas* setupCanvas(int width, int height) SK_OVERRIDE;
SkTDArray<SkRect> fTileRects;
+ virtual SkCanvas* setupCanvas(int width, int height) SK_OVERRIDE;
+ virtual SkString getConfigNameInternal() SK_OVERRIDE;
+
private:
int fTileWidth;
int fTileHeight;
virtual void end() SK_OVERRIDE;
private:
+ virtual SkString getConfigNameInternal() SK_OVERRIDE;
+
const int fNumThreads;
SkTDArray<SkCanvas*> fCanvasPool;
SkThreadPool fThreadPool;
private:
SkAutoTUnref<SkPicture> fReplayer;
+
+ virtual SkString getConfigNameInternal() SK_OVERRIDE;
+
typedef PictureRenderer INHERITED;
};