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

Unified Diff: third_party/WebKit/Source/core/html/ImageData.cpp

Issue 2797213002: Fix BaseRenderingContext2D create/put/get-ImageData() for color managed canvas (Closed)
Patch Set: Fixing more interface listings fails Created 3 years, 8 months 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/html/ImageData.cpp
diff --git a/third_party/WebKit/Source/core/html/ImageData.cpp b/third_party/WebKit/Source/core/html/ImageData.cpp
index 91a16a09966187dfd1252198bfc0d9bac2aa5b42..beab19dfc70497b69dd47d19db49801424107443 100644
--- a/third_party/WebKit/Source/core/html/ImageData.cpp
+++ b/third_party/WebKit/Source/core/html/ImageData.cpp
@@ -280,6 +280,10 @@ ImageData* ImageData::createImageData(
unsigned height,
const ImageDataColorSettings& color_settings,
ExceptionState& exception_state) {
+ if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() ||
+ !RuntimeEnabledFeatures::colorCorrectRenderingEnabled())
+ return nullptr;
+
if (!ImageData::ValidateConstructorArguments(
kParamWidth | kParamHeight, nullptr, width, height, nullptr,
&color_settings, &exception_state))
@@ -301,7 +305,12 @@ ImageData* ImageData::createImageData(ImageDataArray& data,
unsigned height,
ImageDataColorSettings& color_settings,
ExceptionState& exception_state) {
+ if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() ||
+ !RuntimeEnabledFeatures::colorCorrectRenderingEnabled())
+ return nullptr;
+
DOMArrayBufferView* buffer_view = nullptr;
+
// When pixels data is provided, we need to override the storage format of
// ImageDataColorSettings with the one that matches the data type of the
// pixels.

Powered by Google App Engine
This is Rietveld 408576698