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

Unified Diff: Source/platform/image-decoders/png/PNGImageDecoder.cpp

Issue 1316203008: Never consolidate data in ICO decoder (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@FastSharedBuffer
Patch Set: Respond to pkasting@'s comments in patch set 2 Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/image-decoders/png/PNGImageDecoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/image-decoders/png/PNGImageDecoder.cpp
diff --git a/Source/platform/image-decoders/png/PNGImageDecoder.cpp b/Source/platform/image-decoders/png/PNGImageDecoder.cpp
index 99fde2f278671211987446b4b73657c8e4f37586..fed773021f8a0a47147b266ff6131c80c1c48bb0 100644
--- a/Source/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/Source/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -89,9 +89,9 @@ namespace blink {
class PNGImageReader {
WTF_MAKE_FAST_ALLOCATED(PNGImageReader);
public:
- PNGImageReader(PNGImageDecoder* decoder)
+ PNGImageReader(PNGImageDecoder* decoder, unsigned readOffset)
: m_decoder(decoder)
- , m_readOffset(0)
+ , m_readOffset(readOffset)
, m_currentBufferSize(0)
, m_decodingSizeOnly(false)
, m_hasAlpha(false)
@@ -204,9 +204,10 @@ private:
#endif
};
-PNGImageDecoder::PNGImageDecoder(AlphaOption alphaOption, GammaAndColorProfileOption colorOptions, size_t maxDecodedBytes)
+PNGImageDecoder::PNGImageDecoder(AlphaOption alphaOption, GammaAndColorProfileOption colorOptions, size_t maxDecodedBytes, unsigned offset)
: ImageDecoder(alphaOption, colorOptions, maxDecodedBytes)
, m_hasColorProfile(false)
+ , m_offset(offset)
{
}
@@ -495,7 +496,7 @@ void PNGImageDecoder::decode(bool onlySize)
return;
if (!m_reader)
- m_reader = adoptPtr(new PNGImageReader(this));
+ m_reader = adoptPtr(new PNGImageReader(this, m_offset));
// If we couldn't decode the image but have received all the data, decoding
// has failed.
« no previous file with comments | « Source/platform/image-decoders/png/PNGImageDecoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698