| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2009 The Android Open Source Project | 2 * Copyright 2009 The Android Open Source Project |
| 4 * | 3 * |
| 5 * 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 |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 | 8 |
| 10 #include "SkColorTable.h" | 9 #include "SkColorTable.h" |
| 11 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 101 } |
| 103 | 102 |
| 104 const size_t allocSize = count * sizeof(SkPMColor); | 103 const size_t allocSize = count * sizeof(SkPMColor); |
| 105 SkAutoTDelete<SkPMColor> colors((SkPMColor*)sk_malloc_throw(allocSize)); | 104 SkAutoTDelete<SkPMColor> colors((SkPMColor*)sk_malloc_throw(allocSize)); |
| 106 if (!buffer.readColorArray(colors, count)) { | 105 if (!buffer.readColorArray(colors, count)) { |
| 107 return nullptr; | 106 return nullptr; |
| 108 } | 107 } |
| 109 | 108 |
| 110 return new SkColorTable(colors.release(), count, kAllocatedWithMalloc); | 109 return new SkColorTable(colors.release(), count, kAllocatedWithMalloc); |
| 111 } | 110 } |
| 112 | |
| OLD | NEW |