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

Unified Diff: tools/fiddle/fiddle_main.cpp

Issue 2003043002: fiddle: srand(0) before draw(canvas) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/fiddle/fiddle_main.cpp
diff --git a/tools/fiddle/fiddle_main.cpp b/tools/fiddle/fiddle_main.cpp
index bf7a032b446aaf39cf3fa09cd69330d5887c75f0..f6270daaa59ae3935a4e095ed53742ff01a3d854 100644
--- a/tools/fiddle/fiddle_main.cpp
+++ b/tools/fiddle/fiddle_main.cpp
@@ -6,6 +6,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <GL/osmesa.h>
@@ -111,6 +112,7 @@ int main() {
if (options.raster) {
auto rasterSurface =
SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(options.size));
+ srand(0);
draw(rasterSurface->getCanvas());
rasterData.reset(encode_snapshot(rasterSurface));
}
@@ -128,6 +130,7 @@ int main() {
fputs("Unable to get render surface.\n", stderr);
exit(1);
}
+ srand(0);
draw(surface->getCanvas());
gpuData.reset(encode_snapshot(surface));
}
@@ -138,6 +141,7 @@ int main() {
if (options.pdf) {
SkDynamicMemoryWStream pdfStream;
sk_sp<SkDocument> document(SkDocument::MakePDF(&pdfStream));
+ srand(0);
draw(document->beginPage(options.size.width(), options.size.height()));
document->close();
pdfData.reset(pdfStream.copyToData());
@@ -146,6 +150,7 @@ int main() {
SkSize size;
size = options.size;
SkPictureRecorder recorder;
+ srand(0);
draw(recorder.beginRecording(size.width(), size.height()));
auto picture = recorder.finishRecordingAsPicture();
SkDynamicMemoryWStream skpStream;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698