| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 return 0; | 168 return 0; |
| 169 | 169 |
| 170 ImageFrame* frame = &m_frameBufferCache[index]; | 170 ImageFrame* frame = &m_frameBufferCache[index]; |
| 171 if (frame->getStatus() != ImageFrame::FrameComplete) { | 171 if (frame->getStatus() != ImageFrame::FrameComplete) { |
| 172 PlatformInstrumentation::willDecodeImage(filenameExtension()); | 172 PlatformInstrumentation::willDecodeImage(filenameExtension()); |
| 173 decode(index); | 173 decode(index); |
| 174 PlatformInstrumentation::didDecodeImage(); | 174 PlatformInstrumentation::didDecodeImage(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 if (!m_hasHistogrammedColorSpace) { | 177 if (!m_hasHistogrammedColorSpace) { |
| 178 BitmapImageMetrics::countImageGamma(m_embeddedColorSpace.get()); | 178 BitmapImageMetrics::countImageGammaAndGamut(m_embeddedColorSpace.get()); |
| 179 m_hasHistogrammedColorSpace = true; | 179 m_hasHistogrammedColorSpace = true; |
| 180 } | 180 } |
| 181 | 181 |
| 182 frame->notifyBitmapIfPixelsChanged(); | 182 frame->notifyBitmapIfPixelsChanged(); |
| 183 return frame; | 183 return frame; |
| 184 } | 184 } |
| 185 | 185 |
| 186 bool ImageDecoder::frameHasAlphaAtIndex(size_t index) const { | 186 bool ImageDecoder::frameHasAlphaAtIndex(size_t index) const { |
| 187 return !frameIsCompleteAtIndex(index) || m_frameBufferCache[index].hasAlpha(); | 187 return !frameIsCompleteAtIndex(index) || m_frameBufferCache[index].hasAlpha(); |
| 188 } | 188 } |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 sk_sp<SkColorSpace> ImageDecoder::colorSpaceForSkImages() const { | 542 sk_sp<SkColorSpace> ImageDecoder::colorSpaceForSkImages() const { |
| 543 if (!m_colorBehavior.isTag()) | 543 if (!m_colorBehavior.isTag()) |
| 544 return nullptr; | 544 return nullptr; |
| 545 | 545 |
| 546 if (m_embeddedColorSpace) | 546 if (m_embeddedColorSpace) |
| 547 return m_embeddedColorSpace; | 547 return m_embeddedColorSpace; |
| 548 return SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); | 548 return SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); |
| 549 } | 549 } |
| 550 | 550 |
| 551 } // namespace blink | 551 } // namespace blink |
| OLD | NEW |