OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #include "SkPictureFlat.h" | 8 #include "SkPictureFlat.h" |
9 | 9 |
10 #include "SkChecksum.h" | 10 #include "SkChecksum.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 SkRefCnt* SkTypefacePlayback::set(int index, SkRefCnt* obj) { | 55 SkRefCnt* SkTypefacePlayback::set(int index, SkRefCnt* obj) { |
56 SkASSERT((unsigned)index < (unsigned)fCount); | 56 SkASSERT((unsigned)index < (unsigned)fCount); |
57 SkRefCnt_SafeAssign(fArray[index], obj); | 57 SkRefCnt_SafeAssign(fArray[index], obj); |
58 return obj; | 58 return obj; |
59 } | 59 } |
60 | 60 |
61 /////////////////////////////////////////////////////////////////////////////// | 61 /////////////////////////////////////////////////////////////////////////////// |
62 | 62 |
63 SkFlatController::SkFlatController() | 63 SkFlatController::SkFlatController(uint32_t writeBufferFlags) |
64 : fBitmapHeap(NULL) | 64 : fBitmapHeap(NULL) |
65 , fTypefaceSet(NULL) | 65 , fTypefaceSet(NULL) |
66 , fTypefacePlayback(NULL) | 66 , fTypefacePlayback(NULL) |
67 , fFactorySet(NULL) | 67 , fFactorySet(NULL) |
68 , fWriteBufferFlags(0) {} | 68 , fWriteBufferFlags(writeBufferFlags) {} |
69 | 69 |
70 SkFlatController::~SkFlatController() { | 70 SkFlatController::~SkFlatController() { |
71 SkSafeUnref(fBitmapHeap); | 71 SkSafeUnref(fBitmapHeap); |
72 SkSafeUnref(fTypefaceSet); | 72 SkSafeUnref(fTypefaceSet); |
73 SkSafeUnref(fFactorySet); | 73 SkSafeUnref(fFactorySet); |
74 } | 74 } |
75 | 75 |
76 void SkFlatController::setBitmapHeap(SkBitmapHeap* heap) { | 76 void SkFlatController::setBitmapHeap(SkBitmapHeap* heap) { |
77 SkRefCnt_SafeAssign(fBitmapHeap, heap); | 77 SkRefCnt_SafeAssign(fBitmapHeap, heap); |
78 } | 78 } |
79 | 79 |
80 void SkFlatController::setTypefaceSet(SkRefCntSet *set) { | 80 void SkFlatController::setTypefaceSet(SkRefCntSet *set) { |
81 SkRefCnt_SafeAssign(fTypefaceSet, set); | 81 SkRefCnt_SafeAssign(fTypefaceSet, set); |
82 } | 82 } |
83 | 83 |
84 void SkFlatController::setTypefacePlayback(SkTypefacePlayback* playback) { | 84 void SkFlatController::setTypefacePlayback(SkTypefacePlayback* playback) { |
85 fTypefacePlayback = playback; | 85 fTypefacePlayback = playback; |
86 } | 86 } |
87 | 87 |
88 SkNamedFactorySet* SkFlatController::setNamedFactorySet(SkNamedFactorySet* set)
{ | 88 SkNamedFactorySet* SkFlatController::setNamedFactorySet(SkNamedFactorySet* set)
{ |
89 SkRefCnt_SafeAssign(fFactorySet, set); | 89 SkRefCnt_SafeAssign(fFactorySet, set); |
90 return set; | 90 return set; |
91 } | 91 } |
OLD | NEW |