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

Unified Diff: Source/platform/image-decoders/ico/ICOImageDecoder.h

Issue 1338293002: Revert of Never consolidate data in ICO decoder (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@FastSharedBuffer
Patch Set: 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 | « no previous file | Source/platform/image-decoders/ico/ICOImageDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/image-decoders/ico/ICOImageDecoder.h
diff --git a/Source/platform/image-decoders/ico/ICOImageDecoder.h b/Source/platform/image-decoders/ico/ICOImageDecoder.h
index 3e2923813b925de70c8025c7c8918cff36377b17..5cc71c0c5e7c64a9f8cf3fc4025809c4e42bbae1 100644
--- a/Source/platform/image-decoders/ico/ICOImageDecoder.h
+++ b/Source/platform/image-decoders/ico/ICOImageDecoder.h
@@ -31,7 +31,6 @@
#ifndef ICOImageDecoder_h
#define ICOImageDecoder_h
-#include "platform/image-decoders/FastSharedBufferReader.h"
#include "platform/image-decoders/bmp/BMPImageReader.h"
namespace blink {
@@ -84,24 +83,16 @@
size_t decodeFrameCount() override;
void decode(size_t index) override { decode(index, false); }
- // TODO (scroggo): These functions are identical to functions in BMPImageReader. Share code?
- inline uint8_t readUint8(size_t offset) const
- {
- return m_fastReader.getOneByte(m_decodedOffset + offset);
- }
-
inline uint16_t readUint16(int offset) const
{
- char buffer[2];
- const char* data = m_fastReader.getConsecutiveData(m_decodedOffset + offset, 2, buffer);
- return BMPImageReader::readUint16(data);
+ // TODO (scroggo): This consolidates the data, meaning unnecessary copies.
+ return BMPImageReader::readUint16(&m_data->data()[m_decodedOffset + offset]);
}
inline uint32_t readUint32(int offset) const
{
- char buffer[4];
- const char* data = m_fastReader.getConsecutiveData(m_decodedOffset + offset, 4, buffer);
- return BMPImageReader::readUint32(data);
+ // TODO (scroggo): This consolidates the data, meaning unnecessary copies.
+ return BMPImageReader::readUint32(&m_data->data()[m_decodedOffset + offset]);
}
// If the desired PNGImageDecoder exists, gives it the appropriate data.
@@ -141,8 +132,6 @@
// if the type could be determined.
ImageType imageTypeAtIndex(size_t);
- FastSharedBufferReader m_fastReader;
-
// An index into |m_data| representing how much we've already decoded.
// Note that this only tracks data _this_ class decodes; once the
// BMPImageReader takes over this will not be updated further.
« no previous file with comments | « no previous file | Source/platform/image-decoders/ico/ICOImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698