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

Side by Side Diff: samplecode/SampleAll.cpp

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore deleted Android code. 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
« no previous file with comments | « samplecode/ClockFaceView.cpp ('k') | samplecode/SampleAnimatedText.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 520
521 void drawOneRaster(SkCanvas* canvas) { 521 void drawOneRaster(SkCanvas* canvas) {
522 canvas->save(); 522 canvas->save();
523 523
524 SkScalar x = SkIntToScalar(20); 524 SkScalar x = SkIntToScalar(20);
525 SkScalar y = SkIntToScalar(40); 525 SkScalar y = SkIntToScalar(40);
526 SkPaint paint; 526 SkPaint paint;
527 527
528 paint.setAntiAlias(true); 528 paint.setAntiAlias(true);
529 paint.setTextSize(SkIntToScalar(48)); 529 paint.setTextSize(SkIntToScalar(48));
530 paint.setTypeface(SkTypeface::CreateFromName("sans-serif", 530 paint.setTypeface(SkTypeface::MakeFromName("sans-serif", SkTypeface::kBo ld));
531 SkTypeface::kBold));
532 531
533 SkString str("GOOGLE"); 532 SkString str("GOOGLE");
534 533
535 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { 534 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) {
536 apply_shader(&paint, (int)i); 535 apply_shader(&paint, (int)i);
537 536
538 // paint.setMaskFilter(nullptr); 537 // paint.setMaskFilter(nullptr);
539 // paint.setColor(SK_ColorBLACK); 538 // paint.setColor(SK_ColorBLACK);
540 539
541 #if 01 540 #if 01
(...skipping 18 matching lines...) Expand all
560 private: 559 private:
561 SkPoint fClickPt; 560 SkPoint fClickPt;
562 SkBitmap fBug, fTb, fTx; 561 SkBitmap fBug, fTb, fTx;
563 typedef SampleView INHERITED; 562 typedef SampleView INHERITED;
564 }; 563 };
565 564
566 ////////////////////////////////////////////////////////////////////////////// 565 //////////////////////////////////////////////////////////////////////////////
567 566
568 static SkView* MyFactory() { return new DemoView; } 567 static SkView* MyFactory() { return new DemoView; }
569 static SkViewRegister reg(MyFactory); 568 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/ClockFaceView.cpp ('k') | samplecode/SampleAnimatedText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698