| 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 "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); | 316 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); |
| 317 | 317 |
| 318 canvas->translate(0, SkIntToScalar(120)); | 318 canvas->translate(0, SkIntToScalar(120)); |
| 319 | 319 |
| 320 SkRect clip; | 320 SkRect clip; |
| 321 clip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160)); | 321 clip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160)); |
| 322 do { | 322 do { |
| 323 canvas->save(); | 323 canvas->save(); |
| 324 canvas->clipRect(clip); | 324 canvas->clipRect(clip); |
| 325 picture->draw(canvas); | 325 picture->playback(canvas); |
| 326 canvas->restore(); | 326 canvas->restore(); |
| 327 if (clip.fRight < SkIntToScalar(320)) | 327 if (clip.fRight < SkIntToScalar(320)) |
| 328 clip.offset(SkIntToScalar(160), 0); | 328 clip.offset(SkIntToScalar(160), 0); |
| 329 else if (clip.fBottom < SkIntToScalar(480)) | 329 else if (clip.fBottom < SkIntToScalar(480)) |
| 330 clip.offset(-SkIntToScalar(320), SkIntToScalar(160)); | 330 clip.offset(-SkIntToScalar(320), SkIntToScalar(160)); |
| 331 else | 331 else |
| 332 break; | 332 break; |
| 333 } while (true); | 333 } while (true); |
| 334 } | 334 } |
| 335 } | 335 } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 private: | 595 private: |
| 596 SkPoint fClickPt; | 596 SkPoint fClickPt; |
| 597 SkBitmap fBug, fTb, fTx; | 597 SkBitmap fBug, fTb, fTx; |
| 598 typedef SampleView INHERITED; | 598 typedef SampleView INHERITED; |
| 599 }; | 599 }; |
| 600 | 600 |
| 601 ////////////////////////////////////////////////////////////////////////////// | 601 ////////////////////////////////////////////////////////////////////////////// |
| 602 | 602 |
| 603 static SkView* MyFactory() { return new DemoView; } | 603 static SkView* MyFactory() { return new DemoView; } |
| 604 static SkViewRegister reg(MyFactory); | 604 static SkViewRegister reg(MyFactory); |
| OLD | NEW |