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

Unified Diff: tools/PictureRenderer.h

Issue 98643007: render_pictures: add --writeJsonSummaryPath (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix dependencies (nice catch, trybots) Created 7 years 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 | « gyp/tools.gyp ('k') | tools/PictureRenderer.cpp » ('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 6a84130ac6b26a0923ee7b94615d3186118acfa2..6d886abfdc52b105f392d8c037a0343bd012362a 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"
@@ -37,6 +38,30 @@ namespace sk_tools {
class TiledPictureRenderer;
+/**
+ * Class for collecting image results (checksums) as we go.
+ */
+class ImageResultsSummary {
+public:
+ /**
+ * Adds this bitmap's hash to the summary of results.
+ *
+ * @param testName name of the test
+ * @param bitmap bitmap to store the hash of
+ */
+ void add(const char *testName, const SkBitmap& bitmap);
+
+ /**
+ * Writes the summary (as constructed so far) to a file.
+ *
+ * @param filename path to write the summary to
+ */
+ void writeToFile(const char *filename);
+
+private:
+ Json::Value fActualResultsNoComparison;
+};
+
class PictureRenderer : public SkRefCnt {
public:
@@ -183,6 +208,10 @@ public:
fGridInfo.fTileInterval.set(width, height);
}
+ void setJsonSummaryPtr(ImageResultsSummary* jsonSummaryPtr) {
+ fJsonSummaryPtr = jsonSummaryPtr;
+ }
+
bool isUsingBitmapDevice() {
return kBitmap_DeviceType == fDeviceType;
}
@@ -266,6 +295,7 @@ public:
PictureRenderer()
: fPicture(NULL)
+ , fJsonSummaryPtr(NULL)
, fDeviceType(kBitmap_DeviceType)
, fBBoxHierarchyType(kNone_BBoxHierarchyType)
, fScaleFactor(SK_Scalar1)
@@ -290,6 +320,7 @@ public:
protected:
SkAutoTUnref<SkCanvas> fCanvas;
SkPicture* fPicture;
+ ImageResultsSummary* fJsonSummaryPtr;
SkDeviceTypes fDeviceType;
BBoxHierarchyType fBBoxHierarchyType;
DrawFilterFlags fDrawFilters[SkDrawFilter::kTypeCount];
« no previous file with comments | « gyp/tools.gyp ('k') | tools/PictureRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698