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

Unified Diff: src/core/SkTypeface.cpp

Issue 1939503002: remove non-static uses of SkOncePtr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: leave it Created 4 years, 8 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 | « src/core/SkColorTable.cpp ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/core/SkColorTable.cpp ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698