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 | 8 |
9 | 9 |
10 #include "SkBitmapHeap.h" | 10 #include "SkBitmapHeap.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 bm = fBitmaps[index]; | 155 bm = fBitmaps[index]; |
156 } | 156 } |
157 fReader->readBitmap(bm); | 157 fReader->readBitmap(bm); |
158 } | 158 } |
159 | 159 |
160 /** | 160 /** |
161 * Override of SkBitmapHeapReader, so that SkReadBuffer can use | 161 * Override of SkBitmapHeapReader, so that SkReadBuffer can use |
162 * these SkBitmaps for bitmap shaders. Used only in cross process mode | 162 * these SkBitmaps for bitmap shaders. Used only in cross process mode |
163 * without a shared heap. | 163 * without a shared heap. |
164 */ | 164 */ |
165 virtual SkBitmap* getBitmap(int32_t index) const SK_OVERRIDE { | 165 SkBitmap* getBitmap(int32_t index) const SK_OVERRIDE { |
166 SkASSERT(shouldFlattenBitmaps(fFlags)); | 166 SkASSERT(shouldFlattenBitmaps(fFlags)); |
167 return fBitmaps[index]; | 167 return fBitmaps[index]; |
168 } | 168 } |
169 | 169 |
170 /** | 170 /** |
171 * Needed to be a non-abstract subclass of SkBitmapHeapReader. | 171 * Needed to be a non-abstract subclass of SkBitmapHeapReader. |
172 */ | 172 */ |
173 virtual void releaseRef(int32_t) SK_OVERRIDE {} | 173 void releaseRef(int32_t) SK_OVERRIDE {} |
174 | 174 |
175 void setSharedHeap(SkBitmapHeap* heap) { | 175 void setSharedHeap(SkBitmapHeap* heap) { |
176 SkASSERT(!shouldFlattenBitmaps(fFlags) || NULL == heap); | 176 SkASSERT(!shouldFlattenBitmaps(fFlags) || NULL == heap); |
177 SkRefCnt_SafeAssign(fSharedHeap, heap); | 177 SkRefCnt_SafeAssign(fSharedHeap, heap); |
178 this->updateReader(); | 178 this->updateReader(); |
179 } | 179 } |
180 | 180 |
181 /** | 181 /** |
182 * Access the shared heap. Only used in the case when bitmaps are not | 182 * Access the shared heap. Only used in the case when bitmaps are not |
183 * flattened. | 183 * flattened. |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 status = kReadAtom_Status; | 929 status = kReadAtom_Status; |
930 break; | 930 break; |
931 } | 931 } |
932 } | 932 } |
933 | 933 |
934 if (bytesRead) { | 934 if (bytesRead) { |
935 *bytesRead = reader.offset(); | 935 *bytesRead = reader.offset(); |
936 } | 936 } |
937 return status; | 937 return status; |
938 } | 938 } |
OLD | NEW |