Chromium Code Reviews| 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 (RuntimeEnabledFeatures::trueColorRenderingEnabled() || | |
| 96 RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { | |
| 97 if (value.isFloat32ImageData()) | |
|
Justin Novosad
2016/12/08 20:58:59
Would be useful to give helpful guidance to devs t
zakerinasab
2016/12/08 22:13:52
Done.
| |
| 98 return value.getAsFloat32ImageData(); | |
| 99 } | |
| 94 if (value.isImageBitmap()) | 100 if (value.isImageBitmap()) |
| 95 return value.getAsImageBitmap(); | 101 return value.getAsImageBitmap(); |
| 96 ASSERT_NOT_REACHED(); | 102 ASSERT_NOT_REACHED(); |
| 97 return nullptr; | 103 return nullptr; |
| 98 } | 104 } |
| 99 | 105 |
| 100 ScriptPromise ImageBitmapFactories::createImageBitmapFromBlob( | 106 ScriptPromise ImageBitmapFactories::createImageBitmapFromBlob( |
| 101 ScriptState* scriptState, | 107 ScriptState* scriptState, |
| 102 EventTarget& eventTarget, | 108 EventTarget& eventTarget, |
| 103 ImageBitmapSource* bitmapSource, | 109 ImageBitmapSource* bitmapSource, |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 } | 324 } |
| 319 m_factory->didFinishLoading(this); | 325 m_factory->didFinishLoading(this); |
| 320 } | 326 } |
| 321 | 327 |
| 322 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) { | 328 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) { |
| 323 visitor->trace(m_factory); | 329 visitor->trace(m_factory); |
| 324 visitor->trace(m_resolver); | 330 visitor->trace(m_resolver); |
| 325 } | 331 } |
| 326 | 332 |
| 327 } // namespace blink | 333 } // namespace blink |
| OLD | NEW |