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

Side by Side Diff: tools/PictureRenderer.h

Issue 261313004: add --readJsonSummaryPath to render_pictures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: split out SkDataUtils.[h,cpp] 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef PictureRenderer_DEFINED 8 #ifndef PictureRenderer_DEFINED
9 #define PictureRenderer_DEFINED 9 #define PictureRenderer_DEFINED
10 10
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkCountdown.h" 12 #include "SkCountdown.h"
13 #include "SkDrawFilter.h" 13 #include "SkDrawFilter.h"
14 #include "SkJSONCPP.h"
15 #include "SkMath.h" 14 #include "SkMath.h"
16 #include "SkPaint.h" 15 #include "SkPaint.h"
17 #include "SkPicture.h" 16 #include "SkPicture.h"
18 #include "SkPictureRecorder.h" 17 #include "SkPictureRecorder.h"
19 #include "SkRect.h" 18 #include "SkRect.h"
20 #include "SkRefCnt.h" 19 #include "SkRefCnt.h"
21 #include "SkRunnable.h" 20 #include "SkRunnable.h"
22 #include "SkString.h" 21 #include "SkString.h"
23 #include "SkTDArray.h" 22 #include "SkTDArray.h"
24 #include "SkThreadPool.h" 23 #include "SkThreadPool.h"
25 #include "SkTypes.h" 24 #include "SkTypes.h"
26 25
27 #if SK_SUPPORT_GPU 26 #if SK_SUPPORT_GPU
28 #include "GrContextFactory.h" 27 #include "GrContextFactory.h"
29 #include "GrContext.h" 28 #include "GrContext.h"
30 #endif 29 #endif
31 30
31 #include "image_expectations.h"
32
33
32 class SkBitmap; 34 class SkBitmap;
33 class SkCanvas; 35 class SkCanvas;
34 class SkGLContextHelper; 36 class SkGLContextHelper;
35 class SkThread; 37 class SkThread;
36 38
37 namespace sk_tools { 39 namespace sk_tools {
38 40
39 class TiledPictureRenderer; 41 class TiledPictureRenderer;
40 42
41 /**
42 * Class for collecting image results (checksums) as we go.
43 */
44 class ImageResultsSummary {
45 public:
46 /**
47 * Adds this image to the summary of results.
48 *
49 * @param sourceName name of the source file that generated this result
50 * @param fileName relative path to the image output file on local disk
51 * @param hash hash to store
52 * @param tileNumber if not NULL, ptr to tile number
53 */
54 void add(const char *sourceName, const char *fileName, uint64_t hash,
55 const int *tileNumber=NULL);
56
57 /**
58 * Adds this image to the summary of results.
59 *
60 * @param sourceName name of the source file that generated this result
61 * @param fileName relative path to the image output file on local disk
62 * @param bitmap bitmap to store the hash of
63 * @param tileNumber if not NULL, ptr to tile number
64 */
65 void add(const char *sourceName, const char *fileName, const SkBitmap& bitma p,
66 const int *tileNumber=NULL);
67
68 /**
69 * Writes the summary (as constructed so far) to a file.
70 *
71 * @param filename path to write the summary to
72 */
73 void writeToFile(const char *filename);
74
75 private:
76 Json::Value fActualResults;
77 };
78
79 class PictureRenderer : public SkRefCnt { 43 class PictureRenderer : public SkRefCnt {
80 44
81 public: 45 public:
82 enum SkDeviceTypes { 46 enum SkDeviceTypes {
83 #if SK_ANGLE 47 #if SK_ANGLE
84 kAngle_DeviceType, 48 kAngle_DeviceType,
85 #endif 49 #endif
86 #if SK_MESA 50 #if SK_MESA
87 kMesa_DeviceType, 51 kMesa_DeviceType,
88 #endif 52 #endif
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 634
671 typedef PictureRenderer INHERITED; 635 typedef PictureRenderer INHERITED;
672 }; 636 };
673 637
674 extern PictureRenderer* CreateGatherPixelRefsRenderer(); 638 extern PictureRenderer* CreateGatherPixelRefsRenderer();
675 extern PictureRenderer* CreatePictureCloneRenderer(); 639 extern PictureRenderer* CreatePictureCloneRenderer();
676 640
677 } 641 }
678 642
679 #endif // PictureRenderer_DEFINED 643 #endif // PictureRenderer_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698