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

Side by Side Diff: samplecode/SampleTextureDomain.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/SampleTextAlpha.cpp ('k') | samplecode/SampleTiling.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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkSurface.h" 12 #include "SkSurface.h"
13 13
14 static SkBitmap make_bitmap() { 14 static SkBitmap make_bitmap() {
15 SkBitmap bm; 15 SkBitmap bm;
16 bm.setConfig(SkBitmap::kARGB_8888_Config , 5, 5); 16 bm.allocN32Pixels(5, 5);
17 bm.allocPixels();
18 17
19 for (int y = 0; y < bm.height(); y++) { 18 for (int y = 0; y < bm.height(); y++) {
20 uint32_t* p = bm.getAddr32(0, y); 19 uint32_t* p = bm.getAddr32(0, y);
21 for (int x = 0; x < bm.width(); x++) { 20 for (int x = 0; x < bm.width(); x++) {
22 p[x] = ((x + y) & 1) ? SK_ColorWHITE : SK_ColorBLACK; 21 p[x] = ((x + y) & 1) ? SK_ColorWHITE : SK_ColorBLACK;
23 } 22 }
24 } 23 }
25 bm.unlockPixels(); 24 bm.unlockPixels();
26 return bm; 25 return bm;
27 } 26 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 canvas->drawBitmapRectToRect(fBM, NULL, dstRect, &paint); 101 canvas->drawBitmapRectToRect(fBM, NULL, dstRect, &paint);
103 } 102 }
104 private: 103 private:
105 typedef SkView INHERITED; 104 typedef SkView INHERITED;
106 }; 105 };
107 106
108 ////////////////////////////////////////////////////////////////////////////// 107 //////////////////////////////////////////////////////////////////////////////
109 108
110 static SkView* MyFactory() { return new TextureDomainView; } 109 static SkView* MyFactory() { return new TextureDomainView; }
111 static SkViewRegister reg(MyFactory); 110 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleTextAlpha.cpp ('k') | samplecode/SampleTiling.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698