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

Side by Side Diff: samplecode/SampleAll.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 "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::MakeFromName("sans-serif", SkTypeface::kBo ld)); 530 paint.setTypeface(SkTypeface::CreateFromName("sans-serif",
531 SkTypeface::kBold));
531 532
532 SkString str("GOOGLE"); 533 SkString str("GOOGLE");
533 534
534 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { 535 for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) {
535 apply_shader(&paint, (int)i); 536 apply_shader(&paint, (int)i);
536 537
537 // paint.setMaskFilter(nullptr); 538 // paint.setMaskFilter(nullptr);
538 // paint.setColor(SK_ColorBLACK); 539 // paint.setColor(SK_ColorBLACK);
539 540
540 #if 01 541 #if 01
(...skipping 18 matching lines...) Expand all
559 private: 560 private:
560 SkPoint fClickPt; 561 SkPoint fClickPt;
561 SkBitmap fBug, fTb, fTx; 562 SkBitmap fBug, fTb, fTx;
562 typedef SampleView INHERITED; 563 typedef SampleView INHERITED;
563 }; 564 };
564 565
565 ////////////////////////////////////////////////////////////////////////////// 566 //////////////////////////////////////////////////////////////////////////////
566 567
567 static SkView* MyFactory() { return new DemoView; } 568 static SkView* MyFactory() { return new DemoView; }
568 static SkViewRegister reg(MyFactory); 569 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698