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: Fix initializer style 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
Index: tools/PictureRenderer.h
diff --git a/tools/PictureRenderer.h b/tools/PictureRenderer.h
index efe118ff08f48701e53c89c19c6f9fdca01bd607..874adb55993c39cf4e4893d6ed350889231a085e 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,62 @@ public:
return config;
}
robertphillips 2014/06/24 20:49:51 can this be const ?
kelvinly 2014/06/24 22:25:19 Done.
+ Json::Value getJSONConfig() {
+ Json::Value result;
+
+ result["mode"] = this->getConfigNameInternal().c_str();
+ result["scale"] = 1.0f;
robertphillips 2014/06/24 20:49:51 put SK_Scalar1 on left hand side ?
kelvinly 2014/06/24 22:25:19 Done.
+ if (fScaleFactor != SK_Scalar1) {
+ 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:
robertphillips 2014/06/24 20:49:51 0 != fSampleCount ?
kelvinly 2014/06/24 22:25:19 Done.
+ if (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:
+ // ??? This is appropriate behavior?
+ 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
+ // results["dunno"] = fDrawFiltersConfig.c_str();
+ return result;
+ }
+
#if SK_SUPPORT_GPU
bool isUsingGpuDevice() {
switch (fDeviceType) {

Powered by Google App Engine
This is Rietveld 408576698