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

Unified Diff: third_party/WebKit/Source/modules/shapedetection/ShapeDetector.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/ShapeDetector.cpp
diff --git a/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
index 53d95c579b351bd130f9c5bb63937ec230c6091c..d5b57cdffc33fcc85ec2548b8ba971a09598a782 100644
--- a/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
+++ b/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
@@ -166,7 +166,7 @@ ScriptPromise ShapeDetector::detectShapesOnImageElement(
if (detectorType == DetectorType::Face) {
m_service->DetectFaces(
std::move(sharedBufferHandle), img->naturalWidth(),
- img->naturalHeight(),
+ img->naturalHeight(), m_options.Clone(),
convertToBaseCallback(WTF::bind(&ShapeDetector::onDetectFaces,
wrapPersistent(this),
wrapPersistent(resolver))));
@@ -306,7 +306,7 @@ ScriptPromise ShapeDetector::detectShapesOnData(DetectorType detectorType,
DCHECK(m_service.is_bound());
if (detectorType == DetectorType::Face) {
m_service->DetectFaces(
- std::move(sharedBufferHandle), width, height,
+ std::move(sharedBufferHandle), width, height, m_options.Clone(),
convertToBaseCallback(WTF::bind(&ShapeDetector::onDetectFaces,
wrapPersistent(this),
wrapPersistent(resolver))));
@@ -330,7 +330,7 @@ void ShapeDetector::onDetectFaces(
return;
HeapVector<Member<DOMRect>> detectedFaces;
- for (const auto& boundingBox : faceDetectionResult->boundingBoxes) {
+ for (const auto& boundingBox : faceDetectionResult->bounding_boxes) {
detectedFaces.append(DOMRect::create(boundingBox->x, boundingBox->y,
boundingBox->width,
boundingBox->height));

Powered by Google App Engine
This is Rietveld 408576698