Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: tools/PictureRenderer.h

Issue 329993008: Make SKP bench JSON ouput better (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Pulling from master Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/PictureBenchmark.cpp ('k') | tools/PictureResultsWriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/PictureRenderer.h
diff --git a/tools/PictureRenderer.h b/tools/PictureRenderer.h
index efe118ff08f48701e53c89c19c6f9fdca01bd607..e6f4020dfd091f73560ae31b34184afe08eea65b 100644
--- a/tools/PictureRenderer.h
+++ b/tools/PictureRenderer.h
@@ -11,6 +11,7 @@
#include "SkCanvas.h"
#include "SkCountdown.h"
#include "SkDrawFilter.h"
+#include "SkJSONCPP.h"
#include "SkMath.h"
#include "SkPaint.h"
#include "SkPicture.h"
@@ -296,6 +297,60 @@ public:
return config;
}
+ Json::Value getJSONConfig() {
+ Json::Value result;
+
+ result["mode"] = this->getConfigNameInternal().c_str();
+ result["scale"] = 1.0f;
+ if (SK_Scalar1 != fScaleFactor) {
+ result["scale"] = SkScalarToFloat(fScaleFactor);
+ }
+ if (kRTree_BBoxHierarchyType == fBBoxHierarchyType) {
+ result["bbh"] = "rtree";
+ } else if (kQuadTree_BBoxHierarchyType == fBBoxHierarchyType) {
+ result["bbh"] = "quadtree";
+ } else if (kTileGrid_BBoxHierarchyType == fBBoxHierarchyType) {
+ SkString tmp("grid_");
+ tmp.appendS32(fGridInfo.fTileInterval.width());
+ tmp.append("x");
+ tmp.appendS32(fGridInfo.fTileInterval.height());
+ result["bbh"] = tmp.c_str();
+ }
+#if SK_SUPPORT_GPU
+ SkString tmp;
+ switch (fDeviceType) {
+ case kGPU_DeviceType:
+ if (0 != fSampleCount) {
+ tmp = "msaa";
+ tmp.appendS32(fSampleCount);
+ result["config"] = tmp.c_str();
+ } else {
+ result["config"] = "gpu";
+ }
+ break;
+ case kNVPR_DeviceType:
+ tmp = "nvprmsaa";
+ tmp.appendS32(fSampleCount);
+ result["config"] = tmp.c_str();
+ break;
+#if SK_ANGLE
+ case kAngle_DeviceType:
+ result["config"] = "angle";
+ break;
+#endif
+#if SK_MESA
+ case kMesa_DeviceType:
+ result["config"] = "mesa";
+ break;
+#endif
+ default:
+ // Assume that no extra info means bitmap.
+ break;
+ }
+#endif
+ return result;
+ }
+
#if SK_SUPPORT_GPU
bool isUsingGpuDevice() {
switch (fDeviceType) {
« no previous file with comments | « tools/PictureBenchmark.cpp ('k') | tools/PictureResultsWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698