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

Unified Diff: services/shape_detection/text_detection_impl_mac.mm

Issue 2755393002: Revert of RELAND: ShapeDetection: use mojom::Bitmap for mojo interface. (Closed)
Patch Set: Created 3 years, 9 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/text_detection_impl_mac.mm
diff --git a/services/shape_detection/text_detection_impl_mac.mm b/services/shape_detection/text_detection_impl_mac.mm
index 45d8d4639523410d3d92f0298eadce0a6fb88d4e..3894770ada51c1c4a0e20e75e3a7341d5c1197cc 100644
--- a/services/shape_detection/text_detection_impl_mac.mm
+++ b/services/shape_detection/text_detection_impl_mac.mm
@@ -48,20 +48,22 @@
TextDetectionImplMac::~TextDetectionImplMac() {}
-void TextDetectionImplMac::Detect(const SkBitmap& bitmap,
+void TextDetectionImplMac::Detect(mojo::ScopedSharedBufferHandle frame_data,
+ uint32_t width,
+ uint32_t height,
const DetectCallback& callback) {
DCHECK(base::mac::IsAtLeastOS10_11());
media::ScopedResultCallback<DetectCallback> scoped_callback(
base::Bind(&RunCallbackWithResults, callback),
base::Bind(&RunCallbackWithNoResults));
- base::scoped_nsobject<CIImage> ci_image = CreateCIImageFromSkBitmap(bitmap);
+ base::scoped_nsobject<CIImage> ci_image =
+ CreateCIImageFromSharedMemory(std::move(frame_data), width, height);
if (!ci_image)
return;
NSArray* const features = [detector_ featuresInImage:ci_image];
- const int height = bitmap.height();
std::vector<mojom::TextDetectionResultPtr> results;
for (CIRectangleFeature* const f in features) {
// CIRectangleFeature only has bounding box information.
« no previous file with comments | « services/shape_detection/text_detection_impl_mac.h ('k') | services/shape_detection/text_detection_impl_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698