OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ImageBitmap_h | 5 #ifndef ImageBitmap_h |
6 #define ImageBitmap_h | 6 #define ImageBitmap_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/html/HTMLImageElement.h" | 10 #include "core/html/HTMLImageElement.h" |
11 #include "core/html/canvas/CanvasImageSource.h" | 11 #include "core/html/canvas/CanvasImageSource.h" |
12 #include "core/imagebitmap/ImageBitmapOptions.h" | 12 #include "core/imagebitmap/ImageBitmapOptions.h" |
13 #include "core/imagebitmap/ImageBitmapSource.h" | 13 #include "core/imagebitmap/ImageBitmapSource.h" |
14 #include "platform/geometry/IntRect.h" | 14 #include "platform/geometry/IntRect.h" |
15 #include "platform/graphics/Image.h" | 15 #include "platform/graphics/Image.h" |
16 #include "platform/graphics/ImageBuffer.h" | 16 #include "platform/graphics/ImageBuffer.h" |
17 #include "platform/graphics/StaticBitmapImage.h" | 17 #include "platform/graphics/StaticBitmapImage.h" |
18 #include "platform/heap/Handle.h" | 18 #include "platform/heap/Handle.h" |
19 #include "third_party/skia/include/core/SkRefCnt.h" | 19 #include "third_party/skia/include/core/SkRefCnt.h" |
20 #include "wtf/PassRefPtr.h" | 20 #include "wtf/PassRefPtr.h" |
21 #include <memory> | 21 #include <memory> |
22 | 22 |
23 namespace blink { | 23 namespace blink { |
| 24 class Float32ImageData; |
24 class HTMLCanvasElement; | 25 class HTMLCanvasElement; |
25 class HTMLVideoElement; | 26 class HTMLVideoElement; |
26 class ImageData; | 27 class ImageData; |
27 class ImageDecoder; | 28 class ImageDecoder; |
28 class OffscreenCanvas; | 29 class OffscreenCanvas; |
29 | 30 |
30 enum AlphaDisposition { | 31 enum AlphaDisposition { |
31 PremultiplyAlpha, | 32 PremultiplyAlpha, |
32 DontPremultiplyAlpha, | 33 DontPremultiplyAlpha, |
33 }; | 34 }; |
(...skipping 24 matching lines...) Expand all Loading... |
58 const ImageBitmapOptions& = ImageBitmapOptions()); | 59 const ImageBitmapOptions& = ImageBitmapOptions()); |
59 static ImageBitmap* create(HTMLCanvasElement*, | 60 static ImageBitmap* create(HTMLCanvasElement*, |
60 Optional<IntRect>, | 61 Optional<IntRect>, |
61 const ImageBitmapOptions& = ImageBitmapOptions()); | 62 const ImageBitmapOptions& = ImageBitmapOptions()); |
62 static ImageBitmap* create(OffscreenCanvas*, | 63 static ImageBitmap* create(OffscreenCanvas*, |
63 Optional<IntRect>, | 64 Optional<IntRect>, |
64 const ImageBitmapOptions& = ImageBitmapOptions()); | 65 const ImageBitmapOptions& = ImageBitmapOptions()); |
65 static ImageBitmap* create(ImageData*, | 66 static ImageBitmap* create(ImageData*, |
66 Optional<IntRect>, | 67 Optional<IntRect>, |
67 const ImageBitmapOptions& = ImageBitmapOptions()); | 68 const ImageBitmapOptions& = ImageBitmapOptions()); |
| 69 static ImageBitmap* create(Float32ImageData*, |
| 70 Optional<IntRect>, |
| 71 const ImageBitmapOptions& = ImageBitmapOptions()); |
68 static ImageBitmap* create(ImageBitmap*, | 72 static ImageBitmap* create(ImageBitmap*, |
69 Optional<IntRect>, | 73 Optional<IntRect>, |
70 const ImageBitmapOptions& = ImageBitmapOptions()); | 74 const ImageBitmapOptions& = ImageBitmapOptions()); |
71 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>); | 75 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>); |
72 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>, | 76 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>, |
73 Optional<IntRect>, | 77 Optional<IntRect>, |
74 const ImageBitmapOptions& = ImageBitmapOptions()); | 78 const ImageBitmapOptions& = ImageBitmapOptions()); |
75 // This function is called by structured-cloning an ImageBitmap. | 79 // This function is called by structured-cloning an ImageBitmap. |
76 // isImageBitmapPremultiplied indicates whether the original ImageBitmap is | 80 // isImageBitmapPremultiplied indicates whether the original ImageBitmap is |
77 // premultiplied or not. | 81 // premultiplied or not. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 Optional<IntRect>, | 147 Optional<IntRect>, |
144 Document*, | 148 Document*, |
145 const ImageBitmapOptions&); | 149 const ImageBitmapOptions&); |
146 ImageBitmap(HTMLVideoElement*, | 150 ImageBitmap(HTMLVideoElement*, |
147 Optional<IntRect>, | 151 Optional<IntRect>, |
148 Document*, | 152 Document*, |
149 const ImageBitmapOptions&); | 153 const ImageBitmapOptions&); |
150 ImageBitmap(HTMLCanvasElement*, Optional<IntRect>, const ImageBitmapOptions&); | 154 ImageBitmap(HTMLCanvasElement*, Optional<IntRect>, const ImageBitmapOptions&); |
151 ImageBitmap(OffscreenCanvas*, Optional<IntRect>, const ImageBitmapOptions&); | 155 ImageBitmap(OffscreenCanvas*, Optional<IntRect>, const ImageBitmapOptions&); |
152 ImageBitmap(ImageData*, Optional<IntRect>, const ImageBitmapOptions&); | 156 ImageBitmap(ImageData*, Optional<IntRect>, const ImageBitmapOptions&); |
| 157 ImageBitmap(Float32ImageData*, Optional<IntRect>, const ImageBitmapOptions&); |
153 ImageBitmap(ImageBitmap*, Optional<IntRect>, const ImageBitmapOptions&); | 158 ImageBitmap(ImageBitmap*, Optional<IntRect>, const ImageBitmapOptions&); |
154 ImageBitmap(PassRefPtr<StaticBitmapImage>); | 159 ImageBitmap(PassRefPtr<StaticBitmapImage>); |
155 ImageBitmap(PassRefPtr<StaticBitmapImage>, | 160 ImageBitmap(PassRefPtr<StaticBitmapImage>, |
156 Optional<IntRect>, | 161 Optional<IntRect>, |
157 const ImageBitmapOptions&); | 162 const ImageBitmapOptions&); |
158 ImageBitmap(const void* pixelData, | 163 ImageBitmap(const void* pixelData, |
159 uint32_t width, | 164 uint32_t width, |
160 uint32_t height, | 165 uint32_t height, |
161 bool isImageBitmapPremultiplied, | 166 bool isImageBitmapPremultiplied, |
162 bool isImageBitmapOriginClean); | 167 bool isImageBitmapOriginClean); |
163 | 168 |
164 RefPtr<StaticBitmapImage> m_image; | 169 RefPtr<StaticBitmapImage> m_image; |
165 bool m_isNeutered = false; | 170 bool m_isNeutered = false; |
166 }; | 171 }; |
167 | 172 |
168 } // namespace blink | 173 } // namespace blink |
169 | 174 |
170 #endif // ImageBitmap_h | 175 #endif // ImageBitmap_h |
OLD | NEW |