OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "SampleCode.h" | 7 #include "SampleCode.h" |
8 #include "SkBlurMask.h" | 8 #include "SkBlurMask.h" |
9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 } | 618 } |
619 | 619 |
620 #include "SkTypeface.h" | 620 #include "SkTypeface.h" |
621 | 621 |
622 static void texteffect_slide(SkCanvas* canvas) { | 622 static void texteffect_slide(SkCanvas* canvas) { |
623 const char* str = "Google"; | 623 const char* str = "Google"; |
624 size_t len = strlen(str); | 624 size_t len = strlen(str); |
625 SkScalar x = 20; | 625 SkScalar x = 20; |
626 SkScalar y = 80; | 626 SkScalar y = 80; |
627 SkPaint paint; | 627 SkPaint paint; |
628 paint.setTypeface(SkTypeface::MakeFromName("Georgia", SkTypeface::kItalic)); | 628 paint.setTypeface(SkTypeface::CreateFromName("Georgia", SkTypeface::kItalic)
); |
629 paint.setTextSize(75); | 629 paint.setTextSize(75); |
630 paint.setAntiAlias(true); | 630 paint.setAntiAlias(true); |
631 paint.setColor(SK_ColorBLUE); | 631 paint.setColor(SK_ColorBLUE); |
632 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { | 632 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { |
633 apply_shader(&paint, (int)i); | 633 apply_shader(&paint, (int)i); |
634 canvas->drawText(str, len, x, y, paint); | 634 canvas->drawText(str, len, x, y, paint); |
635 y += 80; | 635 y += 80; |
636 if (i == 4) { | 636 if (i == 4) { |
637 x += 320; | 637 x += 320; |
638 y = 80; | 638 y = 80; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 } | 708 } |
709 | 709 |
710 private: | 710 private: |
711 typedef SampleView INHERITED; | 711 typedef SampleView INHERITED; |
712 }; | 712 }; |
713 | 713 |
714 ////////////////////////////////////////////////////////////////////////////// | 714 ////////////////////////////////////////////////////////////////////////////// |
715 | 715 |
716 static SkView* MyFactory() { return new SlideView; } | 716 static SkView* MyFactory() { return new SlideView; } |
717 static SkViewRegister reg(MyFactory); | 717 static SkViewRegister reg(MyFactory); |
OLD | NEW |