OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkDumpCanvas.h" | 9 #include "SkDumpCanvas.h" |
10 #include "SkView.h" | 10 #include "SkView.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 | 93 |
94 private: | 94 private: |
95 enum BBoxType { | 95 enum BBoxType { |
96 kNo_BBoxType, | 96 kNo_BBoxType, |
97 kRTree_BBoxType, | 97 kRTree_BBoxType, |
98 kTileGrid_BBoxType, | 98 kTileGrid_BBoxType, |
99 | 99 |
100 kLast_BBoxType = kTileGrid_BBoxType | 100 kLast_BBoxType = kTileGrid_BBoxType |
101 }; | 101 }; |
102 static const unsigned kBBoxTypeCount = kLast_BBoxType + 1; | 102 static const int kBBoxTypeCount = kLast_BBoxType + 1; |
103 | 103 |
104 SkString fFilename; | 104 SkString fFilename; |
105 SkPicture* fPictures[kBBoxTypeCount]; | 105 SkPicture* fPictures[kBBoxTypeCount]; |
106 BBoxType fBBox; | 106 BBoxType fBBox; |
107 SkSize fTileSize; | 107 SkSize fTileSize; |
108 | 108 |
109 SkPicture* LoadPicture(const char path[], BBoxType bbox) { | 109 SkPicture* LoadPicture(const char path[], BBoxType bbox) { |
110 SkPicture* pic = NULL; | 110 SkPicture* pic = NULL; |
111 | 111 |
112 SkBitmap bm; | 112 SkBitmap bm; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 SampleView* CreateSamplePictFileView(const char filename[]) { | 183 SampleView* CreateSamplePictFileView(const char filename[]) { |
184 return new PictFileView(filename); | 184 return new PictFileView(filename); |
185 } | 185 } |
186 | 186 |
187 ////////////////////////////////////////////////////////////////////////////// | 187 ////////////////////////////////////////////////////////////////////////////// |
188 | 188 |
189 #if 0 | 189 #if 0 |
190 static SkView* MyFactory() { return new PictFileView; } | 190 static SkView* MyFactory() { return new PictFileView; } |
191 static SkViewRegister reg(MyFactory); | 191 static SkViewRegister reg(MyFactory); |
192 #endif | 192 #endif |
OLD | NEW |