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

Unified Diff: services/shape_detection/face_detection_impl_mac.mm

Issue 2681913003: RELAND: ShapeDetection: use mojom::Bitmap for mojo interface. (Closed)
Patch Set: RELAND: ShapeDetection: use mojom::Bitmap for mojo interface Created 3 years, 10 months 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: services/shape_detection/face_detection_impl_mac.mm
diff --git a/services/shape_detection/face_detection_impl_mac.mm b/services/shape_detection/face_detection_impl_mac.mm
index b8539f0d2c3475c99496eaedcae991a27e05e4a3..b12bb5444dfa1a93a7a8b500a7c08747881e1b68 100644
--- a/services/shape_detection/face_detection_impl_mac.mm
+++ b/services/shape_detection/face_detection_impl_mac.mm
@@ -47,21 +47,19 @@ FaceDetectionImplMac::FaceDetectionImplMac(
FaceDetectionImplMac::~FaceDetectionImplMac() {}
-void FaceDetectionImplMac::Detect(mojo::ScopedSharedBufferHandle frame_data,
- uint32_t width,
- uint32_t height,
+void FaceDetectionImplMac::Detect(const SkBitmap& bitmap,
const DetectCallback& callback) {
media::ScopedResultCallback<DetectCallback> scoped_callback(
base::Bind(&RunCallbackWithFaces, callback),
base::Bind(&RunCallbackWithNoFaces));
- base::scoped_nsobject<CIImage> ci_image =
- CreateCIImageFromSharedMemory(std::move(frame_data), width, height);
+ base::scoped_nsobject<CIImage> ci_image = CreateCIImageFromSkBitmap(bitmap);
if (!ci_image)
return;
NSArray* const features = [detector_ featuresInImage:ci_image];
+ const int height = bitmap.height();
shape_detection::mojom::FaceDetectionResultPtr faces =
shape_detection::mojom::FaceDetectionResult::New();
for (CIFaceFeature* const f in features) {

Powered by Google App Engine
This is Rietveld 408576698