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

Side by Side Diff: samplecode/SampleRepeatTile.cpp

Issue 169063002: use SkColorType instead of SkBitmap::Config in samplecode (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « samplecode/SampleRegion.cpp ('k') | samplecode/SampleRotateCircles.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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkShader.h" 11 #include "SkShader.h"
12 #include "SkKey.h" 12 #include "SkKey.h"
13 13
14 static void make_bitmap(SkBitmap* bm) { 14 static void make_bitmap(SkBitmap* bm) {
15 const int W = 100; 15 const int W = 100;
16 const int H = 100; 16 const int H = 100;
17 bm->setConfig(SkBitmap::kARGB_8888_Config, W, H); 17 bm->allocN32Pixels(W, H);
18 bm->allocPixels();
19 18
20 SkPaint paint; 19 SkPaint paint;
21 SkCanvas canvas(*bm); 20 SkCanvas canvas(*bm);
22 canvas.drawColor(SK_ColorWHITE); 21 canvas.drawColor(SK_ColorWHITE);
23 22
24 const SkColor colors[] = { 23 const SkColor colors[] = {
25 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE 24 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE
26 }; 25 };
27 26
28 for (int ix = 0; ix < W; ix += 1) { 27 for (int ix = 0; ix < W; ix += 1) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 82 }
84 83
85 private: 84 private:
86 typedef SampleView INHERITED; 85 typedef SampleView INHERITED;
87 }; 86 };
88 87
89 ////////////////////////////////////////////////////////////////////////////// 88 //////////////////////////////////////////////////////////////////////////////
90 89
91 static SkView* MyFactory() { return new RepeatTileView; } 90 static SkView* MyFactory() { return new RepeatTileView; }
92 static SkViewRegister reg(MyFactory); 91 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleRegion.cpp ('k') | samplecode/SampleRotateCircles.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698