Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 // https://html.spec.whatwg.org/#dom-imagedata | 29 // https://html.spec.whatwg.org/#dom-imagedata |
| 30 // https://github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposa l.md#imagedata | 30 // https://github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposa l.md#imagedata |
| 31 | 31 |
| 32 enum ImageDataColorSpace { "legacy-srgb", "srgb", "linear-rgb" }; | 32 typedef (Uint8ClampedArray or Uint16Array or Float32Array) ImageDataArray; |
| 33 | 33 |
| 34 [ | 34 [ |
| 35 Constructor(unsigned long sw, unsigned long sh), | 35 Constructor(unsigned long sw, unsigned long sh), |
| 36 Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh), | 36 Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh), |
| 37 Exposed=(Window,Worker), | 37 Exposed=(Window,Worker), |
| 38 RaisesException=Constructor, | 38 RaisesException=Constructor, |
| 39 ] interface ImageData { | 39 ] interface ImageData { |
| 40 | 40 |
| 41 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData creat eImageData(unsigned long sw, unsigned long sh, ImageDataColorSpace colorSpace); | 41 // The following createImageData functions are used instead of the regular c onstructors |
| 42 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData creat eImageData(Uint8ClampedArray data, unsigned long sw, ImageDataColorSpace colorSp ace); | 42 // as currently Blink IDL does not allow to put custom constructors behind a flag |
| 43 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData creat eImageData(Uint8ClampedArray data, unsigned long sw, unsigned long sh, ImageData ColorSpace colorSpace); | 43 // (crbug.com/672978). These must be replaced with regular constructor decla ration |
| 44 // as specified in the proposal before shipping. | |
| 45 // https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpacePr oposal.md | |
| 46 | |
| 47 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData creat eImageData(unsigned long sw, unsigned long sh, ImageDataColorSettings imageDataC olorSettings); | |
| 48 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData creat eImageData(ImageDataArray data, unsigned long sw, unsigned long sh, ImageDataCol orSettings imageDataColorSettings); | |
| 44 | 49 |
| 45 readonly attribute unsigned long width; | 50 readonly attribute unsigned long width; |
| 46 readonly attribute unsigned long height; | 51 readonly attribute unsigned long height; |
| 47 readonly attribute Uint8ClampedArray data; | 52 readonly attribute Uint8ClampedArray data; |
| 48 readonly attribute ImageDataColorSpace colorSpace; | 53 [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute ImageDataArra y dataUnion; |
|
Justin Novosad
2017/03/10 20:30:26
Great that you figured out how to make this work!
zakerinasab
2017/03/13 15:43:27
A new layout test added to print out a performance
| |
| 54 [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute ImageDataColo rSettings colorAttributes; | |
|
Justin Novosad
2017/03/10 20:30:26
perhaps this should be called "settings"?
zakerinasab
2017/03/13 15:43:27
My intuition was that you try to apply "settings",
| |
| 49 }; | 55 }; |
| OLD | NEW |