| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 #ifdef SK_DEVELOPER | 158 #ifdef SK_DEVELOPER |
| 159 if (false) { | 159 if (false) { |
| 160 SkDebugfDumper dumper; | 160 SkDebugfDumper dumper; |
| 161 SkDumpCanvas dumpCanvas(&dumper); | 161 SkDumpCanvas dumpCanvas(&dumper); |
| 162 dumpCanvas.drawPicture(*pict); | 162 dumpCanvas.drawPicture(*pict); |
| 163 } | 163 } |
| 164 #endif | 164 #endif |
| 165 | 165 |
| 166 // test that we can re-record a subpicture, and see the results | 166 // test that we can re-record a subpicture, and see the results |
| 167 | 167 |
| 168 SkMWCRandom rand(SampleCode::GetAnimTime()); | 168 SkRandom rand(SampleCode::GetAnimTime()); |
| 169 canvas->translate(SkIntToScalar(10), SkIntToScalar(250)); | 169 canvas->translate(SkIntToScalar(10), SkIntToScalar(250)); |
| 170 drawCircle(fSubPicture->beginRecording(50, 50), 25, | 170 drawCircle(fSubPicture->beginRecording(50, 50), 25, |
| 171 rand.nextU() | 0xFF000000); | 171 rand.nextU() | 0xFF000000); |
| 172 canvas->drawPicture(*fPicture); | 172 canvas->drawPicture(*fPicture); |
| 173 delayInval(500); | 173 delayInval(500); |
| 174 } | 174 } |
| 175 | 175 |
| 176 private: | 176 private: |
| 177 #define INVAL_ALL_TYPE "inval-all" | 177 #define INVAL_ALL_TYPE "inval-all" |
| 178 | 178 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 191 SkPicture* fPicture; | 191 SkPicture* fPicture; |
| 192 SkPicture* fSubPicture; | 192 SkPicture* fSubPicture; |
| 193 | 193 |
| 194 typedef SampleView INHERITED; | 194 typedef SampleView INHERITED; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 ////////////////////////////////////////////////////////////////////////////// | 197 ////////////////////////////////////////////////////////////////////////////// |
| 198 | 198 |
| 199 static SkView* MyFactory() { return new PictureView; } | 199 static SkView* MyFactory() { return new PictureView; } |
| 200 static SkViewRegister reg(MyFactory); | 200 static SkViewRegister reg(MyFactory); |
| OLD | NEW |