| 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 HTMLCanvasElement; | 24 class HTMLCanvasElement; |
| 25 class HTMLVideoElement; | 25 class HTMLVideoElement; |
| 26 class ImageData; | 26 class ImageData; |
| 27 class ImageDecoder; | 27 class ImageDecoder; |
| 28 class OffscreenCanvas; |
| 28 | 29 |
| 29 enum AlphaDisposition { | 30 enum AlphaDisposition { |
| 30 PremultiplyAlpha, | 31 PremultiplyAlpha, |
| 31 DontPremultiplyAlpha, | 32 DontPremultiplyAlpha, |
| 32 }; | 33 }; |
| 33 enum DataColorFormat { | 34 enum DataColorFormat { |
| 34 RGBAColorType, | 35 RGBAColorType, |
| 35 N32ColorType, | 36 N32ColorType, |
| 36 }; | 37 }; |
| 37 enum ColorSpaceInfoUpdate { | 38 enum ColorSpaceInfoUpdate { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 51 Optional<IntRect>, | 52 Optional<IntRect>, |
| 52 Document*, | 53 Document*, |
| 53 const ImageBitmapOptions& = ImageBitmapOptions()); | 54 const ImageBitmapOptions& = ImageBitmapOptions()); |
| 54 static ImageBitmap* create(HTMLVideoElement*, | 55 static ImageBitmap* create(HTMLVideoElement*, |
| 55 Optional<IntRect>, | 56 Optional<IntRect>, |
| 56 Document*, | 57 Document*, |
| 57 const ImageBitmapOptions& = ImageBitmapOptions()); | 58 const ImageBitmapOptions& = ImageBitmapOptions()); |
| 58 static ImageBitmap* create(HTMLCanvasElement*, | 59 static ImageBitmap* create(HTMLCanvasElement*, |
| 59 Optional<IntRect>, | 60 Optional<IntRect>, |
| 60 const ImageBitmapOptions& = ImageBitmapOptions()); | 61 const ImageBitmapOptions& = ImageBitmapOptions()); |
| 62 static ImageBitmap* create(OffscreenCanvas*, |
| 63 Optional<IntRect>, |
| 64 const ImageBitmapOptions& = ImageBitmapOptions()); |
| 61 static ImageBitmap* create(ImageData*, | 65 static ImageBitmap* create(ImageData*, |
| 62 Optional<IntRect>, | 66 Optional<IntRect>, |
| 63 const ImageBitmapOptions& = ImageBitmapOptions()); | 67 const ImageBitmapOptions& = ImageBitmapOptions()); |
| 64 static ImageBitmap* create(ImageBitmap*, | 68 static ImageBitmap* create(ImageBitmap*, |
| 65 Optional<IntRect>, | 69 Optional<IntRect>, |
| 66 const ImageBitmapOptions& = ImageBitmapOptions()); | 70 const ImageBitmapOptions& = ImageBitmapOptions()); |
| 67 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>); | 71 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>); |
| 68 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>, | 72 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>, |
| 69 Optional<IntRect>, | 73 Optional<IntRect>, |
| 70 const ImageBitmapOptions& = ImageBitmapOptions()); | 74 const ImageBitmapOptions& = ImageBitmapOptions()); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 private: | 141 private: |
| 138 ImageBitmap(HTMLImageElement*, | 142 ImageBitmap(HTMLImageElement*, |
| 139 Optional<IntRect>, | 143 Optional<IntRect>, |
| 140 Document*, | 144 Document*, |
| 141 const ImageBitmapOptions&); | 145 const ImageBitmapOptions&); |
| 142 ImageBitmap(HTMLVideoElement*, | 146 ImageBitmap(HTMLVideoElement*, |
| 143 Optional<IntRect>, | 147 Optional<IntRect>, |
| 144 Document*, | 148 Document*, |
| 145 const ImageBitmapOptions&); | 149 const ImageBitmapOptions&); |
| 146 ImageBitmap(HTMLCanvasElement*, Optional<IntRect>, const ImageBitmapOptions&); | 150 ImageBitmap(HTMLCanvasElement*, Optional<IntRect>, const ImageBitmapOptions&); |
| 151 ImageBitmap(OffscreenCanvas*, Optional<IntRect>, const ImageBitmapOptions&); |
| 147 ImageBitmap(ImageData*, Optional<IntRect>, const ImageBitmapOptions&); | 152 ImageBitmap(ImageData*, Optional<IntRect>, const ImageBitmapOptions&); |
| 148 ImageBitmap(ImageBitmap*, Optional<IntRect>, const ImageBitmapOptions&); | 153 ImageBitmap(ImageBitmap*, Optional<IntRect>, const ImageBitmapOptions&); |
| 149 ImageBitmap(PassRefPtr<StaticBitmapImage>); | 154 ImageBitmap(PassRefPtr<StaticBitmapImage>); |
| 150 ImageBitmap(PassRefPtr<StaticBitmapImage>, | 155 ImageBitmap(PassRefPtr<StaticBitmapImage>, |
| 151 Optional<IntRect>, | 156 Optional<IntRect>, |
| 152 const ImageBitmapOptions&); | 157 const ImageBitmapOptions&); |
| 153 ImageBitmap(const void* pixelData, | 158 ImageBitmap(const void* pixelData, |
| 154 uint32_t width, | 159 uint32_t width, |
| 155 uint32_t height, | 160 uint32_t height, |
| 156 bool isImageBitmapPremultiplied, | 161 bool isImageBitmapPremultiplied, |
| 157 bool isImageBitmapOriginClean); | 162 bool isImageBitmapOriginClean); |
| 158 | 163 |
| 159 RefPtr<StaticBitmapImage> m_image; | 164 RefPtr<StaticBitmapImage> m_image; |
| 160 bool m_isNeutered = false; | 165 bool m_isNeutered = false; |
| 161 }; | 166 }; |
| 162 | 167 |
| 163 } // namespace blink | 168 } // namespace blink |
| 164 | 169 |
| 165 #endif // ImageBitmap_h | 170 #endif // ImageBitmap_h |
| OLD | NEW |