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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 virtual void onDrawContent(SkCanvas* canvas) { | 303 virtual void onDrawContent(SkCanvas* canvas) { |
304 canvas->save(); | 304 canvas->save(); |
305 this->drawPicture(canvas, 0); | 305 this->drawPicture(canvas, 0); |
306 canvas->restore(); | 306 canvas->restore(); |
307 | 307 |
308 { | 308 { |
309 SkPictureRecorder recorder; | 309 SkPictureRecorder recorder; |
310 { | 310 { |
311 SkCanvas* record = recorder.beginRecording(320, 480); | 311 SkCanvas* record = recorder.beginRecording(320, 480, NULL, 0); |
312 this->drawPicture(record, 120); | 312 this->drawPicture(record, 120); |
313 } | 313 } |
314 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); | 314 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); |
315 | 315 |
316 canvas->translate(0, SkIntToScalar(120)); | 316 canvas->translate(0, SkIntToScalar(120)); |
317 | 317 |
318 SkRect clip; | 318 SkRect clip; |
319 clip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160)); | 319 clip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160)); |
320 do { | 320 do { |
321 canvas->save(); | 321 canvas->save(); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 private: | 646 private: |
647 SkPoint fClickPt; | 647 SkPoint fClickPt; |
648 SkBitmap fBug, fTb, fTx; | 648 SkBitmap fBug, fTb, fTx; |
649 typedef SampleView INHERITED; | 649 typedef SampleView INHERITED; |
650 }; | 650 }; |
651 | 651 |
652 ////////////////////////////////////////////////////////////////////////////// | 652 ////////////////////////////////////////////////////////////////////////////// |
653 | 653 |
654 static SkView* MyFactory() { return new DemoView; } | 654 static SkView* MyFactory() { return new DemoView; } |
655 static SkViewRegister reg(MyFactory); | 655 static SkViewRegister reg(MyFactory); |
OLD | NEW |