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

Unified Diff: third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp

Issue 2559013002: Add ColorBehavior to blink::Image draw methods (Closed)
Patch Set: Rebase 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/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()));

Powered by Google App Engine
This is Rietveld 408576698