| 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 abfa2e3ddf937b308d08632890be87dd3294b2fc..31ab4ffd208a9b14092ea40e3efc019ff7a415c6 100644
|
| --- a/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
|
| +++ b/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
|
| @@ -131,7 +131,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()));
|
|
|
| @@ -224,7 +226,9 @@ ScriptPromise ShapeDetector::detectShapesOnImageBitmap(
|
| WTF::CheckedNumeric<int> allocationSize = 0;
|
| // Use |skImage|'s pixels if it has direct access to them, otherwise retrieve
|
| // them from elsewhere via copyBitmapData().
|
| - sk_sp<SkImage> skImage = imageBitmap->bitmapImage()->imageForCurrentFrame();
|
| + // TODO(ccameron): ShapeDetector can ignore color conversion.
|
| + sk_sp<SkImage> skImage = imageBitmap->bitmapImage()->imageForCurrentFrame(
|
| + ColorBehavior::transformToGlobalTarget());
|
| if (skImage->peekPixels(&pixmap)) {
|
| pixelDataPtr = static_cast<uint8_t*>(pixmap.writable_addr());
|
| allocationSize = pixmap.getSafeSize();
|
| @@ -273,7 +277,9 @@ ScriptPromise ShapeDetector::detectShapesOnVideoElement(
|
| uint8_t* pixelDataPtr = nullptr;
|
| WTF::CheckedNumeric<int> allocationSize = 0;
|
| // Use |skImage|'s pixels if it has direct access to them.
|
| - sk_sp<SkImage> skImage = image->imageForCurrentFrame();
|
| + // TODO(ccameron): ShapeDetector can ignore color conversion.
|
| + sk_sp<SkImage> skImage =
|
| + image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget());
|
| if (skImage->peekPixels(&pixmap)) {
|
| pixelDataPtr = static_cast<uint8_t*>(pixmap.writable_addr());
|
| allocationSize = pixmap.getSafeSize();
|
|
|