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

Side by Side Diff: include/core/SkRefCnt.h

Issue 567013002: Serialize the font index. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move data into descriptor. Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | include/core/SkTypeface.h » ('j') | src/core/SkPaint.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkRefCnt_DEFINED 10 #ifndef SkRefCnt_DEFINED
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 /** 228 /**
229 * SkAutoTUnref assumes ownership of the ref. As a result, it is an error 229 * SkAutoTUnref assumes ownership of the ref. As a result, it is an error
230 * for the user to ref or unref through SkAutoTUnref. Therefore 230 * for the user to ref or unref through SkAutoTUnref. Therefore
231 * SkAutoTUnref::operator-> returns BlockRef<T>*. This prevents use of 231 * SkAutoTUnref::operator-> returns BlockRef<T>*. This prevents use of
232 * skAutoTUnrefInstance->ref() and skAutoTUnrefInstance->unref(). 232 * skAutoTUnrefInstance->ref() and skAutoTUnrefInstance->unref().
233 */ 233 */
234 BlockRefType *operator->() const { 234 BlockRefType *operator->() const {
235 return static_cast<BlockRefType*>(fObj); 235 return static_cast<BlockRefType*>(fObj);
236 } 236 }
237 operator T*() { return fObj; } 237 operator T*() const { return fObj; }
bungeman-skia 2014/09/18 14:50:09 mtklein and I have stated a couple of times that t
238 238
239 private: 239 private:
240 T* fObj; 240 T* fObj;
241 }; 241 };
242 // Can't use the #define trick below to guard a bare SkAutoTUnref(...) because i t's templated. :( 242 // Can't use the #define trick below to guard a bare SkAutoTUnref(...) because i t's templated. :(
243 243
244 class SkAutoUnref : public SkAutoTUnref<SkRefCnt> { 244 class SkAutoUnref : public SkAutoTUnref<SkRefCnt> {
245 public: 245 public:
246 SkAutoUnref(SkRefCnt* obj) : SkAutoTUnref<SkRefCnt>(obj) {} 246 SkAutoUnref(SkRefCnt* obj) : SkAutoTUnref<SkRefCnt>(obj) {}
247 }; 247 };
248 #define SkAutoUnref(...) SK_REQUIRE_LOCAL_VAR(SkAutoUnref) 248 #define SkAutoUnref(...) SK_REQUIRE_LOCAL_VAR(SkAutoUnref)
249 249
250 #endif 250 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkTypeface.h » ('j') | src/core/SkPaint.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698