OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
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 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include "SkColorPriv.h" | 30 #include "SkColorPriv.h" |
31 #include "platform/PlatformExport.h" | 31 #include "platform/PlatformExport.h" |
32 #include "platform/SharedBuffer.h" | 32 #include "platform/SharedBuffer.h" |
33 #include "platform/graphics/ImageOrientation.h" | 33 #include "platform/graphics/ImageOrientation.h" |
34 #include "platform/image-decoders/ImageAnimation.h" | 34 #include "platform/image-decoders/ImageAnimation.h" |
35 #include "platform/image-decoders/ImageFrame.h" | 35 #include "platform/image-decoders/ImageFrame.h" |
36 #include "platform/image-decoders/SegmentReader.h" | 36 #include "platform/image-decoders/SegmentReader.h" |
37 #include "public/platform/Platform.h" | 37 #include "public/platform/Platform.h" |
38 #include "wtf/Assertions.h" | 38 #include "wtf/Assertions.h" |
39 #include "wtf/PassOwnPtr.h" | |
40 #include "wtf/RefPtr.h" | 39 #include "wtf/RefPtr.h" |
41 #include "wtf/Threading.h" | 40 #include "wtf/Threading.h" |
42 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
43 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
44 #include <memory> | 43 #include <memory> |
45 | 44 |
46 #if USE(QCMSLIB) | 45 #if USE(QCMSLIB) |
47 #include "qcms.h" | 46 #include "qcms.h" |
48 #endif | 47 #endif |
49 | 48 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 , m_sizeAvailable(false) | 101 , m_sizeAvailable(false) |
103 , m_isAllDataReceived(false) | 102 , m_isAllDataReceived(false) |
104 , m_failed(false) { } | 103 , m_failed(false) { } |
105 | 104 |
106 virtual ~ImageDecoder() { } | 105 virtual ~ImageDecoder() { } |
107 | 106 |
108 // Returns a caller-owned decoder of the appropriate type. Returns 0 if | 107 // Returns a caller-owned decoder of the appropriate type. Returns 0 if |
109 // we can't sniff a supported type from the provided data (possibly | 108 // we can't sniff a supported type from the provided data (possibly |
110 // because there isn't enough data yet). | 109 // because there isn't enough data yet). |
111 // Sets m_maxDecodedBytes to Platform::maxImageDecodedBytes(). | 110 // Sets m_maxDecodedBytes to Platform::maxImageDecodedBytes(). |
112 static PassOwnPtr<ImageDecoder> create(const char* data, size_t length, Alph
aOption, GammaAndColorProfileOption); | 111 static std::unique_ptr<ImageDecoder> create(const char* data, size_t length,
AlphaOption, GammaAndColorProfileOption); |
113 static PassOwnPtr<ImageDecoder> create(const SharedBuffer&, AlphaOption, Gam
maAndColorProfileOption); | 112 static std::unique_ptr<ImageDecoder> create(const SharedBuffer&, AlphaOption
, GammaAndColorProfileOption); |
114 static PassOwnPtr<ImageDecoder> create(const SegmentReader&, AlphaOption, Ga
mmaAndColorProfileOption); | 113 static std::unique_ptr<ImageDecoder> create(const SegmentReader&, AlphaOptio
n, GammaAndColorProfileOption); |
115 | 114 |
116 virtual String filenameExtension() const = 0; | 115 virtual String filenameExtension() const = 0; |
117 | 116 |
118 bool isAllDataReceived() const { return m_isAllDataReceived; } | 117 bool isAllDataReceived() const { return m_isAllDataReceived; } |
119 | 118 |
120 void setData(PassRefPtr<SegmentReader> data, bool allDataReceived) | 119 void setData(PassRefPtr<SegmentReader> data, bool allDataReceived) |
121 { | 120 { |
122 if (m_failed) | 121 if (m_failed) |
123 return; | 122 return; |
124 m_data = data; | 123 m_data = data; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 if (m_frameBufferCache.isEmpty()) { | 256 if (m_frameBufferCache.isEmpty()) { |
258 m_frameBufferCache.resize(1); | 257 m_frameBufferCache.resize(1); |
259 m_frameBufferCache[0].setRequiredPreviousFrameIndex( | 258 m_frameBufferCache[0].setRequiredPreviousFrameIndex( |
260 findRequiredPreviousFrame(0, false)); | 259 findRequiredPreviousFrame(0, false)); |
261 } | 260 } |
262 m_frameBufferCache[0].setMemoryAllocator(allocator); | 261 m_frameBufferCache[0].setMemoryAllocator(allocator); |
263 } | 262 } |
264 | 263 |
265 virtual bool canDecodeToYUV() { return false; } | 264 virtual bool canDecodeToYUV() { return false; } |
266 virtual bool decodeToYUV() { return false; } | 265 virtual bool decodeToYUV() { return false; } |
267 virtual void setImagePlanes(PassOwnPtr<ImagePlanes>) { } | 266 virtual void setImagePlanes(std::unique_ptr<ImagePlanes>) { } |
268 | 267 |
269 protected: | 268 protected: |
270 // Calculates the most recent frame whose image data may be needed in | 269 // Calculates the most recent frame whose image data may be needed in |
271 // order to decode frame |frameIndex|, based on frame disposal methods | 270 // order to decode frame |frameIndex|, based on frame disposal methods |
272 // and |frameRectIsOpaque|, where |frameRectIsOpaque| signifies whether | 271 // and |frameRectIsOpaque|, where |frameRectIsOpaque| signifies whether |
273 // the rectangle of frame at |frameIndex| is known to be opaque. | 272 // the rectangle of frame at |frameIndex| is known to be opaque. |
274 // If no previous frame's data is required, returns WTF::kNotFound. | 273 // If no previous frame's data is required, returns WTF::kNotFound. |
275 // | 274 // |
276 // This function requires that the previous frame's | 275 // This function requires that the previous frame's |
277 // |m_requiredPreviousFrameIndex| member has been set correctly. The | 276 // |m_requiredPreviousFrameIndex| member has been set correctly. The |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 bool m_failed; | 330 bool m_failed; |
332 | 331 |
333 #if USE(QCMSLIB) | 332 #if USE(QCMSLIB) |
334 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform; | 333 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform; |
335 #endif | 334 #endif |
336 }; | 335 }; |
337 | 336 |
338 } // namespace blink | 337 } // namespace blink |
339 | 338 |
340 #endif | 339 #endif |
OLD | NEW |