Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp

Issue 2555213002: Implement color management for ImageData (Closed)
Patch Set: Addressing issues Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
index bee46e661fa85faed151a4f92cfdb62aa7729cfc..f2e7787d779413bc34b4a1db945985d2200310f9 100644
--- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
+++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
@@ -37,6 +37,7 @@
#include "core/frame/ImageBitmap.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/UseCounter.h"
+#include "core/html/Float32ImageData.h"
#include "core/html/HTMLCanvasElement.h"
#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLVideoElement.h"
@@ -92,6 +93,19 @@ static inline ImageBitmapSource* toImageBitmapSourceInternal(
return value.getAsBlob();
if (value.isImageData())
return value.getAsImageData();
+ if (value.isFloat32ImageData()) {
+ if (RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() &&
+ (RuntimeEnabledFeatures::trueColorRenderingEnabled() ||
+ RuntimeEnabledFeatures::colorCorrectRenderingEnabled())) {
+ return value.getAsFloat32ImageData();
+ }
+ exceptionState.throwDOMException(
Justin Novosad 2016/12/16 18:38:11 This should never be reached since the creation of
zakerinasab1 2016/12/19 19:57:39 Done.
+ V8TypeError,
+ "Float32ImageData is still experimental. It needs one of "
+ "enable-color-correct-rendering or enable-true-color-rendering flags "
+ "besides enable-experimental-canvas-features flag to work.");
+ }
+
if (value.isImageBitmap())
return value.getAsImageBitmap();
if (value.isOffscreenCanvas())

Powered by Google App Engine
This is Rietveld 408576698