OLD | NEW |
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 SkRegionPriv_DEFINED | 10 #ifndef SkRegionPriv_DEFINED |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return fIntervalCount; | 59 return fIntervalCount; |
60 } | 60 } |
61 | 61 |
62 static RunHead* Alloc(int count) { | 62 static RunHead* Alloc(int count) { |
63 //SkDEBUGCODE(sk_atomic_inc(&gRgnAllocCounter);) | 63 //SkDEBUGCODE(sk_atomic_inc(&gRgnAllocCounter);) |
64 //SkDEBUGF(("************** gRgnAllocCounter::alloc %d\n", gRgnAllocCoun
ter)); | 64 //SkDEBUGF(("************** gRgnAllocCounter::alloc %d\n", gRgnAllocCoun
ter)); |
65 | 65 |
66 SkASSERT(count >= SkRegion::kRectRegionRuns); | 66 SkASSERT(count >= SkRegion::kRectRegionRuns); |
67 | 67 |
68 const int64_t size = sk_64_mul(count, sizeof(RunType)) + sizeof(RunHead)
; | 68 const int64_t size = sk_64_mul(count, sizeof(RunType)) + sizeof(RunHead)
; |
69 if (count < 0 || !sk_64_isS32(size)) { SK_CRASH(); } | 69 if (count < 0 || !sk_64_isS32(size)) { SK_ABORT("Invalid Size"); } |
70 | 70 |
71 RunHead* head = (RunHead*)sk_malloc_throw(size); | 71 RunHead* head = (RunHead*)sk_malloc_throw(size); |
72 head->fRefCnt = 1; | 72 head->fRefCnt = 1; |
73 head->fRunCount = count; | 73 head->fRunCount = count; |
74 // these must be filled in later, otherwise we will be invalid | 74 // these must be filled in later, otherwise we will be invalid |
75 head->fYSpanCount = 0; | 75 head->fYSpanCount = 0; |
76 head->fIntervalCount = 0; | 76 head->fIntervalCount = 0; |
77 return head; | 77 return head; |
78 } | 78 } |
79 | 79 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 bounds->fRight = rite; | 227 bounds->fRight = rite; |
228 bounds->fBottom = bot; | 228 bounds->fBottom = bot; |
229 } | 229 } |
230 | 230 |
231 private: | 231 private: |
232 int32_t fYSpanCount; | 232 int32_t fYSpanCount; |
233 int32_t fIntervalCount; | 233 int32_t fIntervalCount; |
234 }; | 234 }; |
235 | 235 |
236 #endif | 236 #endif |
OLD | NEW |