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

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

Powered by Google App Engine
This is Rietveld 408576698