OLD | NEW |
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 Loading... |
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); |
OLD | NEW |