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

Unified Diff: samplecode/SampleXfermodesBlur.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleText.cpp ('k') | src/animator/SkDrawPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleXfermodesBlur.cpp
diff --git a/samplecode/SampleXfermodesBlur.cpp b/samplecode/SampleXfermodesBlur.cpp
index af75f89388ba5fc937fad85ca056c997d9546830..8a69f000f8d3a7138927a66a1513d4bea36a3509 100644
--- a/samplecode/SampleXfermodesBlur.cpp
+++ b/samplecode/SampleXfermodesBlur.cpp
@@ -28,9 +28,7 @@
#include "SkBlurMaskFilter.h"
static void setNamedTypeface(SkPaint* paint, const char name[]) {
- SkTypeface* face = SkTypeface::CreateFromName(name, SkTypeface::kNormal);
- paint->setTypeface(face);
- SkSafeUnref(face);
+ paint->setTypeface(SkTypeface::MakeFromName(name, SkTypeface::kNormal));
}
static uint16_t gBG[] = { 0xFFFF, 0xCCCF, 0xCCCF, 0xFFFF };
@@ -92,8 +90,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
paint.setTextSize(50);
- paint.setTypeface(SkTypeface::CreateFromName("Arial Unicode MS", SkTypeface::kNormal));
- SkSafeUnref(paint.getTypeface());
+ paint.setTypeface(SkTypeface::MakeFromName("Arial Unicode MS", SkTypeface::kNormal));
char buffer[10];
size_t len = SkUTF8_FromUnichar(0x8500, buffer);
canvas->drawText(buffer, len, 40, 40, paint);
« no previous file with comments | « samplecode/SampleText.cpp ('k') | src/animator/SkDrawPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698