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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
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
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"
39 #include "wtf/RefPtr.h" 40 #include "wtf/RefPtr.h"
40 #include "wtf/Threading.h" 41 #include "wtf/Threading.h"
41 #include "wtf/Vector.h" 42 #include "wtf/Vector.h"
42 #include "wtf/text/WTFString.h" 43 #include "wtf/text/WTFString.h"
43 #include <memory> 44 #include <memory>
44 45
45 #if USE(QCMSLIB) 46 #if USE(QCMSLIB)
46 #include "qcms.h" 47 #include "qcms.h"
47 #endif 48 #endif
48 49
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 , m_sizeAvailable(false) 102 , m_sizeAvailable(false)
102 , m_isAllDataReceived(false) 103 , m_isAllDataReceived(false)
103 , m_failed(false) { } 104 , m_failed(false) { }
104 105
105 virtual ~ImageDecoder() { } 106 virtual ~ImageDecoder() { }
106 107
107 // Returns a caller-owned decoder of the appropriate type. Returns 0 if 108 // Returns a caller-owned decoder of the appropriate type. Returns 0 if
108 // we can't sniff a supported type from the provided data (possibly 109 // we can't sniff a supported type from the provided data (possibly
109 // because there isn't enough data yet). 110 // because there isn't enough data yet).
110 // Sets m_maxDecodedBytes to Platform::maxImageDecodedBytes(). 111 // Sets m_maxDecodedBytes to Platform::maxImageDecodedBytes().
111 static std::unique_ptr<ImageDecoder> create(const char* data, size_t length, AlphaOption, GammaAndColorProfileOption); 112 static PassOwnPtr<ImageDecoder> create(const char* data, size_t length, Alph aOption, GammaAndColorProfileOption);
112 static std::unique_ptr<ImageDecoder> create(const SharedBuffer&, AlphaOption , GammaAndColorProfileOption); 113 static PassOwnPtr<ImageDecoder> create(const SharedBuffer&, AlphaOption, Gam maAndColorProfileOption);
113 static std::unique_ptr<ImageDecoder> create(const SegmentReader&, AlphaOptio n, GammaAndColorProfileOption); 114 static PassOwnPtr<ImageDecoder> create(const SegmentReader&, AlphaOption, Ga mmaAndColorProfileOption);
114 115
115 virtual String filenameExtension() const = 0; 116 virtual String filenameExtension() const = 0;
116 117
117 bool isAllDataReceived() const { return m_isAllDataReceived; } 118 bool isAllDataReceived() const { return m_isAllDataReceived; }
118 119
119 void setData(PassRefPtr<SegmentReader> data, bool allDataReceived) 120 void setData(PassRefPtr<SegmentReader> data, bool allDataReceived)
120 { 121 {
121 if (m_failed) 122 if (m_failed)
122 return; 123 return;
123 m_data = data; 124 m_data = data;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 if (m_frameBufferCache.isEmpty()) { 257 if (m_frameBufferCache.isEmpty()) {
257 m_frameBufferCache.resize(1); 258 m_frameBufferCache.resize(1);
258 m_frameBufferCache[0].setRequiredPreviousFrameIndex( 259 m_frameBufferCache[0].setRequiredPreviousFrameIndex(
259 findRequiredPreviousFrame(0, false)); 260 findRequiredPreviousFrame(0, false));
260 } 261 }
261 m_frameBufferCache[0].setMemoryAllocator(allocator); 262 m_frameBufferCache[0].setMemoryAllocator(allocator);
262 } 263 }
263 264
264 virtual bool canDecodeToYUV() { return false; } 265 virtual bool canDecodeToYUV() { return false; }
265 virtual bool decodeToYUV() { return false; } 266 virtual bool decodeToYUV() { return false; }
266 virtual void setImagePlanes(std::unique_ptr<ImagePlanes>) { } 267 virtual void setImagePlanes(PassOwnPtr<ImagePlanes>) { }
267 268
268 protected: 269 protected:
269 // Calculates the most recent frame whose image data may be needed in 270 // Calculates the most recent frame whose image data may be needed in
270 // order to decode frame |frameIndex|, based on frame disposal methods 271 // order to decode frame |frameIndex|, based on frame disposal methods
271 // and |frameRectIsOpaque|, where |frameRectIsOpaque| signifies whether 272 // and |frameRectIsOpaque|, where |frameRectIsOpaque| signifies whether
272 // the rectangle of frame at |frameIndex| is known to be opaque. 273 // the rectangle of frame at |frameIndex| is known to be opaque.
273 // If no previous frame's data is required, returns WTF::kNotFound. 274 // If no previous frame's data is required, returns WTF::kNotFound.
274 // 275 //
275 // This function requires that the previous frame's 276 // This function requires that the previous frame's
276 // |m_requiredPreviousFrameIndex| member has been set correctly. The 277 // |m_requiredPreviousFrameIndex| member has been set correctly. The
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 bool m_failed; 331 bool m_failed;
331 332
332 #if USE(QCMSLIB) 333 #if USE(QCMSLIB)
333 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform; 334 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform;
334 #endif 335 #endif
335 }; 336 };
336 337
337 } // namespace blink 338 } // namespace blink
338 339
339 #endif 340 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698