OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
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 21 matching lines...) Expand all Loading... | |
32 #include "bindings/core/v8/ScriptWrappable.h" | 32 #include "bindings/core/v8/ScriptWrappable.h" |
33 #include "bindings/core/v8/Uint8ClampedArrayOrUint16ArrayOrFloat32Array.h" | 33 #include "bindings/core/v8/Uint8ClampedArrayOrUint16ArrayOrFloat32Array.h" |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
35 #include "core/dom/ArrayBufferViewHelpers.h" | 35 #include "core/dom/ArrayBufferViewHelpers.h" |
36 #include "core/dom/DOMTypedArray.h" | 36 #include "core/dom/DOMTypedArray.h" |
37 #include "core/html/ImageDataColorSettings.h" | 37 #include "core/html/ImageDataColorSettings.h" |
38 #include "core/html/canvas/CanvasRenderingContext.h" | 38 #include "core/html/canvas/CanvasRenderingContext.h" |
39 #include "core/imagebitmap/ImageBitmapSource.h" | 39 #include "core/imagebitmap/ImageBitmapSource.h" |
40 #include "platform/geometry/IntRect.h" | 40 #include "platform/geometry/IntRect.h" |
41 #include "platform/geometry/IntSize.h" | 41 #include "platform/geometry/IntSize.h" |
42 #include "platform/graphics/CanvasColorParams.h" | |
42 #include "platform/heap/Handle.h" | 43 #include "platform/heap/Handle.h" |
43 #include "platform/wtf/CheckedNumeric.h" | 44 #include "platform/wtf/CheckedNumeric.h" |
44 #include "platform/wtf/Compiler.h" | 45 #include "platform/wtf/Compiler.h" |
45 #include "platform/wtf/text/WTFString.h" | 46 #include "platform/wtf/text/WTFString.h" |
46 #include "third_party/skia/include/core/SkColorSpace.h" | 47 #include "third_party/skia/include/core/SkColorSpace.h" |
47 | 48 |
48 namespace blink { | 49 namespace blink { |
49 | 50 |
50 class ExceptionState; | 51 class ExceptionState; |
51 class ImageBitmapOptions; | 52 class ImageBitmapOptions; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 ExceptionState&); | 102 ExceptionState&); |
102 | 103 |
103 void getColorSettings(ImageDataColorSettings& result) { | 104 void getColorSettings(ImageDataColorSettings& result) { |
104 result = color_settings_; | 105 result = color_settings_; |
105 } | 106 } |
106 | 107 |
107 static ImageData* CreateForTest(const IntSize&); | 108 static ImageData* CreateForTest(const IntSize&); |
108 static ImageData* CreateForTest(const IntSize&, | 109 static ImageData* CreateForTest(const IntSize&, |
109 DOMArrayBufferView*, | 110 DOMArrayBufferView*, |
110 const ImageDataColorSettings* = nullptr); | 111 const ImageDataColorSettings* = nullptr); |
111 static sk_sp<SkColorSpace> GetSkColorSpaceForTest(const CanvasColorSpace&, | 112 static bool CompareImageDataColorSettingsForTest(ImageData*, ImageData*); |
112 const CanvasPixelFormat&); | 113 |
114 ImageData* MakeCopy(); | |
fserb
2017/04/28 14:56:53
I don't know what use case you have in mind for th
zakerinasab
2017/04/28 15:40:48
Good suggestions. Applied.
| |
115 ImageData* MakeSubset(const IntRect&, bool = true); | |
113 | 116 |
114 static CanvasColorSpace GetCanvasColorSpace(const String&); | 117 static CanvasColorSpace GetCanvasColorSpace(const String&); |
115 static String CanvasColorSpaceName(const CanvasColorSpace&); | 118 static String CanvasColorSpaceName(const CanvasColorSpace&); |
116 static ImageDataStorageFormat GetImageDataStorageFormat(const String&); | 119 static ImageDataStorageFormat GetImageDataStorageFormat(const String&); |
117 static unsigned StorageFormatDataSize(const String&); | 120 static unsigned StorageFormatDataSize(const String&); |
118 static DOMArrayBufferView* | 121 static DOMArrayBufferView* |
119 ConvertPixelsFromCanvasPixelFormatToImageDataStorageFormat( | 122 ConvertPixelsFromCanvasPixelFormatToImageDataStorageFormat( |
120 WTF::ArrayBufferContents&, | 123 WTF::ArrayBufferContents&, |
121 CanvasPixelFormat, | 124 CanvasPixelFormat, |
122 ImageDataStorageFormat); | 125 ImageDataStorageFormat); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 static DOMUint16Array* AllocateAndValidateUint16Array( | 189 static DOMUint16Array* AllocateAndValidateUint16Array( |
187 const unsigned&, | 190 const unsigned&, |
188 ExceptionState* = nullptr); | 191 ExceptionState* = nullptr); |
189 | 192 |
190 static DOMFloat32Array* AllocateAndValidateFloat32Array( | 193 static DOMFloat32Array* AllocateAndValidateFloat32Array( |
191 const unsigned&, | 194 const unsigned&, |
192 ExceptionState* = nullptr); | 195 ExceptionState* = nullptr); |
193 | 196 |
194 static DOMFloat32Array* ConvertFloat16ArrayToFloat32Array(const uint16_t*, | 197 static DOMFloat32Array* ConvertFloat16ArrayToFloat32Array(const uint16_t*, |
195 unsigned); | 198 unsigned); |
196 | |
197 static sk_sp<SkColorSpace> GetSkColorSpace(const CanvasColorSpace&, | |
198 const CanvasPixelFormat&); | |
199 }; | 199 }; |
200 | 200 |
201 } // namespace blink | 201 } // namespace blink |
202 | 202 |
203 #endif // ImageData_h | 203 #endif // ImageData_h |
OLD | NEW |