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 24 matching lines...) Expand all Loading... |
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/HTMLCanvasElement.h" | 40 #include "core/html/HTMLCanvasElement.h" |
41 #include "core/html/HTMLImageElement.h" | 41 #include "core/html/HTMLImageElement.h" |
42 #include "core/html/HTMLVideoElement.h" | 42 #include "core/html/HTMLVideoElement.h" |
43 #include "core/html/ImageData.h" | 43 #include "core/html/ImageData.h" |
44 #include "core/imagebitmap/ImageBitmapOptions.h" | 44 #include "core/imagebitmap/ImageBitmapOptions.h" |
| 45 #include "core/offscreencanvas/OffscreenCanvas.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" |
50 #include "platform/threading/BackgroundTaskRunner.h" | 51 #include "platform/threading/BackgroundTaskRunner.h" |
51 #include "public/platform/Platform.h" | 52 #include "public/platform/Platform.h" |
52 #include "public/platform/WebThread.h" | 53 #include "public/platform/WebThread.h" |
53 #include "public/platform/WebTraceLocation.h" | 54 #include "public/platform/WebTraceLocation.h" |
54 #include <memory> | 55 #include <memory> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(); |
94 if (value.isImageBitmap()) | 95 if (value.isImageBitmap()) |
95 return value.getAsImageBitmap(); | 96 return value.getAsImageBitmap(); |
| 97 if (value.isOffscreenCanvas()) |
| 98 return value.getAsOffscreenCanvas(); |
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, |
104 Optional<IntRect> cropRect, | 107 Optional<IntRect> cropRect, |
105 const ImageBitmapOptions& options, | 108 const ImageBitmapOptions& options, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 } | 321 } |
319 m_factory->didFinishLoading(this); | 322 m_factory->didFinishLoading(this); |
320 } | 323 } |
321 | 324 |
322 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) { | 325 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) { |
323 visitor->trace(m_factory); | 326 visitor->trace(m_factory); |
324 visitor->trace(m_resolver); | 327 visitor->trace(m_resolver); |
325 } | 328 } |
326 | 329 |
327 } // namespace blink | 330 } // namespace blink |
OLD | NEW |