OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "SkPictureFlat.h" | 7 #include "SkPictureFlat.h" |
8 | 8 |
9 #include "SkChecksum.h" | 9 #include "SkChecksum.h" |
10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 fCount = count; | 49 fCount = count; |
50 fArray = new SkRefCnt* [count]; | 50 fArray = new SkRefCnt* [count]; |
51 sk_bzero(fArray, count * sizeof(SkRefCnt*)); | 51 sk_bzero(fArray, count * sizeof(SkRefCnt*)); |
52 } | 52 } |
53 | 53 |
54 SkRefCnt* SkTypefacePlayback::set(int index, SkRefCnt* obj) { | 54 SkRefCnt* SkTypefacePlayback::set(int index, SkRefCnt* obj) { |
55 SkASSERT((unsigned)index < (unsigned)fCount); | 55 SkASSERT((unsigned)index < (unsigned)fCount); |
56 SkRefCnt_SafeAssign(fArray[index], obj); | 56 SkRefCnt_SafeAssign(fArray[index], obj); |
57 return obj; | 57 return obj; |
58 } | 58 } |
59 | |
60 /////////////////////////////////////////////////////////////////////////////// | |
61 | |
62 SkFlatController::SkFlatController(uint32_t writeBufferFlags) | |
63 : fBitmapHeap(nullptr) | |
64 , fTypefaceSet(nullptr) | |
65 , fTypefacePlayback(nullptr) | |
66 , fWriteBufferFlags(writeBufferFlags) {} | |
67 | |
68 SkFlatController::~SkFlatController() { | |
69 SkSafeUnref(fBitmapHeap); | |
70 SkSafeUnref(fTypefaceSet); | |
71 } | |
72 | |
73 void SkFlatController::setBitmapHeap(SkBitmapHeap* heap) { | |
74 SkRefCnt_SafeAssign(fBitmapHeap, heap); | |
75 } | |
76 | |
77 void SkFlatController::setTypefaceSet(SkRefCntSet *set) { | |
78 SkRefCnt_SafeAssign(fTypefaceSet, set); | |
79 } | |
80 | |
81 void SkFlatController::setTypefacePlayback(SkTypefacePlayback* playback) { | |
82 fTypefacePlayback = playback; | |
83 } | |
OLD | NEW |