OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "SampleCode.h" | 7 #include "SampleCode.h" |
8 #include "Sk1DPathEffect.h" | 8 #include "Sk1DPathEffect.h" |
9 #include "Sk2DPathEffect.h" | 9 #include "Sk2DPathEffect.h" |
10 #include "SkAlphaThresholdFilter.h" | 10 #include "SkAlphaThresholdFilter.h" |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 case 2: | 792 case 2: |
793 *p = 0x00; // Set all bits to 0 | 793 *p = 0x00; // Set all bits to 0 |
794 break; | 794 break; |
795 } | 795 } |
796 } else { | 796 } else { |
797 *p ^= (1 << R(8)); | 797 *p ^= (1 << R(8)); |
798 } | 798 } |
799 } | 799 } |
800 } | 800 } |
801 #endif // SK_ADD_RANDOM_BIT_FLIPS | 801 #endif // SK_ADD_RANDOM_BIT_FLIPS |
802 SkFlattenable* flattenable = SkValidatingDeserializeFlattenable(ptr, len); | 802 SkFlattenable* flattenable = SkValidatingDeserializeFlattenable(ptr, len, |
| 803 SkImageFilter::GetFlattenableType()); |
803 return static_cast<SkImageFilter*>(flattenable); | 804 return static_cast<SkImageFilter*>(flattenable); |
804 } | 805 } |
805 | 806 |
806 static void drawClippedBitmap(SkCanvas* canvas, int x, int y, const SkPaint& pai
nt) { | 807 static void drawClippedBitmap(SkCanvas* canvas, int x, int y, const SkPaint& pai
nt) { |
807 canvas->save(); | 808 canvas->save(); |
808 canvas->clipRect(SkRect::MakeXYWH(SkIntToScalar(x), SkIntToScalar(y), | 809 canvas->clipRect(SkRect::MakeXYWH(SkIntToScalar(x), SkIntToScalar(y), |
809 SkIntToScalar(kBitmapSize), SkIntToScalar(kBitmapSize))); | 810 SkIntToScalar(kBitmapSize), SkIntToScalar(kBitmapSize))); |
810 canvas->drawBitmap(make_bitmap(), SkIntToScalar(x), SkIntToScalar(y), &paint
); | 811 canvas->drawBitmap(make_bitmap(), SkIntToScalar(x), SkIntToScalar(y), &paint
); |
811 canvas->restore(); | 812 canvas->restore(); |
812 } | 813 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 } | 862 } |
862 | 863 |
863 private: | 864 private: |
864 typedef SkView INHERITED; | 865 typedef SkView INHERITED; |
865 }; | 866 }; |
866 | 867 |
867 ////////////////////////////////////////////////////////////////////////////// | 868 ////////////////////////////////////////////////////////////////////////////// |
868 | 869 |
869 static SkView* MyFactory() { return new ImageFilterFuzzView; } | 870 static SkView* MyFactory() { return new ImageFilterFuzzView; } |
870 static SkViewRegister reg(MyFactory); | 871 static SkViewRegister reg(MyFactory); |
OLD | NEW |