Commit 3620c48f authored by junweifu's avatar junweifu Committed by Commit Bot

ShapeDetection: Update location of landmark to a sequence of points in WebIDL

These points describe a well-defined area along the detected landmark.
The modification of Spec has been merged with PR-40[1].

[1] https://github.com/WICG/shape-detection-api/pull/40

BUG=799319

Cq-Include-Trybots: luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win10_chromium_x64_rel_ng
Change-Id: If82ed74ab3c85afd7ac525b089b17839970e89c7
Reviewed-on: https://chromium-review.googlesource.com/997760Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Junwei Fu <junwei.fu@intel.com>
Cr-Commit-Position: refs/heads/master@{#550080}
parent 729d804e
...@@ -37,7 +37,7 @@ function FaceDetectorDetectionResultTest(detectionResult, mock) { ...@@ -37,7 +37,7 @@ function FaceDetectorDetectionResultTest(detectionResult, mock) {
assert_equals(detectionResult.length, 3, "Number of faces"); assert_equals(detectionResult.length, 3, "Number of faces");
assert_equals(detectionResult[0].landmarks.length, 1, "Number of landmarks"); assert_equals(detectionResult[0].landmarks.length, 1, "Number of landmarks");
assert_object_equals(detectionResult[0].landmarks[0], assert_object_equals(detectionResult[0].landmarks[0],
{type : 'eye', location : {x : 4.0, y : 5.0}}, {type : 'eye', locations : [{x : 4.0, y : 5.0}]},
"landmark #1"); "landmark #1");
} }
......
...@@ -74,8 +74,11 @@ void FaceDetector::OnDetectFaces( ...@@ -74,8 +74,11 @@ void FaceDetector::OnDetectFaces(
Point2D location; Point2D location;
location.setX(landmark->location.x); location.setX(landmark->location.x);
location.setY(landmark->location.y); location.setY(landmark->location.y);
HeapVector<Point2D> locations;
locations.push_back(location);
Landmark web_landmark; Landmark web_landmark;
web_landmark.setLocation(location); web_landmark.setLocations(locations);
if (landmark->type == shape_detection::mojom::blink::LandmarkType::EYE) { if (landmark->type == shape_detection::mojom::blink::LandmarkType::EYE) {
web_landmark.setType("eye"); web_landmark.setType("eye");
} else if (landmark->type == } else if (landmark->type ==
......
...@@ -7,6 +7,6 @@ enum LandmarkType { "mouth", "eye" }; ...@@ -7,6 +7,6 @@ enum LandmarkType { "mouth", "eye" };
// https://wicg.github.io/shape-detection-api/#dictdef-landmark // https://wicg.github.io/shape-detection-api/#dictdef-landmark
dictionary Landmark { dictionary Landmark {
required Point2D location; required FrozenArray<Point2D> locations;
LandmarkType type; LandmarkType type;
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment