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

Side by Side Diff: samplecode/SampleColorFilter.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/SampleApp.cpp ('k') | samplecode/SampleFatBits.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 "sk_tool_utils.h" 7 #include "sk_tool_utils.h"
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 r.set(0, 0, SkIntToScalar(n), SkIntToScalar(n)); 93 r.set(0, 0, SkIntToScalar(n), SkIntToScalar(n));
94 r.inset(SK_Scalar1, SK_Scalar1); 94 r.inset(SK_Scalar1, SK_Scalar1);
95 95
96 SkPaint paint; 96 SkPaint paint;
97 paint.setAntiAlias(true); 97 paint.setAntiAlias(true);
98 98
99 paint.setColor(SK_ColorRED); 99 paint.setColor(SK_ColorRED);
100 canvas.drawOval(r, paint); 100 canvas.drawOval(r, paint);
101 101
102 r.inset(SK_Scalar1*n/4, SK_Scalar1*n/4); 102 r.inset(SK_Scalar1*n/4, SK_Scalar1*n/4);
103 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 103 paint.setBlendMode(SkBlendMode::kSrc);
104 paint.setColor(0x800000FF); 104 paint.setColor(0x800000FF);
105 canvas.drawOval(r, paint); 105 canvas.drawOval(r, paint);
106 106
107 return bitmap; 107 return bitmap;
108 } 108 }
109 109
110 class ColorFilterView : public SampleView { 110 class ColorFilterView : public SampleView {
111 SkBitmap fBitmap; 111 SkBitmap fBitmap;
112 sk_sp<SkShader> fShader; 112 sk_sp<SkShader> fShader;
113 enum { 113 enum {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 191
192 private: 192 private:
193 typedef SampleView INHERITED; 193 typedef SampleView INHERITED;
194 }; 194 };
195 195
196 ////////////////////////////////////////////////////////////////////////////// 196 //////////////////////////////////////////////////////////////////////////////
197 197
198 static SkView* MyFactory() { return new ColorFilterView; } 198 static SkView* MyFactory() { return new ColorFilterView; }
199 static SkViewRegister reg(MyFactory); 199 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleFatBits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698