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:
parent
ccd3c8937f
commit
c05b2bf3d2
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user