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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 143 } |
144 | 144 |
145 /** | 145 /** |
146 * Add a bitmap to the array of bitmaps, or replace an existing one. | 146 * Add a bitmap to the array of bitmaps, or replace an existing one. |
147 * This is only used when in cross process mode without a shared heap. | 147 * This is only used when in cross process mode without a shared heap. |
148 */ | 148 */ |
149 void addBitmap(int index) { | 149 void addBitmap(int index) { |
150 SkASSERT(shouldFlattenBitmaps(fFlags)); | 150 SkASSERT(shouldFlattenBitmaps(fFlags)); |
151 SkBitmap* bm; | 151 SkBitmap* bm; |
152 if(fBitmaps.count() == index) { | 152 if(fBitmaps.count() == index) { |
153 bm = SkNEW(SkBitmap); | 153 bm = new SkBitmap; |
154 *fBitmaps.append() = bm; | 154 *fBitmaps.append() = bm; |
155 } else { | 155 } else { |
156 bm = fBitmaps[index]; | 156 bm = fBitmaps[index]; |
157 } | 157 } |
158 fReader->readBitmap(bm); | 158 fReader->readBitmap(bm); |
159 } | 159 } |
160 | 160 |
161 /** | 161 /** |
162 * Override of SkBitmapHeapReader, so that SkReadBuffer can use | 162 * Override of SkBitmapHeapReader, so that SkReadBuffer can use |
163 * these SkBitmaps for bitmap shaders. Used only in cross process mode | 163 * these SkBitmaps for bitmap shaders. Used only in cross process mode |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 status = kReadAtom_Status; | 1008 status = kReadAtom_Status; |
1009 break; | 1009 break; |
1010 } | 1010 } |
1011 } | 1011 } |
1012 | 1012 |
1013 if (bytesRead) { | 1013 if (bytesRead) { |
1014 *bytesRead = reader.offset(); | 1014 *bytesRead = reader.offset(); |
1015 } | 1015 } |
1016 return status; | 1016 return status; |
1017 } | 1017 } |
OLD | NEW |