Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 1853383002: Revert of Delete SkFlattenable::Type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkXfermode.h ('k') | src/core/SkFlattenable.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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);
OLDNEW
« no previous file with comments | « include/core/SkXfermode.h ('k') | src/core/SkFlattenable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698