| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 | 7 |
| 8 /* | 8 /* |
| 9 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 9 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 return result; | 139 return result; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void SkGifCodec::initializeColorTable(const SkImageInfo& dstInfo, size_t frameIn
dex, | 142 void SkGifCodec::initializeColorTable(const SkImageInfo& dstInfo, size_t frameIn
dex, |
| 143 SkPMColor* inputColorPtr, int* inputColorCount) { | 143 SkPMColor* inputColorPtr, int* inputColorCount) { |
| 144 fCurrColorTable = fReader->getColorTable(dstInfo.colorType(), frameIndex); | 144 fCurrColorTable = fReader->getColorTable(dstInfo.colorType(), frameIndex); |
| 145 fCurrColorTableIsReal = fCurrColorTable; | 145 fCurrColorTableIsReal = fCurrColorTable; |
| 146 if (!fCurrColorTable) { | 146 if (!fCurrColorTable) { |
| 147 // This is possible for an empty frame. Create a dummy with all transpar
ent. | 147 // This is possible for an empty frame. Create a dummy with all transpar
ent. |
| 148 SkPMColor colors[MAX_COLORS]; | 148 SkPMColor colors[SK_MAX_COLORS]; |
| 149 sk_memset32(colors, SK_ColorTRANSPARENT, MAX_COLORS); | 149 sk_memset32(colors, SK_ColorTRANSPARENT, SK_MAX_COLORS); |
| 150 fCurrColorTable.reset(new SkColorTable(colors, 256)); | 150 fCurrColorTable.reset(new SkColorTable(colors, 256)); |
| 151 } | 151 } |
| 152 | 152 |
| 153 if (inputColorCount) { | 153 if (inputColorCount) { |
| 154 *inputColorCount = fCurrColorTable->count(); | 154 *inputColorCount = fCurrColorTable->count(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 copy_color_table(dstInfo, fCurrColorTable.get(), inputColorPtr, inputColorCo
unt); | 157 copy_color_table(dstInfo, fCurrColorTable.get(), inputColorPtr, inputColorCo
unt); |
| 158 } | 158 } |
| 159 | 159 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 void* copiedLine = SkTAddOffset<void>(dstLine, fSwizzler->swizzleOffsetB
ytes()); | 556 void* copiedLine = SkTAddOffset<void>(dstLine, fSwizzler->swizzleOffsetB
ytes()); |
| 557 void* dst = copiedLine; | 557 void* dst = copiedLine; |
| 558 for (unsigned i = 1; i < repeatCount; i++) { | 558 for (unsigned i = 1; i < repeatCount; i++) { |
| 559 dst = SkTAddOffset<void>(dst, fDstRowBytes); | 559 dst = SkTAddOffset<void>(dst, fDstRowBytes); |
| 560 memcpy(dst, copiedLine, bytesToCopy); | 560 memcpy(dst, copiedLine, bytesToCopy); |
| 561 } | 561 } |
| 562 } | 562 } |
| 563 | 563 |
| 564 return true; | 564 return true; |
| 565 } | 565 } |
| OLD | NEW |