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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // We may need to clear to transparent for one of the following reas
ons: | 291 // We may need to clear to transparent for one of the following reas
ons: |
292 // - The frameRect does not cover the full bounds. haveDecodedRow wi
ll | 292 // - The frameRect does not cover the full bounds. haveDecodedRow wi
ll |
293 // only draw inside the frameRect, so we need to clear the rest. | 293 // only draw inside the frameRect, so we need to clear the rest. |
294 // - There is a valid transparent pixel value. (FIXME: I'm assuming | 294 // - There is a valid transparent pixel value. (FIXME: I'm assuming |
295 // writeTransparentPixels will be false in this case, based on | 295 // writeTransparentPixels will be false in this case, based on |
296 // Chromium's assumption that it would already be zeroed. If we | 296 // Chromium's assumption that it would already be zeroed. If we |
297 // change that behavior, could we skip Filling here?) | 297 // change that behavior, could we skip Filling here?) |
298 // - The frame is interlaced. There is no obvious way to fill | 298 // - The frame is interlaced. There is no obvious way to fill |
299 // afterwards for an incomplete image. (FIXME: Does the first pass | 299 // afterwards for an incomplete image. (FIXME: Does the first pass |
300 // cover all rows? If so, we do not have to fill here.) | 300 // cover all rows? If so, we do not have to fill here.) |
| 301 // - There is no color table for this frame. In that case will not |
| 302 // draw anything, so we need to fill. |
301 if (frameContext->frameRect() != this->getInfo().bounds() | 303 if (frameContext->frameRect() != this->getInfo().bounds() |
302 || frameContext->transparentPixel() < SK_MAX_COLORS | 304 || frameContext->transparentPixel() < SK_MAX_COLORS |
303 || frameContext->interlaced()) { | 305 || frameContext->interlaced() || !fCurrColorTableIsReal) { |
304 // fill ignores the width (replaces it with the actual, scaled w
idth). | 306 // fill ignores the width (replaces it with the actual, scaled w
idth). |
305 // But we need to scale in Y. | 307 // But we need to scale in Y. |
306 const int scaledHeight = get_scaled_dimension(dstInfo.height(), | 308 const int scaledHeight = get_scaled_dimension(dstInfo.height(), |
307 fSwizzler->sampleY
()); | 309 fSwizzler->sampleY
()); |
308 auto fillInfo = dstInfo.makeWH(0, scaledHeight); | 310 auto fillInfo = dstInfo.makeWH(0, scaledHeight); |
309 fSwizzler->fill(fillInfo, fDst, fDstRowBytes, this->getFillValue
(dstInfo), | 311 fSwizzler->fill(fillInfo, fDst, fDstRowBytes, this->getFillValue
(dstInfo), |
310 opts.fZeroInitialized); | 312 opts.fZeroInitialized); |
311 filledBackground = true; | 313 filledBackground = true; |
312 } | 314 } |
313 } else { | 315 } else { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 void* copiedLine = SkTAddOffset<void>(dstLine, fSwizzler->swizzleOffsetB
ytes()); | 556 void* copiedLine = SkTAddOffset<void>(dstLine, fSwizzler->swizzleOffsetB
ytes()); |
555 void* dst = copiedLine; | 557 void* dst = copiedLine; |
556 for (unsigned i = 1; i < repeatCount; i++) { | 558 for (unsigned i = 1; i < repeatCount; i++) { |
557 dst = SkTAddOffset<void>(dst, fDstRowBytes); | 559 dst = SkTAddOffset<void>(dst, fDstRowBytes); |
558 memcpy(dst, copiedLine, bytesToCopy); | 560 memcpy(dst, copiedLine, bytesToCopy); |
559 } | 561 } |
560 } | 562 } |
561 | 563 |
562 return true; | 564 return true; |
563 } | 565 } |
OLD | NEW |