| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef ImageBuffer_h | 28 #ifndef ImageBuffer_h |
| 29 #define ImageBuffer_h | 29 #define ImageBuffer_h |
| 30 | 30 |
| 31 #include "core/platform/graphics/ColorSpace.h" | 31 #include "core/platform/graphics/ColorSpace.h" |
| 32 #include "core/platform/graphics/FloatRect.h" | 32 #include "core/platform/graphics/FloatRect.h" |
| 33 #include "core/platform/graphics/GraphicsContext.h" | |
| 34 #include "core/platform/graphics/GraphicsTypes.h" | 33 #include "core/platform/graphics/GraphicsTypes.h" |
| 35 #include "core/platform/graphics/GraphicsTypes3D.h" | 34 #include "core/platform/graphics/GraphicsTypes3D.h" |
| 36 #include "core/platform/graphics/IntSize.h" | 35 #include "core/platform/graphics/IntSize.h" |
| 37 #include "core/platform/graphics/transforms/AffineTransform.h" | |
| 38 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
| 39 #include "wtf/OwnPtr.h" | 37 #include "wtf/OwnPtr.h" |
| 40 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
| 41 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
| 42 #include "wtf/Uint8ClampedArray.h" | 40 #include "wtf/Uint8ClampedArray.h" |
| 43 #include "wtf/Vector.h" | |
| 44 | 41 |
| 45 class SkCanvas; | 42 class SkCanvas; |
| 46 | 43 |
| 47 namespace WebKit { class WebLayer; } | 44 namespace WebKit { class WebLayer; } |
| 48 | 45 |
| 49 namespace WebCore { | 46 namespace WebCore { |
| 50 | 47 |
| 51 class Canvas2DLayerBridge; | 48 class Canvas2DLayerBridge; |
| 52 class Image; | 49 class Image; |
| 53 class ImageData; | 50 class ImageData; |
| 54 class IntPoint; | 51 class IntPoint; |
| 55 class IntRect; | 52 class IntRect; |
| 53 class GraphicsContext; |
| 56 class GraphicsContext3D; | 54 class GraphicsContext3D; |
| 57 | 55 |
| 58 enum Multiply { | 56 enum Multiply { |
| 59 Premultiplied, | 57 Premultiplied, |
| 60 Unmultiplied | 58 Unmultiplied |
| 61 }; | 59 }; |
| 62 | 60 |
| 63 enum RenderingMode { | 61 enum RenderingMode { |
| 64 Unaccelerated, | 62 Unaccelerated, |
| 65 UnacceleratedNonPlatformBuffer, // Use plain memory allocation rather than p
latform API to allocate backing store. | 63 UnacceleratedNonPlatformBuffer, // Use plain memory allocation rather than p
latform API to allocate backing store. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSyste
m }; | 110 enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSyste
m }; |
| 113 | 111 |
| 114 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&, Coord
inateSystem = LogicalCoordinateSystem) const; | 112 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&, Coord
inateSystem = LogicalCoordinateSystem) const; |
| 115 PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&, Coor
dinateSystem = LogicalCoordinateSystem) const; | 113 PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&, Coor
dinateSystem = LogicalCoordinateSystem) const; |
| 116 | 114 |
| 117 void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& so
urceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem
= LogicalCoordinateSystem); | 115 void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& so
urceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem
= LogicalCoordinateSystem); |
| 118 | 116 |
| 119 void convertToLuminanceMask(); | 117 void convertToLuminanceMask(); |
| 120 | 118 |
| 121 String toDataURL(const String& mimeType, const double* quality = 0, Coordina
teSystem = LogicalCoordinateSystem) const; | 119 String toDataURL(const String& mimeType, const double* quality = 0, Coordina
teSystem = LogicalCoordinateSystem) const; |
| 122 AffineTransform baseTransform() const { return AffineTransform(); } | |
| 123 void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace)
; | 120 void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace)
; |
| 124 static const Vector<uint8_t>& getLinearRgbLUT(); | 121 static const Vector<uint8_t, 0>& getLinearRgbLUT(); |
| 125 static const Vector<uint8_t>& getDeviceRgbLUT(); | 122 static const Vector<uint8_t, 0>& getDeviceRgbLUT(); |
| 126 WebKit::WebLayer* platformLayer() const; | 123 WebKit::WebLayer* platformLayer() const; |
| 127 | 124 |
| 128 // FIXME: current implementations of this method have the restriction that t
hey only work | 125 // FIXME: current implementations of this method have the restriction that t
hey only work |
| 129 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0
, as specified in | 126 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0
, as specified in |
| 130 // Extensions3D::canUseCopyTextureCHROMIUM(). | 127 // Extensions3D::canUseCopyTextureCHROMIUM(). |
| 131 bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, G
C3Denum, GC3Dint, bool, bool); | 128 bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, G
C3Denum, GC3Dint, bool, bool); |
| 132 | 129 |
| 133 void reportMemoryUsage(MemoryObjectInfo*) const; | 130 void reportMemoryUsage(MemoryObjectInfo*) const; |
| 134 | 131 |
| 135 private: | 132 private: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 152 // so that create() knows when it should return failure. | 149 // so that create() knows when it should return failure. |
| 153 ImageBuffer(const IntSize&, float resolutionScale, RenderingMode, OpacityMod
e, bool& success); | 150 ImageBuffer(const IntSize&, float resolutionScale, RenderingMode, OpacityMod
e, bool& success); |
| 154 ImageBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, b
ool hasAlpha, bool& success); | 151 ImageBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, b
ool hasAlpha, bool& success); |
| 155 }; | 152 }; |
| 156 | 153 |
| 157 String ImageDataToDataURL(const ImageData&, const String& mimeType, const double
* quality); | 154 String ImageDataToDataURL(const ImageData&, const String& mimeType, const double
* quality); |
| 158 | 155 |
| 159 } // namespace WebCore | 156 } // namespace WebCore |
| 160 | 157 |
| 161 #endif // ImageBuffer_h | 158 #endif // ImageBuffer_h |
| OLD | NEW |