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

Unified Diff: include/core/SkLazyPtr.h

Issue 676523002: Add SkTypeface::getBounds() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « gm/fontmgr.cpp ('k') | include/core/SkThreadPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkLazyPtr.h
diff --git a/src/core/SkLazyPtr.h b/include/core/SkLazyPtr.h
similarity index 98%
rename from src/core/SkLazyPtr.h
rename to include/core/SkLazyPtr.h
index 7273079252a7f89e8ea22c78d9ed620ec31303ac..896dfbf88d762570545a9e5a7715aeeb795313e9 100644
--- a/src/core/SkLazyPtr.h
+++ b/include/core/SkLazyPtr.h
@@ -147,19 +147,19 @@ public:
SkLazyPtr() : fPtr(NULL) {}
~SkLazyPtr() { if (fPtr) { Destroy((T*)fPtr); } }
- T* get() {
+ T* get() const {
T* ptr = (T*)sk_consume_load(&fPtr);
return ptr ? ptr : Private::try_cas<T*, Destroy>(&fPtr, SkNEW(T));
}
template <typename Create>
- T* get(const Create& create) {
+ T* get(const Create& create) const {
T* ptr = (T*)sk_consume_load(&fPtr);
return ptr ? ptr : Private::try_cas<T*, Destroy>(&fPtr, create());
}
private:
- void* fPtr;
+ mutable void* fPtr;
};
« no previous file with comments | « gm/fontmgr.cpp ('k') | include/core/SkThreadPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698