Index: third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp |
diff --git a/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp |
index 4da8d7c02e90cd38f14dc4171cd7228afb774127..52c1d8313eff16e72dffef65ab728458e69000b5 100644 |
--- a/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp |
+++ b/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp |
@@ -109,7 +109,9 @@ ScriptPromise ShapeDetector::detect(ScriptState* scriptState, |
uint8_t* pixelDataPtr = nullptr; |
WTF::CheckedNumeric<int> allocationSize = 0; |
- sk_sp<SkImage> skImage = image->imageForCurrentFrame(); |
+ // TODO(ccameron): ShapeDetector can ignore color conversion. |
+ sk_sp<SkImage> skImage = |
+ image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget()); |
// Use |skImage|'s pixels if it has direct access to them. |
if (skImage->peekPixels(&pixmap)) { |
pixelDataPtr = static_cast<uint8_t*>(pixmap.writable_addr()); |
@@ -163,7 +165,9 @@ ScriptPromise ShapeDetector::detectShapesOnImageElement( |
return promise; |
} |
- const sk_sp<SkImage> image = blinkImage->imageForCurrentFrame(); |
+ // TODO(ccameron): ShapeDetector can ignore color conversion. |
+ const sk_sp<SkImage> image = blinkImage->imageForCurrentFrame( |
+ ColorBehavior::transformToGlobalTarget()); |
DCHECK_EQ(img->naturalWidth(), static_cast<unsigned>(image->width())); |
DCHECK_EQ(img->naturalHeight(), static_cast<unsigned>(image->height())); |