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 "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 path.close(); | 779 path.close(); |
780 REPORTER_ASSERT(reporter, !path.isConvex()); | 780 REPORTER_ASSERT(reporter, !path.isConvex()); |
781 | 781 |
782 SkPaint paint; | 782 SkPaint paint; |
783 paint.setAntiAlias(true); | 783 paint.setAntiAlias(true); |
784 for (int i = 0; i < 50; ++i) { | 784 for (int i = 0; i < 50; ++i) { |
785 canvas->drawPath(path, paint); | 785 canvas->drawPath(path, paint); |
786 } | 786 } |
787 } | 787 } |
788 picture.reset(recorder.endRecording()); | 788 picture.reset(recorder.endRecording()); |
789 // A lot of AA concave paths currently render an SkPicture undesireable for
GPU rendering | 789 // A lot of small AA concave paths should be fine for GPU rendering |
| 790 REPORTER_ASSERT(reporter, picture->suitableForGpuRasterization(NULL)); |
| 791 |
| 792 canvas = recorder.beginRecording(100, 100); |
| 793 { |
| 794 SkPath path; |
| 795 |
| 796 path.moveTo(0, 0); |
| 797 path.lineTo(0, 100); |
| 798 path.lineTo(50, 50); |
| 799 path.lineTo(100, 100); |
| 800 path.lineTo(100, 0); |
| 801 path.close(); |
| 802 REPORTER_ASSERT(reporter, !path.isConvex()); |
| 803 |
| 804 SkPaint paint; |
| 805 paint.setAntiAlias(true); |
| 806 for (int i = 0; i < 50; ++i) { |
| 807 canvas->drawPath(path, paint); |
| 808 } |
| 809 } |
| 810 picture.reset(recorder.endRecording()); |
| 811 // A lot of large AA concave paths currently render an SkPicture undesireabl
e for GPU rendering |
790 REPORTER_ASSERT(reporter, !picture->suitableForGpuRasterization(NULL)); | 812 REPORTER_ASSERT(reporter, !picture->suitableForGpuRasterization(NULL)); |
791 | 813 |
792 canvas = recorder.beginRecording(100, 100); | 814 canvas = recorder.beginRecording(100, 100); |
793 { | 815 { |
794 SkPath path; | 816 SkPath path; |
795 | 817 |
796 path.moveTo(0, 0); | 818 path.moveTo(0, 0); |
797 path.lineTo(0, 50); | 819 path.lineTo(0, 50); |
798 path.lineTo(25, 25); | 820 path.lineTo(25, 25); |
799 path.lineTo(50, 50); | 821 path.lineTo(50, 50); |
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 | 1909 |
1888 // The picture shares the immutable pixels but copies the mutable ones. | 1910 // The picture shares the immutable pixels but copies the mutable ones. |
1889 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1911 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1890 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); | 1912 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); |
1891 | 1913 |
1892 // When the picture goes away, it's just our bitmaps holding the refs. | 1914 // When the picture goes away, it's just our bitmaps holding the refs. |
1893 pic.reset(NULL); | 1915 pic.reset(NULL); |
1894 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1916 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1895 REPORTER_ASSERT(r, immut.pixelRef()->unique()); | 1917 REPORTER_ASSERT(r, immut.pixelRef()->unique()); |
1896 } | 1918 } |
OLD | NEW |