| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 // Returns two point ranges (<left, width> pairs) at row |canvasY| which belong | 76 // Returns two point ranges (<left, width> pairs) at row |canvasY| which belong |
| 77 // to |src| but not |dst|. A range is empty if its width is 0. | 77 // to |src| but not |dst|. A range is empty if its width is 0. |
| 78 inline void findBlendRangeAtRow(const blink::IntRect& src, | 78 inline void findBlendRangeAtRow(const blink::IntRect& src, |
| 79 const blink::IntRect& dst, | 79 const blink::IntRect& dst, |
| 80 int canvasY, | 80 int canvasY, |
| 81 int& left1, | 81 int& left1, |
| 82 int& width1, | 82 int& width1, |
| 83 int& left2, | 83 int& left2, |
| 84 int& width2) { | 84 int& width2) { |
| 85 ASSERT_WITH_SECURITY_IMPLICATION(canvasY >= src.y() && canvasY < src.maxY()); | 85 SECURITY_DCHECK(canvasY >= src.y() && canvasY < src.maxY()); |
| 86 left1 = -1; | 86 left1 = -1; |
| 87 width1 = 0; | 87 width1 = 0; |
| 88 left2 = -1; | 88 left2 = -1; |
| 89 width2 = 0; | 89 width2 = 0; |
| 90 | 90 |
| 91 if (canvasY < dst.y() || canvasY >= dst.maxY() || src.x() >= dst.maxX() || | 91 if (canvasY < dst.y() || canvasY >= dst.maxY() || src.x() >= dst.maxX() || |
| 92 src.maxX() <= dst.x()) { | 92 src.maxX() <= dst.x()) { |
| 93 left1 = src.x(); | 93 left1 = src.x(); |
| 94 width1 = src.width(); | 94 width1 = src.width(); |
| 95 return; | 95 return; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 void WEBPImageDecoder::applyPostProcessing(size_t frameIndex) { | 350 void WEBPImageDecoder::applyPostProcessing(size_t frameIndex) { |
| 351 ImageFrame& buffer = m_frameBufferCache[frameIndex]; | 351 ImageFrame& buffer = m_frameBufferCache[frameIndex]; |
| 352 int width; | 352 int width; |
| 353 int decodedHeight; | 353 int decodedHeight; |
| 354 if (!WebPIDecGetRGB(m_decoder, &decodedHeight, &width, 0, 0)) | 354 if (!WebPIDecGetRGB(m_decoder, &decodedHeight, &width, 0, 0)) |
| 355 return; // See also https://bugs.webkit.org/show_bug.cgi?id=74062 | 355 return; // See also https://bugs.webkit.org/show_bug.cgi?id=74062 |
| 356 if (decodedHeight <= 0) | 356 if (decodedHeight <= 0) |
| 357 return; | 357 return; |
| 358 | 358 |
| 359 const IntRect& frameRect = buffer.originalFrameRect(); | 359 const IntRect& frameRect = buffer.originalFrameRect(); |
| 360 ASSERT_WITH_SECURITY_IMPLICATION(width == frameRect.width()); | 360 SECURITY_DCHECK(width == frameRect.width()); |
| 361 ASSERT_WITH_SECURITY_IMPLICATION(decodedHeight <= frameRect.height()); | 361 SECURITY_DCHECK(decodedHeight <= frameRect.height()); |
| 362 const int left = frameRect.x(); | 362 const int left = frameRect.x(); |
| 363 const int top = frameRect.y(); | 363 const int top = frameRect.y(); |
| 364 | 364 |
| 365 // TODO (msarett): | 365 // TODO (msarett): |
| 366 // Here we apply the color space transformation to the dst space. | 366 // Here we apply the color space transformation to the dst space. |
| 367 // It does not really make sense to transform to a gamma-encoded | 367 // It does not really make sense to transform to a gamma-encoded |
| 368 // space and then immediately after, perform a linear premultiply | 368 // space and then immediately after, perform a linear premultiply |
| 369 // and linear blending. Can we find a way to perform the | 369 // and linear blending. Can we find a way to perform the |
| 370 // premultiplication and blending in a linear space? | 370 // premultiplication and blending in a linear space? |
| 371 SkColorSpaceXform* xform = colorTransform(); | 371 SkColorSpaceXform* xform = colorTransform(); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 return false; | 576 return false; |
| 577 } | 577 } |
| 578 // FALLTHROUGH | 578 // FALLTHROUGH |
| 579 default: | 579 default: |
| 580 clear(); | 580 clear(); |
| 581 return setFailed(); | 581 return setFailed(); |
| 582 } | 582 } |
| 583 } | 583 } |
| 584 | 584 |
| 585 } // namespace blink | 585 } // namespace blink |
| OLD | NEW |