Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: third_party/WebKit/Source/core/html/ImageData.h

Issue 2794233002: Revert of Convert colorSettins attribute in ImageData.idl to a getter method (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 ImageData* createImageData(unsigned width, 92 ImageData* createImageData(unsigned width,
93 unsigned height, 93 unsigned height,
94 const ImageDataColorSettings&, 94 const ImageDataColorSettings&,
95 ExceptionState&); 95 ExceptionState&);
96 ImageData* createImageData(ImageDataArray&, 96 ImageData* createImageData(ImageDataArray&,
97 unsigned width, 97 unsigned width,
98 unsigned height, 98 unsigned height,
99 ImageDataColorSettings&, 99 ImageDataColorSettings&,
100 ExceptionState&); 100 ExceptionState&);
101 101
102 void getColorSettings(ImageDataColorSettings& result) {
103 result = m_colorSettings;
104 }
105
106 static ImageData* createForTest(const IntSize&); 102 static ImageData* createForTest(const IntSize&);
107 static ImageData* createForTest(const IntSize&, 103 static ImageData* createForTest(const IntSize&,
108 DOMArrayBufferView*, 104 DOMArrayBufferView*,
109 const ImageDataColorSettings* = nullptr); 105 const ImageDataColorSettings* = nullptr);
110 static sk_sp<SkColorSpace> getSkColorSpaceForTest(const CanvasColorSpace&, 106 static sk_sp<SkColorSpace> getSkColorSpaceForTest(const CanvasColorSpace&,
111 const CanvasPixelFormat&); 107 const CanvasPixelFormat&);
112 108
113 static CanvasColorSpace canvasColorSpace(const String&); 109 static CanvasColorSpace canvasColorSpace(const String&);
114 static String canvasColorSpaceName(const CanvasColorSpace&); 110 static String canvasColorSpaceName(const CanvasColorSpace&);
115 static ImageDataStorageFormat imageDataStorageFormat(const String&); 111 static ImageDataStorageFormat imageDataStorageFormat(const String&);
116 static unsigned storageFormatDataSize(const String&); 112 static unsigned storageFormatDataSize(const String&);
117 static DOMArrayBufferView* 113 static DOMArrayBufferView*
118 convertPixelsFromCanvasPixelFormatToImageDataStorageFormat( 114 convertPixelsFromCanvasPixelFormatToImageDataStorageFormat(
119 WTF::ArrayBufferContents&, 115 WTF::ArrayBufferContents&,
120 CanvasPixelFormat, 116 CanvasPixelFormat,
121 ImageDataStorageFormat); 117 ImageDataStorageFormat);
122 118
123 IntSize size() const { return m_size; } 119 IntSize size() const { return m_size; }
124 int width() const { return m_size.width(); } 120 int width() const { return m_size.width(); }
125 int height() const { return m_size.height(); } 121 int height() const { return m_size.height(); }
126 122
127 DOMUint8ClampedArray* data(); 123 DOMUint8ClampedArray* data();
128 const DOMUint8ClampedArray* data() const; 124 const DOMUint8ClampedArray* data() const;
129 ImageDataArray& dataUnion() { return m_dataUnion; } 125 ImageDataArray& dataUnion() { return m_dataUnion; }
130 const ImageDataArray& dataUnion() const { return m_dataUnion; } 126 const ImageDataArray& dataUnion() const { return m_dataUnion; }
131 void dataUnion(ImageDataArray& result) { result = m_dataUnion; }; 127 void dataUnion(ImageDataArray& result) { result = m_dataUnion; };
128 const ImageDataColorSettings& colorSettings() const {
129 return m_colorSettings;
130 }
131 void colorSettings(ImageDataColorSettings& result) {
132 result = m_colorSettings;
133 };
132 134
133 sk_sp<SkColorSpace> skColorSpace(); 135 sk_sp<SkColorSpace> skColorSpace();
134 bool imageDataInCanvasColorSettings(const CanvasColorSpace&, 136 bool imageDataInCanvasColorSettings(const CanvasColorSpace&,
135 const CanvasPixelFormat&, 137 const CanvasPixelFormat&,
136 std::unique_ptr<uint8_t[]>&); 138 std::unique_ptr<uint8_t[]>&);
137 139
138 // ImageBitmapSource implementation 140 // ImageBitmapSource implementation
139 IntSize bitmapSourceSize() const override { return m_size; } 141 IntSize bitmapSourceSize() const override { return m_size; }
140 ScriptPromise createImageBitmap(ScriptState*, 142 ScriptPromise createImageBitmap(ScriptState*,
141 EventTarget&, 143 EventTarget&,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 static DOMFloat32Array* convertFloat16ArrayToFloat32Array(const uint16_t*, 193 static DOMFloat32Array* convertFloat16ArrayToFloat32Array(const uint16_t*,
192 unsigned); 194 unsigned);
193 195
194 static sk_sp<SkColorSpace> getSkColorSpace(const CanvasColorSpace&, 196 static sk_sp<SkColorSpace> getSkColorSpace(const CanvasColorSpace&,
195 const CanvasPixelFormat&); 197 const CanvasPixelFormat&);
196 }; 198 };
197 199
198 } // namespace blink 200 } // namespace blink
199 201
200 #endif // ImageData_h 202 #endif // ImageData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698