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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 const char* str = "Google"; | 639 const char* str = "Google"; |
640 size_t len = strlen(str); | 640 size_t len = strlen(str); |
641 SkScalar x = 20; | 641 SkScalar x = 20; |
642 SkScalar y = 80; | 642 SkScalar y = 80; |
643 SkPaint paint; | 643 SkPaint paint; |
644 paint.setTypeface(SkTypeface::CreateFromName("Georgia", SkTypeface::kItalic)
); | 644 paint.setTypeface(SkTypeface::CreateFromName("Georgia", SkTypeface::kItalic)
); |
645 paint.setTextSize(75); | 645 paint.setTextSize(75); |
646 paint.setAntiAlias(true); | 646 paint.setAntiAlias(true); |
647 paint.setColor(SK_ColorBLUE); | 647 paint.setColor(SK_ColorBLUE); |
648 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { | 648 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { |
649 apply_shader(&paint, i); | 649 apply_shader(&paint, (int)i); |
650 canvas->drawText(str, len, x, y, paint); | 650 canvas->drawText(str, len, x, y, paint); |
651 y += 80; | 651 y += 80; |
652 if (i == 4) { | 652 if (i == 4) { |
653 x += 320; | 653 x += 320; |
654 y = 80; | 654 y = 80; |
655 } | 655 } |
656 } | 656 } |
657 } | 657 } |
658 | 658 |
659 /////////////////////////////////////////////////////////////////////////////// | 659 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 65 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 |