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