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

Side by Side Diff: samplecode/SampleFuzz.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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 | « samplecode/SampleFilterFuzz.cpp ('k') | samplecode/SampleHairModes.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 2011 Google Inc. 2 * Copyright 2011 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 "SkView.h" 8 #include "SkView.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 case 0: 147 case 0:
148 paint.setColor(make_fill()); 148 paint.setColor(make_fill());
149 break; 149 break;
150 150
151 case 1: 151 case 1:
152 paint.setAlpha(gRand.nextU() & 0xFF); 152 paint.setAlpha(gRand.nextU() & 0xFF);
153 break; 153 break;
154 154
155 case 2: { 155 case 2: {
156 SkXfermode::Mode mode; 156 SkBlendMode mode;
157 switch (R(3)) { 157 switch (R(3)) {
158 case 0: mode = SkXfermode::kSrc_Mode; break; 158 case 0: mode = SkBlendMode::kSrc; break;
159 case 1: mode = SkXfermode::kXor_Mode; break; 159 case 1: mode = SkBlendMode::kXor; break;
160 case 2: 160 case 2:
161 default: // silence warning 161 default: // silence warning
162 mode = SkXfermode::kSrcOver_Mode; break; 162 mode = SkBlendMode::kSrcOver; break;
163 } 163 }
164 paint.setXfermodeMode(mode); 164 paint.setBlendMode(mode);
165 } 165 }
166 break; 166 break;
167 167
168 case 3: 168 case 3:
169 switch (R(2)) { 169 switch (R(2)) {
170 case 0: paint.setStrokeCap(SkPaint::kRound_Cap); break; 170 case 0: paint.setStrokeCap(SkPaint::kRound_Cap); break;
171 case 1: paint.setStrokeCap(SkPaint::kButt_Cap); break; 171 case 1: paint.setStrokeCap(SkPaint::kButt_Cap); break;
172 } 172 }
173 break; 173 break;
174 174
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 385 }
386 386
387 private: 387 private:
388 typedef SkView INHERITED; 388 typedef SkView INHERITED;
389 }; 389 };
390 390
391 ////////////////////////////////////////////////////////////////////////////// 391 //////////////////////////////////////////////////////////////////////////////
392 392
393 static SkView* MyFactory() { return new FuzzView; } 393 static SkView* MyFactory() { return new FuzzView; }
394 static SkViewRegister reg(MyFactory); 394 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | samplecode/SampleHairModes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698