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

Side by Side Diff: samplecode/SampleHairline.cpp

Issue 300263005: Revert "Revert of add colortable support to imagegenerator (https://codereview.chromium.org/3044430… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 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 | « include/core/SkImageGenerator.h ('k') | samplecode/SampleXfermodesBlur.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 7
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (false) { // avoid bit rot, suppress warning 223 if (false) { // avoid bit rot, suppress warning
224 test_chromium_9005(); 224 test_chromium_9005();
225 } 225 }
226 226
227 SkBitmap bm, bm2; 227 SkBitmap bm, bm2;
228 bm.allocN32Pixels(WIDTH + MARGIN*2, HEIGHT + MARGIN*2); 228 bm.allocN32Pixels(WIDTH + MARGIN*2, HEIGHT + MARGIN*2);
229 // this will erase our margin, which we want to always stay 0 229 // this will erase our margin, which we want to always stay 0
230 bm.eraseColor(SK_ColorTRANSPARENT); 230 bm.eraseColor(SK_ColorTRANSPARENT);
231 231
232 bm2.installPixels(SkImageInfo::MakeN32Premul(WIDTH, HEIGHT), 232 bm2.installPixels(SkImageInfo::MakeN32Premul(WIDTH, HEIGHT),
233 bm.getAddr32(MARGIN, MARGIN), bm.rowBytes(), 233 bm.getAddr32(MARGIN, MARGIN), bm.rowBytes());
234 NULL, NULL);
235 234
236 SkCanvas c2(bm2); 235 SkCanvas c2(bm2);
237 SkPaint paint; 236 SkPaint paint;
238 paint.setAntiAlias(fDoAA); 237 paint.setAntiAlias(fDoAA);
239 paint.setStyle(SkPaint::kStroke_Style); 238 paint.setStyle(SkPaint::kStroke_Style);
240 239
241 bm2.eraseColor(SK_ColorTRANSPARENT); 240 bm2.eraseColor(SK_ColorTRANSPARENT);
242 gProcs[fProcIndex].fProc(&c2, paint, bm); 241 gProcs[fProcIndex].fProc(&c2, paint, bm);
243 canvas->drawBitmap(bm2, SkIntToScalar(10), SkIntToScalar(10), NULL); 242 canvas->drawBitmap(bm2, SkIntToScalar(10), SkIntToScalar(10), NULL);
244 243
(...skipping 20 matching lines...) Expand all
265 264
266 265
267 private: 266 private:
268 typedef SampleView INHERITED; 267 typedef SampleView INHERITED;
269 }; 268 };
270 269
271 ////////////////////////////////////////////////////////////////////////////// 270 //////////////////////////////////////////////////////////////////////////////
272 271
273 static SkView* MyFactory() { return new HairlineView; } 272 static SkView* MyFactory() { return new HairlineView; }
274 static SkViewRegister reg(MyFactory); 273 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/core/SkImageGenerator.h ('k') | samplecode/SampleXfermodesBlur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698