OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 #include "core/imagebitmap/ImageBitmapFactories.h" | 31 #include "core/imagebitmap/ImageBitmapFactories.h" |
32 | 32 |
33 #include "bindings/core/v8/ExceptionState.h" | 33 #include "bindings/core/v8/ExceptionState.h" |
34 #include "core/dom/DOMException.h" | 34 #include "core/dom/DOMException.h" |
35 #include "core/dom/ExecutionContext.h" | 35 #include "core/dom/ExecutionContext.h" |
36 #include "core/fileapi/Blob.h" | 36 #include "core/fileapi/Blob.h" |
37 #include "core/frame/ImageBitmap.h" | 37 #include "core/frame/ImageBitmap.h" |
38 #include "core/frame/LocalDOMWindow.h" | 38 #include "core/frame/LocalDOMWindow.h" |
39 #include "core/frame/UseCounter.h" | 39 #include "core/frame/UseCounter.h" |
40 #include "core/html/Float32ImageData.h" | |
40 #include "core/html/HTMLCanvasElement.h" | 41 #include "core/html/HTMLCanvasElement.h" |
41 #include "core/html/HTMLImageElement.h" | 42 #include "core/html/HTMLImageElement.h" |
42 #include "core/html/HTMLVideoElement.h" | 43 #include "core/html/HTMLVideoElement.h" |
43 #include "core/html/ImageData.h" | 44 #include "core/html/ImageData.h" |
44 #include "core/imagebitmap/ImageBitmapOptions.h" | 45 #include "core/imagebitmap/ImageBitmapOptions.h" |
45 #include "core/svg/graphics/SVGImage.h" | 46 #include "core/svg/graphics/SVGImage.h" |
46 #include "core/workers/WorkerGlobalScope.h" | 47 #include "core/workers/WorkerGlobalScope.h" |
47 #include "platform/CrossThreadFunctional.h" | 48 #include "platform/CrossThreadFunctional.h" |
48 #include "platform/SharedBuffer.h" | 49 #include "platform/SharedBuffer.h" |
49 #include "platform/image-decoders/ImageDecoder.h" | 50 #include "platform/image-decoders/ImageDecoder.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 return imageElement; | 85 return imageElement; |
85 } | 86 } |
86 if (value.isHTMLVideoElement()) | 87 if (value.isHTMLVideoElement()) |
87 return value.getAsHTMLVideoElement(); | 88 return value.getAsHTMLVideoElement(); |
88 if (value.isHTMLCanvasElement()) | 89 if (value.isHTMLCanvasElement()) |
89 return value.getAsHTMLCanvasElement(); | 90 return value.getAsHTMLCanvasElement(); |
90 if (value.isBlob()) | 91 if (value.isBlob()) |
91 return value.getAsBlob(); | 92 return value.getAsBlob(); |
92 if (value.isImageData()) | 93 if (value.isImageData()) |
93 return value.getAsImageData(); | 94 return value.getAsImageData(); |
95 if (value.isFloat32ImageData()) | |
96 return value.getAsFloat32ImageData(); | |
Justin Novosad
2016/12/08 18:16:35
should have a DCHECK on the runtim flag that expos
zakerinasab
2016/12/08 20:40:52
Done.
| |
94 if (value.isImageBitmap()) | 97 if (value.isImageBitmap()) |
95 return value.getAsImageBitmap(); | 98 return value.getAsImageBitmap(); |
96 ASSERT_NOT_REACHED(); | 99 ASSERT_NOT_REACHED(); |
97 return nullptr; | 100 return nullptr; |
98 } | 101 } |
99 | 102 |
100 ScriptPromise ImageBitmapFactories::createImageBitmapFromBlob( | 103 ScriptPromise ImageBitmapFactories::createImageBitmapFromBlob( |
101 ScriptState* scriptState, | 104 ScriptState* scriptState, |
102 EventTarget& eventTarget, | 105 EventTarget& eventTarget, |
103 ImageBitmapSource* bitmapSource, | 106 ImageBitmapSource* bitmapSource, |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 } | 323 } |
321 m_factory->didFinishLoading(this); | 324 m_factory->didFinishLoading(this); |
322 } | 325 } |
323 | 326 |
324 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) { | 327 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) { |
325 visitor->trace(m_factory); | 328 visitor->trace(m_factory); |
326 visitor->trace(m_resolver); | 329 visitor->trace(m_resolver); |
327 } | 330 } |
328 | 331 |
329 } // namespace blink | 332 } // namespace blink |
OLD | NEW |