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

Side by Side Diff: Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp

Issue 8974025: Merge 102310 - WebPImageDecoder should not do a full image decode if progressive decoding is active (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 9 years 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
« no previous file with comments | « Source/WebCore/ChangeLog ('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) 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 ASSERT(height == size().height()); 104 ASSERT(height == size().height());
105 if (!buffer.setSize(width, height)) 105 if (!buffer.setSize(width, height))
106 return setFailed(); 106 return setFailed();
107 buffer.setStatus(allDataReceived ? ImageFrame::FrameComplete : ImageFram e::FramePartial); 107 buffer.setStatus(allDataReceived ? ImageFrame::FrameComplete : ImageFram e::FramePartial);
108 // FIXME: We currently hard code false below because libwebp doesn't sup port alpha yet. 108 // FIXME: We currently hard code false below because libwebp doesn't sup port alpha yet.
109 buffer.setHasAlpha(false); 109 buffer.setHasAlpha(false);
110 buffer.setOriginalFrameRect(IntRect(IntPoint(), size())); 110 buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
111 m_rgbOutput.resize(height * stride); 111 m_rgbOutput.resize(height * stride);
112 } 112 }
113 int newLastVisibleRow = 0; // Last completed row. 113 int newLastVisibleRow = 0; // Last completed row.
114 if (allDataReceived) { 114 if (allDataReceived && !m_decoder) {
115 if (!WebPDecodeRGBInto(dataBytes, dataSize, m_rgbOutput.data(), m_rgbOut put.size(), stride)) 115 if (!WebPDecodeRGBInto(dataBytes, dataSize, m_rgbOutput.data(), m_rgbOut put.size(), stride))
116 return setFailed(); 116 return setFailed();
117 newLastVisibleRow = height; 117 newLastVisibleRow = height;
118 } else { 118 } else {
119 if (!m_decoder) { 119 if (!m_decoder) {
120 m_decoder = WebPINewRGB(MODE_RGB, m_rgbOutput.data(), m_rgbOutput.si ze(), stride); 120 m_decoder = WebPINewRGB(MODE_RGB, m_rgbOutput.data(), m_rgbOutput.si ze(), stride);
121 if (!m_decoder) 121 if (!m_decoder)
122 return setFailed(); 122 return setFailed();
123 } 123 }
124 const VP8StatusCode status = WebPIUpdate(m_decoder, dataBytes, dataSize) ; 124 const VP8StatusCode status = WebPIUpdate(m_decoder, dataBytes, dataSize) ;
(...skipping 12 matching lines...) Expand all
137 } 137 }
138 m_lastVisibleRow = newLastVisibleRow; 138 m_lastVisibleRow = newLastVisibleRow;
139 if (m_lastVisibleRow == height) 139 if (m_lastVisibleRow == height)
140 buffer.setStatus(ImageFrame::FrameComplete); 140 buffer.setStatus(ImageFrame::FrameComplete);
141 return m_lastVisibleRow == height; 141 return m_lastVisibleRow == height;
142 } 142 }
143 143
144 } 144 }
145 145
146 #endif 146 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698