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

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

Issue 2797213002: Fix BaseRenderingContext2D create/put/get-ImageData() for color managed canvas (Closed)
Patch Set: Rebaseline Created 3 years, 7 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 static ImageData* Create(unsigned width, unsigned height, ExceptionState&); 84 static ImageData* Create(unsigned width, unsigned height, ExceptionState&);
85 static ImageData* Create(NotShared<DOMUint8ClampedArray>, 85 static ImageData* Create(NotShared<DOMUint8ClampedArray>,
86 unsigned width, 86 unsigned width,
87 ExceptionState&); 87 ExceptionState&);
88 static ImageData* Create(NotShared<DOMUint8ClampedArray>, 88 static ImageData* Create(NotShared<DOMUint8ClampedArray>,
89 unsigned width, 89 unsigned width,
90 unsigned height, 90 unsigned height,
91 ExceptionState&); 91 ExceptionState&);
92 92
93 ImageData* createImageData(unsigned width, 93 static ImageData* CreateImageData(unsigned width,
94 unsigned height, 94 unsigned height,
95 const ImageDataColorSettings&, 95 const ImageDataColorSettings&,
96 ExceptionState&); 96 ExceptionState&);
97 ImageData* createImageData(ImageDataArray&, 97 static ImageData* CreateImageData(ImageDataArray&,
98 unsigned width, 98 unsigned width,
99 unsigned height, 99 unsigned height,
100 ImageDataColorSettings&, 100 ImageDataColorSettings&,
101 ExceptionState&); 101 ExceptionState&);
102 102
103 void getColorSettings(ImageDataColorSettings& result) { 103 void getColorSettings(ImageDataColorSettings& result) {
104 result = color_settings_; 104 result = color_settings_;
105 } 105 }
106 106
107 static ImageData* CreateForTest(const IntSize&); 107 static ImageData* CreateForTest(const IntSize&);
108 static ImageData* CreateForTest(const IntSize&, 108 static ImageData* CreateForTest(const IntSize&,
109 DOMArrayBufferView*, 109 DOMArrayBufferView*,
110 const ImageDataColorSettings* = nullptr); 110 const ImageDataColorSettings* = nullptr);
111 static sk_sp<SkColorSpace> GetSkColorSpaceForTest(const CanvasColorSpace&, 111 static sk_sp<SkColorSpace> GetSkColorSpaceForTest(const CanvasColorSpace&,
(...skipping 12 matching lines...) Expand all
124 IntSize Size() const { return size_; } 124 IntSize Size() const { return size_; }
125 int width() const { return size_.Width(); } 125 int width() const { return size_.Width(); }
126 int height() const { return size_.Height(); } 126 int height() const { return size_.Height(); }
127 127
128 DOMUint8ClampedArray* data(); 128 DOMUint8ClampedArray* data();
129 const DOMUint8ClampedArray* data() const; 129 const DOMUint8ClampedArray* data() const;
130 ImageDataArray& dataUnion() { return data_union_; } 130 ImageDataArray& dataUnion() { return data_union_; }
131 const ImageDataArray& dataUnion() const { return data_union_; } 131 const ImageDataArray& dataUnion() const { return data_union_; }
132 void dataUnion(ImageDataArray& result) { result = data_union_; }; 132 void dataUnion(ImageDataArray& result) { result = data_union_; };
133 133
134 DOMArrayBufferBase* BufferBase() const;
135
134 sk_sp<SkColorSpace> GetSkColorSpace(); 136 sk_sp<SkColorSpace> GetSkColorSpace();
135 bool ImageDataInCanvasColorSettings(const CanvasColorSpace&, 137 bool ImageDataInCanvasColorSettings(const CanvasColorSpace&,
136 const CanvasPixelFormat&, 138 const CanvasPixelFormat&,
137 std::unique_ptr<uint8_t[]>&); 139 std::unique_ptr<uint8_t[]>&);
138 140
139 // ImageBitmapSource implementation 141 // ImageBitmapSource implementation
140 IntSize BitmapSourceSize() const override { return size_; } 142 IntSize BitmapSourceSize() const override { return size_; }
141 ScriptPromise CreateImageBitmap(ScriptState*, 143 ScriptPromise CreateImageBitmap(ScriptState*,
142 EventTarget&, 144 EventTarget&,
143 Optional<IntRect> crop_rect, 145 Optional<IntRect> crop_rect,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 static DOMFloat32Array* ConvertFloat16ArrayToFloat32Array(const uint16_t*, 194 static DOMFloat32Array* ConvertFloat16ArrayToFloat32Array(const uint16_t*,
193 unsigned); 195 unsigned);
194 196
195 static sk_sp<SkColorSpace> GetSkColorSpace(const CanvasColorSpace&, 197 static sk_sp<SkColorSpace> GetSkColorSpace(const CanvasColorSpace&,
196 const CanvasPixelFormat&); 198 const CanvasPixelFormat&);
197 }; 199 };
198 200
199 } // namespace blink 201 } // namespace blink
200 202
201 #endif // ImageData_h 203 #endif // ImageData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698