| Issue 670977 | ShapeDetection detect() doesn't support canvas object | ||
| Starred by 1 user | Project Member Reported by paulkin...@google.com, Dec 3 | Back to list | |
Demo: https://output.jsbin.com/xovuset Passing in a canvas into `detect` causes a NotFoundError: Unsupported source. Expected result: not throwing the error (as per spec) :)
,
Dec 8
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7d0018f762087ab6624de7dd09cf15207dda57c6 commit 7d0018f762087ab6624de7dd09cf15207dda57c6 Author: mcasas <mcasas@chromium.org> Date: Thu Dec 08 02:12:42 2016 ShapeDetection: add support for all CanvasImageSource input types Currently ShapeDetector::detectFacesOn{ImageBitmap,Videoelement}() extract the pixels out of the corresponding object; I haven't noticed that CanvasImageSource::getSourceImageForCanvas() is a virtual method, implemented for each CanvasImageSource, doing exactly what I needed, which is extracting an WTF::Image. getSourceImageForCanvas() implementations have the same checks being performed on ToT now, so swapping one for the other is not reducing the early-bail outs. So, this CL factors out the code to use getSourceImageForCanvas(), making the Shape Detection detect() work for all these different input types, and adds LayoutTests for them. BUG= 670977 , 659138 Review-Url: https://codereview.chromium.org/2553343003 Cr-Commit-Position: refs/heads/master@{#437144} [add] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLCanvasElement.html [modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html [modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLVideoElement.html [modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-ImageBitmap.html [modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-options.html [modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp [modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.h
,
Dec 8
|
|||
| ► Sign in to add a comment | |||
Labels: ShapeDetection