OLD | NEW |
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 |
32 class SkBitmap; | 33 class SkBitmap; |
33 class SkCanvas; | 34 class SkCanvas; |
34 class SkGLContextHelper; | 35 class SkGLContextHelper; |
35 class SkThread; | 36 class SkThread; |
36 | 37 |
37 namespace sk_tools { | 38 namespace sk_tools { |
38 | 39 |
39 class TiledPictureRenderer; | 40 class TiledPictureRenderer; |
40 | 41 |
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 { | 42 class PictureRenderer : public SkRefCnt { |
80 | 43 |
81 public: | 44 public: |
82 enum SkDeviceTypes { | 45 enum SkDeviceTypes { |
83 #if SK_ANGLE | 46 #if SK_ANGLE |
84 kAngle_DeviceType, | 47 kAngle_DeviceType, |
85 #endif | 48 #endif |
86 #if SK_MESA | 49 #if SK_MESA |
87 kMesa_DeviceType, | 50 kMesa_DeviceType, |
88 #endif | 51 #endif |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 | 633 |
671 typedef PictureRenderer INHERITED; | 634 typedef PictureRenderer INHERITED; |
672 }; | 635 }; |
673 | 636 |
674 extern PictureRenderer* CreateGatherPixelRefsRenderer(); | 637 extern PictureRenderer* CreateGatherPixelRefsRenderer(); |
675 extern PictureRenderer* CreatePictureCloneRenderer(); | 638 extern PictureRenderer* CreatePictureCloneRenderer(); |
676 | 639 |
677 } | 640 } |
678 | 641 |
679 #endif // PictureRenderer_DEFINED | 642 #endif // PictureRenderer_DEFINED |
OLD | NEW |