Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: samplecode/SampleSlides.cpp

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Android fix + nit fix Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samplecode/SampleFontScalerTest.cpp ('k') | samplecode/SampleXfermodesBlur.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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::MakeFromName("Georgia",
629 SkFontStyle::FromOldStyle(SkTypef ace::kItalic)));
629 paint.setTextSize(75); 630 paint.setTextSize(75);
630 paint.setAntiAlias(true); 631 paint.setAntiAlias(true);
631 paint.setColor(SK_ColorBLUE); 632 paint.setColor(SK_ColorBLUE);
632 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { 633 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) {
633 apply_shader(&paint, (int)i); 634 apply_shader(&paint, (int)i);
634 canvas->drawText(str, len, x, y, paint); 635 canvas->drawText(str, len, x, y, paint);
635 y += 80; 636 y += 80;
636 if (i == 4) { 637 if (i == 4) {
637 x += 320; 638 x += 320;
638 y = 80; 639 y = 80;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 } 709 }
709 710
710 private: 711 private:
711 typedef SampleView INHERITED; 712 typedef SampleView INHERITED;
712 }; 713 };
713 714
714 ////////////////////////////////////////////////////////////////////////////// 715 //////////////////////////////////////////////////////////////////////////////
715 716
716 static SkView* MyFactory() { return new SlideView; } 717 static SkView* MyFactory() { return new SlideView; }
717 static SkViewRegister reg(MyFactory); 718 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFontScalerTest.cpp ('k') | samplecode/SampleXfermodesBlur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698