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

Side by Side Diff: gm/modecolorfilters.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 | « gm/lumafilter.cpp ('k') | gm/picture.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 2012 Google Inc. 2 * Copyright 2012 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 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 constexpr int kRectWidth = 20; 71 constexpr int kRectWidth = 20;
72 constexpr int kRectHeight = 20; 72 constexpr int kRectHeight = 20;
73 73
74 constexpr int kCheckSize = 10; 74 constexpr int kCheckSize = 10;
75 75
76 if (!fBmpShader) { 76 if (!fBmpShader) {
77 fBmpShader = make_bg_shader(kCheckSize); 77 fBmpShader = make_bg_shader(kCheckSize);
78 } 78 }
79 SkPaint bgPaint; 79 SkPaint bgPaint;
80 bgPaint.setShader(fBmpShader); 80 bgPaint.setShader(fBmpShader);
81 bgPaint.setXfermodeMode(SkXfermode::kSrc_Mode); 81 bgPaint.setBlendMode(SkBlendMode::kSrc);
82 82
83 sk_sp<SkShader> shaders[] = { 83 sk_sp<SkShader> shaders[] = {
84 nullptr, // use a paint color inst ead of a shader 84 nullptr, // use a paint color inst ead of a shader
85 make_solid_shader(), 85 make_solid_shader(),
86 make_transparent_shader(), 86 make_transparent_shader(),
87 make_trans_black_shader(), 87 make_trans_black_shader(),
88 }; 88 };
89 89
90 // used without shader 90 // used without shader
91 SkColor colors[] = { 91 SkColor colors[] = {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 sk_sp<SkShader> fBmpShader; 149 sk_sp<SkShader> fBmpShader;
150 typedef GM INHERITED; 150 typedef GM INHERITED;
151 }; 151 };
152 152
153 ////////////////////////////////////////////////////////////////////////////// 153 //////////////////////////////////////////////////////////////////////////////
154 154
155 static GM* MyFactory(void*) { return new ModeColorFilterGM; } 155 static GM* MyFactory(void*) { return new ModeColorFilterGM; }
156 static GMRegistry reg(MyFactory); 156 static GMRegistry reg(MyFactory);
157 157
158 } 158 }
OLDNEW
« no previous file with comments | « gm/lumafilter.cpp ('k') | gm/picture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698