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

Side by Side Diff: samplecode/SampleColorFilter.cpp

Issue 1827433002: Reland of [2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/SampleAll.cpp ('k') | samplecode/SampleFilterFuzz.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SampleCode.h" 9 #include "SampleCode.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 0x8000FF00, 177 0x8000FF00,
178 0x00000000, 178 0x00000000,
179 }; 179 };
180 180
181 float scale = 1.5f; 181 float scale = 1.5f;
182 SkPaint paint; 182 SkPaint paint;
183 canvas->translate(N / 8, N / 8); 183 canvas->translate(N / 8, N / 8);
184 184
185 for (size_t y = 0; y < SK_ARRAY_COUNT(gColors); y++) { 185 for (size_t y = 0; y < SK_ARRAY_COUNT(gColors); y++) {
186 for (size_t x = 0; x < SK_ARRAY_COUNT(gModes); x++) { 186 for (size_t x = 0; x < SK_ARRAY_COUNT(gModes); x++) {
187 SkColorFilter* cf = SkColorFilter::CreateModeFilter(gColors[y], gModes[x]); 187 paint.setColorFilter(SkColorFilter::MakeModeFilter(gColors[y], g Modes[x]));
188 SkSafeUnref(paint.setColorFilter(cf));
189 canvas->drawBitmap(fBitmap, x * N * 1.25f, y * N * scale, &paint ); 188 canvas->drawBitmap(fBitmap, x * N * 1.25f, y * N * scale, &paint );
190 } 189 }
191 } 190 }
192 191
193 } 192 }
194 193
195 private: 194 private:
196 typedef SampleView INHERITED; 195 typedef SampleView INHERITED;
197 }; 196 };
198 197
199 ////////////////////////////////////////////////////////////////////////////// 198 //////////////////////////////////////////////////////////////////////////////
200 199
201 static SkView* MyFactory() { return new ColorFilterView; } 200 static SkView* MyFactory() { return new ColorFilterView; }
202 static SkViewRegister reg(MyFactory); 201 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleAll.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698