Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Side by Side Diff: Source/core/platform/image-decoders/png/PNGImageDecoder.cpp

Issue 22900016: x (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/platform/graphics/BitmapImage.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
4 * 4 *
5 * Portions are Copyright (C) 2001 mozilla.org 5 * Portions are Copyright (C) 2001 mozilla.org
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Stuart Parmenter <stuart@mozilla.com> 8 * Stuart Parmenter <stuart@mozilla.com>
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 return 0; 240 return 0;
241 241
242 if (m_frameBufferCache.isEmpty()) { 242 if (m_frameBufferCache.isEmpty()) {
243 m_frameBufferCache.resize(1); 243 m_frameBufferCache.resize(1);
244 m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha); 244 m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha);
245 } 245 }
246 246
247 ImageFrame& frame = m_frameBufferCache[0]; 247 ImageFrame& frame = m_frameBufferCache[0];
248 if (frame.status() != ImageFrame::FrameComplete) { 248 if (frame.status() != ImageFrame::FrameComplete) {
249 PlatformInstrumentation::willDecodeImage("PNG"); 249 PlatformInstrumentation::willDecodeImage("PNG");
250 TRACE_EVENT1("webkit", "PNGImageDecoder::decode", "debug", debug(m_data. get()));
250 decode(false); 251 decode(false);
251 PlatformInstrumentation::didDecodeImage(); 252 PlatformInstrumentation::didDecodeImage();
252 } 253 }
253 return &frame; 254 return &frame;
254 } 255 }
255 256
256 bool PNGImageDecoder::setFailed() 257 bool PNGImageDecoder::setFailed()
257 { 258 {
258 if (m_doNothingOnFailure) 259 if (m_doNothingOnFailure)
259 return false; 260 return false;
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 // has failed. 522 // has failed.
522 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) 523 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
523 setFailed(); 524 setFailed();
524 // If we're done decoding the image, we don't need the PNGImageReader 525 // If we're done decoding the image, we don't need the PNGImageReader
525 // anymore. (If we failed, |m_reader| has already been cleared.) 526 // anymore. (If we failed, |m_reader| has already been cleared.)
526 else if (isComplete()) 527 else if (isComplete())
527 m_reader.clear(); 528 m_reader.clear();
528 } 529 }
529 530
530 } // namespace WebCore 531 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/BitmapImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698