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

Side by Side Diff: samplecode/SampleSlides.cpp

Issue 1974783002: Revert of Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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
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::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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698