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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // Clears decoded pixel data from all frames except the provided frame. | 251 // Clears decoded pixel data from all frames except the provided frame. |
252 // Callers may pass WTF::kNotFound to clear all frames. | 252 // Callers may pass WTF::kNotFound to clear all frames. |
253 // Note: If |m_frameBufferCache| contains only one frame, it won't be cleare
d. | 253 // Note: If |m_frameBufferCache| contains only one frame, it won't be cleare
d. |
254 // Returns the number of bytes of frame data actually cleared. | 254 // Returns the number of bytes of frame data actually cleared. |
255 virtual size_t clearCacheExceptFrame(size_t); | 255 virtual size_t clearCacheExceptFrame(size_t); |
256 | 256 |
257 // If the image has a cursor hot-spot, stores it in the argument | 257 // If the image has a cursor hot-spot, stores it in the argument |
258 // and returns true. Otherwise returns false. | 258 // and returns true. Otherwise returns false. |
259 virtual bool hotSpot(IntPoint&) const { return false; } | 259 virtual bool hotSpot(IntPoint&) const { return false; } |
260 | 260 |
261 virtual void setMemoryAllocator(SkBitmap::Allocator* allocator) | 261 virtual void setMemoryAllocator(sk_sp<SkBitmap::Allocator> allocator) |
262 { | 262 { |
263 // FIXME: this doesn't work for images with multiple frames. | 263 // FIXME: this doesn't work for images with multiple frames. |
264 if (m_frameBufferCache.isEmpty()) { | 264 if (m_frameBufferCache.isEmpty()) { |
265 m_frameBufferCache.resize(1); | 265 m_frameBufferCache.resize(1); |
266 m_frameBufferCache[0].setRequiredPreviousFrameIndex( | 266 m_frameBufferCache[0].setRequiredPreviousFrameIndex( |
267 findRequiredPreviousFrame(0, false)); | 267 findRequiredPreviousFrame(0, false)); |
268 } | 268 } |
269 m_frameBufferCache[0].setMemoryAllocator(allocator); | 269 m_frameBufferCache[0].setMemoryAllocator(std::move(allocator)); |
270 } | 270 } |
271 | 271 |
272 virtual bool canDecodeToYUV() { return false; } | 272 virtual bool canDecodeToYUV() { return false; } |
273 virtual bool decodeToYUV() { return false; } | 273 virtual bool decodeToYUV() { return false; } |
274 virtual void setImagePlanes(std::unique_ptr<ImagePlanes>) { } | 274 virtual void setImagePlanes(std::unique_ptr<ImagePlanes>) { } |
275 | 275 |
276 protected: | 276 protected: |
277 ImageDecoder(AlphaOption alphaOption, GammaAndColorProfileOption colorOption
s, size_t maxDecodedBytes) | 277 ImageDecoder(AlphaOption alphaOption, GammaAndColorProfileOption colorOption
s, size_t maxDecodedBytes) |
278 : m_premultiplyAlpha(alphaOption == AlphaPremultiplied) | 278 : m_premultiplyAlpha(alphaOption == AlphaPremultiplied) |
279 , m_ignoreGammaAndColorProfile(colorOptions == GammaAndColorProfileIgnor
ed) | 279 , m_ignoreGammaAndColorProfile(colorOptions == GammaAndColorProfileIgnor
ed) |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 ImageFrame::ICCProfile m_colorProfile; | 361 ImageFrame::ICCProfile m_colorProfile; |
362 | 362 |
363 #if USE(QCMSLIB) | 363 #if USE(QCMSLIB) |
364 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform; | 364 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform; |
365 #endif | 365 #endif |
366 }; | 366 }; |
367 | 367 |
368 } // namespace blink | 368 } // namespace blink |
369 | 369 |
370 #endif | 370 #endif |
OLD | NEW |