| Index: src/core/SkTypeface.cpp
|
| diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
|
| index d768efc60365d8f972c39b66c00e4c522c1745bd..3830c46c7af2e5c608310ab9f098ff862ccc0e00 100644
|
| --- a/src/core/SkTypeface.cpp
|
| +++ b/src/core/SkTypeface.cpp
|
| @@ -318,13 +318,12 @@ bool SkTypeface::onGetKerningPairAdjustments(const uint16_t glyphs[], int count,
|
| #include "SkPaint.h"
|
|
|
| SkRect SkTypeface::getBounds() const {
|
| - return *fLazyBounds.get([&] {
|
| - SkRect* rect = new SkRect;
|
| - if (!this->onComputeBounds(rect)) {
|
| - rect->setEmpty();
|
| + fBoundsOnce([this] {
|
| + if (!this->onComputeBounds(&fBounds)) {
|
| + fBounds.setEmpty();
|
| }
|
| - return rect;
|
| });
|
| + return fBounds;
|
| }
|
|
|
| bool SkTypeface::onComputeBounds(SkRect* bounds) const {
|
|
|