Clarify onCreateScalerContext failure modes.

This should not change any behavior, but addresses some readability
concerns.

Change-Id: I2614beaed7b5722a3af2c49ab8f4ac16b56aa3a7
Reviewed-on: https://skia-review.googlesource.com/4393
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2016-11-03 16:51:26 -04:00 committed by Skia Commit-Bot
parent ccd3c8937f
commit c05b2bf3d2
2 changed files with 2 additions and 2 deletions

View File

@ -618,7 +618,7 @@ SkScalerContext* SkTypeface_FreeType::onCreateScalerContext(const SkScalerContex
auto c = skstd::make_unique<SkScalerContext_FreeType>(
sk_ref_sp(const_cast<SkTypeface_FreeType*>(this)), effects, desc);
if (!c->success()) {
c = nullptr;
return nullptr;
}
return c.release();
}

View File

@ -2260,7 +2260,7 @@ SkScalerContext* LogFontTypeface::onCreateScalerContext(const SkScalerContextEff
auto ctx = skstd::make_unique<SkScalerContext_GDI>(
sk_ref_sp(const_cast<LogFontTypeface*>(this)), effects, desc);
if (!ctx->isValid()) {
ctx = nullptr;
return nullptr;
}
return ctx.release();
}