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

Side by Side Diff: gm/imagefilterstransformed.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/imagefiltersgraph.cpp ('k') | gm/lcdblendmodes.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 2015 Google Inc. 2 * Copyright 2015 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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 #include "SkXfermodeImageFilter.h" 120 #include "SkXfermodeImageFilter.h"
121 121
122 DEF_SIMPLE_GM(rotate_imagefilter, canvas, 500, 500) { 122 DEF_SIMPLE_GM(rotate_imagefilter, canvas, 500, 500) {
123 SkPaint paint; 123 SkPaint paint;
124 124
125 const SkRect r = SkRect::MakeXYWH(50, 50, 100, 100); 125 const SkRect r = SkRect::MakeXYWH(50, 50, 100, 100);
126 126
127 sk_sp<SkImageFilter> filters[] = { 127 sk_sp<SkImageFilter> filters[] = {
128 nullptr, 128 nullptr,
129 SkBlurImageFilter::Make(6, 0, nullptr), 129 SkBlurImageFilter::Make(6, 0, nullptr),
130 SkXfermodeImageFilter::Make(SkXfermode::Make(SkXfermode::kSrcOver_Mode), nullptr), 130 SkXfermodeImageFilter::Make(SkBlendMode::kSrcOver, nullptr),
131 }; 131 };
132 132
133 for (auto& filter : filters) { 133 for (auto& filter : filters) {
134 paint.setAntiAlias(false); 134 paint.setAntiAlias(false);
135 paint.setImageFilter(filter); 135 paint.setImageFilter(filter);
136 136
137 canvas->save(); 137 canvas->save();
138 138
139 canvas->drawRect(r, paint); 139 canvas->drawRect(r, paint);
140 140
141 canvas->translate(150, 0); 141 canvas->translate(150, 0);
142 canvas->save(); 142 canvas->save();
143 canvas->rotate(30, 100, 100); 143 canvas->rotate(30, 100, 100);
144 canvas->drawRect(r, paint); 144 canvas->drawRect(r, paint);
145 canvas->restore(); 145 canvas->restore();
146 146
147 paint.setAntiAlias(true); 147 paint.setAntiAlias(true);
148 canvas->translate(150, 0); 148 canvas->translate(150, 0);
149 canvas->save(); 149 canvas->save();
150 canvas->rotate(30, 100, 100); 150 canvas->rotate(30, 100, 100);
151 canvas->drawRect(r, paint); 151 canvas->drawRect(r, paint);
152 canvas->restore(); 152 canvas->restore();
153 153
154 canvas->restore(); 154 canvas->restore();
155 canvas->translate(0, 150); 155 canvas->translate(0, 150);
156 } 156 }
157 } 157 }
OLDNEW
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | gm/lcdblendmodes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698