| 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 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
| 9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 SkAutoTUnref<SkDashPathEffect> dash(SkDashPathEffect::Create(intervals,
2, 0)); | 723 SkAutoTUnref<SkDashPathEffect> dash(SkDashPathEffect::Create(intervals,
2, 0)); |
| 724 | 724 |
| 725 SkPaint paint; | 725 SkPaint paint; |
| 726 paint.setStyle(SkPaint::kStroke_Style); | 726 paint.setStyle(SkPaint::kStroke_Style); |
| 727 paint.setPathEffect(dash); | 727 paint.setPathEffect(dash); |
| 728 | 728 |
| 729 canvas->drawPath(path, paint); | 729 canvas->drawPath(path, paint); |
| 730 } | 730 } |
| 731 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); | 731 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); |
| 732 // path effects currently render an SkPicture undesireable for GPU rendering | 732 // path effects currently render an SkPicture undesireable for GPU rendering |
| 733 REPORTER_ASSERT(reporter, !picture->suitableForGpuRasterization(NULL)); | 733 |
| 734 const char *reason = NULL; |
| 735 REPORTER_ASSERT(reporter, !picture->suitableForGpuRasterization(NULL, &reaso
n)); |
| 736 REPORTER_ASSERT(reporter, NULL != reason); |
| 734 | 737 |
| 735 canvas = recorder.beginRecording(100, 100, NULL, 0); | 738 canvas = recorder.beginRecording(100, 100, NULL, 0); |
| 736 { | 739 { |
| 737 SkPath path; | 740 SkPath path; |
| 738 | 741 |
| 739 path.moveTo(0, 0); | 742 path.moveTo(0, 0); |
| 740 path.lineTo(0, 50); | 743 path.lineTo(0, 50); |
| 741 path.lineTo(25, 25); | 744 path.lineTo(25, 25); |
| 742 path.lineTo(50, 50); | 745 path.lineTo(50, 50); |
| 743 path.lineTo(50, 0); | 746 path.lineTo(50, 0); |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1626 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); | 1629 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); |
| 1627 } | 1630 } |
| 1628 | 1631 |
| 1629 DEF_TEST(Canvas_EmptyBitmap, r) { | 1632 DEF_TEST(Canvas_EmptyBitmap, r) { |
| 1630 SkBitmap dst; | 1633 SkBitmap dst; |
| 1631 dst.allocN32Pixels(10, 10); | 1634 dst.allocN32Pixels(10, 10); |
| 1632 SkCanvas canvas(dst); | 1635 SkCanvas canvas(dst); |
| 1633 | 1636 |
| 1634 test_draw_bitmaps(&canvas); | 1637 test_draw_bitmaps(&canvas); |
| 1635 } | 1638 } |
| OLD | NEW |