Chromium Code Reviews

Side by Side Diff: src/core/SkDescriptor.h

Issue 72603005: Guard against most unintentionally ephemeral SkAutoFoo instantiations. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: docs and REQUIRE_LOCAL_VAR Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
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 SkDescriptor_DEFINED 10 #ifndef SkDescriptor_DEFINED
(...skipping 141 matching lines...)
152 private: 152 private:
153 enum { 153 enum {
154 kStorageSize = sizeof(SkDescriptor) 154 kStorageSize = sizeof(SkDescriptor)
155 + sizeof(SkDescriptor::Entry) + sizeof(SkScalerContext:: Rec) // for rec 155 + sizeof(SkDescriptor::Entry) + sizeof(SkScalerContext:: Rec) // for rec
156 + sizeof(SkDescriptor::Entry) + sizeof(void*) // for typeface 156 + sizeof(SkDescriptor::Entry) + sizeof(void*) // for typeface
157 + 32 // slop for occational small extras 157 + 32 // slop for occational small extras
158 }; 158 };
159 SkDescriptor* fDesc; 159 SkDescriptor* fDesc;
160 uint32_t fStorage[(kStorageSize + 3) >> 2]; 160 uint32_t fStorage[(kStorageSize + 3) >> 2];
161 }; 161 };
162 #define SkAutoDescriptor(...) SK_REQUIRE_LOCAL_VAR(SkAutoDescriptor)
162 163
163 164
164 #endif 165 #endif
OLDNEW

Powered by Google App Engine