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

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

Issue 2502763005: ShapeDetection: Add FaceDetectorOptions for fastMode and maxDetectedFaces (Closed)
Patch Set: 80 cols Created 4 years, 1 month 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/FaceDetector.cpp
diff --git a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
index 3c37c16418579dff55b4361b5e935562045fdc9f..b0c16fc86260b79972fa441ce3e8ff584e204c20 100644
--- a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
+++ b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
@@ -11,11 +11,18 @@
namespace blink {
-FaceDetector* FaceDetector::create(ScriptState* scriptState) {
- return new FaceDetector(*scriptState->domWindow()->frame());
+FaceDetector* FaceDetector::create(ScriptState* scriptState,
+ const FaceDetectorOptions& options) {
+ return new FaceDetector(*scriptState->domWindow()->frame(), options);
}
-FaceDetector::FaceDetector(LocalFrame& frame) : ShapeDetector(frame) {}
+FaceDetector::FaceDetector(LocalFrame& frame,
+ const FaceDetectorOptions& options)
+ : ShapeDetector(frame) {
+ m_options = mojom::blink::FaceDetectorOptions::New();
+ m_options->max_detected_faces = options.maxDetectedFaces();
+ m_options->fast_mode = options.fastMode();
Reilly Grant (use Gerrit) 2016/11/22 20:33:33 Pass options to the ShapeDetector constructor and
+}
ScriptPromise FaceDetector::detect(ScriptState* scriptState,
const CanvasImageSourceUnion& imageSource) {

Powered by Google App Engine
This is Rietveld 408576698