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

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: Addressing comments 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 7d26541bd3169eb8691f61f4141638b21d9b1d07..ce859e3c029b26355c2edffe8478eea97eeda0ca 100644
--- a/third_party/WebKit/Source/core/html/ImageData.cpp
+++ b/third_party/WebKit/Source/core/html/ImageData.cpp
@@ -277,6 +277,10 @@ ImageData* ImageData::createImageData(
unsigned height,
const ImageDataColorSettings& colorSettings,
ExceptionState& exceptionState) {
+ if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() ||
+ !RuntimeEnabledFeatures::colorCorrectRenderingEnabled())
+ return nullptr;
+
if (!ImageData::validateConstructorArguments(kParamWidth | kParamHeight,
nullptr, width, height, nullptr,
&colorSettings, &exceptionState))
@@ -298,6 +302,10 @@ ImageData* ImageData::createImageData(ImageDataArray& data,
unsigned height,
ImageDataColorSettings& colorSettings,
ExceptionState& exceptionState) {
+ if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() ||
+ !RuntimeEnabledFeatures::colorCorrectRenderingEnabled())
+ return nullptr;
+
DOMArrayBufferView* bufferView = 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

Powered by Google App Engine
This is Rietveld 408576698