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

Side by Side Diff: samplecode/SampleTextAlpha.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/SampleText.cpp ('k') | samplecode/SampleTextureDomain.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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 11 matching lines...) Expand all
22 #include "SkColorPriv.h" 22 #include "SkColorPriv.h"
23 #include "SkColorFilter.h" 23 #include "SkColorFilter.h"
24 #include "SkTime.h" 24 #include "SkTime.h"
25 #include "SkTypeface.h" 25 #include "SkTypeface.h"
26 #include "SkView.h" 26 #include "SkView.h"
27 27
28 #include "SkOSFile.h" 28 #include "SkOSFile.h"
29 #include "SkStream.h" 29 #include "SkStream.h"
30 30
31 static void check_for_nonwhite(const SkBitmap& bm, int alpha) { 31 static void check_for_nonwhite(const SkBitmap& bm, int alpha) {
32 if (bm.config() != SkBitmap::kRGB_565_Config) { 32 if (bm.colorType() != kRGB_565_SkColorType) {
33 return; 33 return;
34 } 34 }
35 35
36 for (int y = 0; y < bm.height(); y++) { 36 for (int y = 0; y < bm.height(); y++) {
37 for (int x = 0; x < bm.width(); x++) { 37 for (int x = 0; x < bm.width(); x++) {
38 uint16_t c = *bm.getAddr16(x, y); 38 uint16_t c = *bm.getAddr16(x, y);
39 if (c != 0xFFFF) { 39 if (c != 0xFFFF) {
40 SkDebugf("------ nonwhite alpha=%x [%d %d] %x\n", alpha, x, y, c ); 40 SkDebugf("------ nonwhite alpha=%x [%d %d] %x\n", alpha, x, y, c );
41 return; 41 return;
42 } 42 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 private: 114 private:
115 int fByte; 115 int fByte;
116 116
117 typedef SampleView INHERITED; 117 typedef SampleView INHERITED;
118 }; 118 };
119 119
120 ////////////////////////////////////////////////////////////////////////////// 120 //////////////////////////////////////////////////////////////////////////////
121 121
122 static SkView* MyFactory() { return new TextAlphaView; } 122 static SkView* MyFactory() { return new TextAlphaView; }
123 static SkViewRegister reg(MyFactory); 123 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleText.cpp ('k') | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698