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

Unified Diff: tools/PictureRenderer.h

Issue 291843010: Call write() within render_pictures but not bench_pictures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable write() calls except in render_pictures Created 6 years, 7 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 | « no previous file | 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 468c567b13ce1b35a5a139b5d12b467fcf45a6b8..109073bca764dee97dc1895292e36ccbfb8fa41f 100644
--- a/tools/PictureRenderer.h
+++ b/tools/PictureRenderer.h
@@ -96,6 +96,14 @@ public:
const SkString* inputFilename, bool useChecksumBasedFilenames);
/**
+ * TODO(epoger): Temporary hack, while we work on http://skbug.com/2584 ('bench_pictures is
+ * timing reading pixels and writing json files'), such that:
+ * - render_pictures can call this method and continue to work
+ * - any other callers (bench_pictures) will skip calls to write() by default
+ */
+ void enableWrites() { fEnableWrites = true; }
+
+ /**
* Set the viewport so that only the portion listed gets drawn.
*/
void setViewport(SkISize size) { fViewport = size; }
@@ -345,6 +353,7 @@ public:
PictureRenderer()
: fJsonSummaryPtr(NULL)
, fDeviceType(kBitmap_DeviceType)
+ , fEnableWrites(false)
, fBBoxHierarchyType(kNone_BBoxHierarchyType)
, fScaleFactor(SK_Scalar1)
#if SK_SUPPORT_GPU
@@ -371,6 +380,7 @@ protected:
bool fUseChecksumBasedFilenames;
ImageResultsAndExpectations* fJsonSummaryPtr;
SkDeviceTypes fDeviceType;
+ bool fEnableWrites;
BBoxHierarchyType fBBoxHierarchyType;
DrawFilterFlags fDrawFilters[SkDrawFilter::kTypeCount];
SkString fDrawFiltersConfig;
« no previous file with comments | « no previous file | tools/PictureRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698