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

Side by Side Diff: samplecode/SampleFilter2.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/SampleFilter.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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 s.appendS32(paint.getFilterLevel() != SkPaint::kNone_Fil terLevel); 96 s.appendS32(paint.getFilterLevel() != SkPaint::kNone_Fil terLevel);
97 canvas->drawText(s.c_str(), s.size(), x + W/2, 97 canvas->drawText(s.c_str(), s.size(), x + W/2,
98 y - p.getTextSize(), p); 98 y - p.getTextSize(), p);
99 } 99 }
100 if (k+j == 2) { 100 if (k+j == 2) {
101 SkPaint p; 101 SkPaint p;
102 p.setAntiAlias(true); 102 p.setAntiAlias(true);
103 p.setTextSize(SkIntToScalar(18)); 103 p.setTextSize(SkIntToScalar(18));
104 SkString s; 104 SkString s;
105 s.append(" depth="); 105 s.append(" depth=");
106 s.appendS32(fBitmaps[i].config() == SkBitmap::kRGB_565_C onfig ? 16 : 32); 106 s.appendS32(fBitmaps[i].colorType() == kRGB_565_SkColorT ype ? 16 : 32);
107 canvas->drawText(s.c_str(), s.size(), x + W + SkIntToSca lar(4), 107 canvas->drawText(s.c_str(), s.size(), x + W + SkIntToSca lar(4),
108 y + H/2, p); 108 y + H/2, p);
109 } 109 }
110 } 110 }
111 } 111 }
112 } 112 }
113 } 113 }
114 114
115 private: 115 private:
116 typedef SampleView INHERITED; 116 typedef SampleView INHERITED;
117 }; 117 };
118 118
119 ////////////////////////////////////////////////////////////////////////////// 119 //////////////////////////////////////////////////////////////////////////////
120 120
121 static SkView* MyFactory() { return new Filter2View; } 121 static SkView* MyFactory() { return new Filter2View; }
122 static SkViewRegister reg(MyFactory); 122 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFilter.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698