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 "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 int fCount; | 343 int fCount; |
344 SkPoint* fVerts; | 344 SkPoint* fVerts; |
345 SkPoint* fTexs; | 345 SkPoint* fTexs; |
346 | 346 |
347 Rec() : fCount(0), fVerts(NULL), fTexs(NULL) {} | 347 Rec() : fCount(0), fVerts(NULL), fTexs(NULL) {} |
348 ~Rec() { delete[] fVerts; delete[] fTexs; } | 348 ~Rec() { delete[] fVerts; delete[] fTexs; } |
349 }; | 349 }; |
350 | 350 |
351 static void make_tris(Rec* rec) { | 351 static void make_tris(Rec* rec) { |
352 int n = 10; | 352 int n = 10; |
353 SkMWCRandom rand; | 353 SkRandom rand; |
354 | 354 |
355 rec->fMode = SkCanvas::kTriangles_VertexMode; | 355 rec->fMode = SkCanvas::kTriangles_VertexMode; |
356 rec->fCount = n * 3; | 356 rec->fCount = n * 3; |
357 rec->fVerts = new SkPoint[rec->fCount]; | 357 rec->fVerts = new SkPoint[rec->fCount]; |
358 | 358 |
359 for (int i = 0; i < n; i++) { | 359 for (int i = 0; i < n; i++) { |
360 SkPoint* v = &rec->fVerts[i*3]; | 360 SkPoint* v = &rec->fVerts[i*3]; |
361 for (int j = 0; j < 3; j++) { | 361 for (int j = 0; j < 3; j++) { |
362 v[j].set(rand.nextUScalar1() * 250, rand.nextUScalar1() * 250); | 362 v[j].set(rand.nextUScalar1() * 250, rand.nextUScalar1() * 250); |
363 } | 363 } |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 } | 725 } |
726 | 726 |
727 private: | 727 private: |
728 typedef SampleView INHERITED; | 728 typedef SampleView INHERITED; |
729 }; | 729 }; |
730 | 730 |
731 ////////////////////////////////////////////////////////////////////////////// | 731 ////////////////////////////////////////////////////////////////////////////// |
732 | 732 |
733 static SkView* MyFactory() { return new SlideView; } | 733 static SkView* MyFactory() { return new SlideView; } |
734 static SkViewRegister reg(MyFactory); | 734 static SkViewRegister reg(MyFactory); |
OLD | NEW |