| 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 23 matching lines...) Expand all Loading... |
| 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/PassOwnPtr.h" |
| 40 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
| 41 #include "wtf/Threading.h" | 41 #include "wtf/Threading.h" |
| 42 #include "wtf/Vector.h" | 42 #include "wtf/Vector.h" |
| 43 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
| 44 #include <memory> |
| 44 | 45 |
| 45 #if USE(QCMSLIB) | 46 #if USE(QCMSLIB) |
| 46 #include "qcms.h" | 47 #include "qcms.h" |
| 48 #endif |
| 47 | 49 |
| 48 namespace WTF { | 50 namespace blink { |
| 49 | 51 |
| 50 template <typename T> | 52 #if USE(QCMSLIB) |
| 51 struct OwnedPtrDeleter; | 53 struct QCMSTransformDeleter { |
| 52 template <> | 54 void operator()(qcms_transform* transform) |
| 53 struct OwnedPtrDeleter<qcms_transform> { | |
| 54 static void deletePtr(qcms_transform* transform) | |
| 55 { | 55 { |
| 56 if (transform) | 56 if (transform) |
| 57 qcms_transform_release(transform); | 57 qcms_transform_release(transform); |
| 58 } | 58 } |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 template <typename T> | 61 using QCMSTransformUniquePtr = std::unique_ptr<qcms_transform, QCMSTransformDele
ter>; |
| 62 struct OwnedPtrDeleter; | |
| 63 template <> | |
| 64 struct OwnedPtrDeleter<qcms_profile> { | |
| 65 static void deletePtr(qcms_profile* profile) | |
| 66 { | |
| 67 if (profile) | |
| 68 qcms_profile_release(profile); | |
| 69 } | |
| 70 }; | |
| 71 | |
| 72 } // namespace WTF | |
| 73 | |
| 74 #endif // USE(QCMSLIB) | 62 #endif // USE(QCMSLIB) |
| 75 | 63 |
| 76 namespace blink { | |
| 77 | |
| 78 // ImagePlanes can be used to decode color components into provided buffers inst
ead of using an ImageFrame. | 64 // ImagePlanes can be used to decode color components into provided buffers inst
ead of using an ImageFrame. |
| 79 class PLATFORM_EXPORT ImagePlanes final { | 65 class PLATFORM_EXPORT ImagePlanes final { |
| 80 USING_FAST_MALLOC(ImagePlanes); | 66 USING_FAST_MALLOC(ImagePlanes); |
| 81 WTF_MAKE_NONCOPYABLE(ImagePlanes); | 67 WTF_MAKE_NONCOPYABLE(ImagePlanes); |
| 82 public: | 68 public: |
| 83 ImagePlanes(); | 69 ImagePlanes(); |
| 84 ImagePlanes(void* planes[3], const size_t rowBytes[3]); | 70 ImagePlanes(void* planes[3], const size_t rowBytes[3]); |
| 85 | 71 |
| 86 void* plane(int); | 72 void* plane(int); |
| 87 size_t rowBytes(int) const; | 73 size_t rowBytes(int) const; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 * static_cast<unsigned long long>(height); | 326 * static_cast<unsigned long long>(height); |
| 341 return total_size > ((1 << 29) - 1); | 327 return total_size > ((1 << 29) - 1); |
| 342 } | 328 } |
| 343 | 329 |
| 344 IntSize m_size; | 330 IntSize m_size; |
| 345 bool m_sizeAvailable; | 331 bool m_sizeAvailable; |
| 346 bool m_isAllDataReceived; | 332 bool m_isAllDataReceived; |
| 347 bool m_failed; | 333 bool m_failed; |
| 348 | 334 |
| 349 #if USE(QCMSLIB) | 335 #if USE(QCMSLIB) |
| 350 OwnPtr<qcms_transform> m_sourceToOutputDeviceColorTransform; | 336 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform; |
| 351 #endif | 337 #endif |
| 352 }; | 338 }; |
| 353 | 339 |
| 354 } // namespace blink | 340 } // namespace blink |
| 355 | 341 |
| 356 #endif | 342 #endif |
| OLD | NEW |