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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 return true; | 84 return true; |
85 } | 85 } |
86 return this->INHERITED::onQuery(evt); | 86 return this->INHERITED::onQuery(evt); |
87 } | 87 } |
88 | 88 |
89 SkScalar fScale; | 89 SkScalar fScale; |
90 | 90 |
91 virtual void onDrawContent(SkCanvas* canvas) { | 91 virtual void onDrawContent(SkCanvas* canvas) { |
92 SkPaint paint; | 92 SkPaint paint; |
93 paint.setDither(true); | 93 paint.setDither(true); |
94 paint.setFilterBitmap(true); | 94 paint.setFilterLevel(SkPaint::kLow_FilterLevel); |
95 | 95 |
96 for (size_t i = 0; i < SK_ARRAY_COUNT(fRecs); i++) { | 96 for (size_t i = 0; i < SK_ARRAY_COUNT(fRecs); i++) { |
97 canvas->save(); | 97 canvas->save(); |
98 | 98 |
99 paint.setShader(NULL); | 99 paint.setShader(NULL); |
100 canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount, | 100 canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount, |
101 fRecs[i].fVerts, fRecs[i].fTexs, | 101 fRecs[i].fVerts, fRecs[i].fTexs, |
102 NULL, NULL, NULL, 0, paint); | 102 NULL, NULL, NULL, 0, paint); |
103 | 103 |
104 canvas->translate(SkIntToScalar(250), 0); | 104 canvas->translate(SkIntToScalar(250), 0); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 Rec fRecs[3]; | 225 Rec fRecs[3]; |
226 | 226 |
227 typedef SampleView INHERITED; | 227 typedef SampleView INHERITED; |
228 }; | 228 }; |
229 | 229 |
230 ////////////////////////////////////////////////////////////////////////////// | 230 ////////////////////////////////////////////////////////////////////////////// |
231 | 231 |
232 static SkView* MyFactory() { return new VerticesView; } | 232 static SkView* MyFactory() { return new VerticesView; } |
233 static SkViewRegister reg(MyFactory); | 233 static SkViewRegister reg(MyFactory); |
OLD | NEW |