116 lines
5.4 KiB
Diff
116 lines
5.4 KiB
Diff
From: thermatk <thermatk@thermatk.com>
|
|
Date: Fri, 22 Jun 2018 17:04:43 +0200
|
|
Subject: kill Vision
|
|
|
|
Barcode, face and text detection APIs
|
|
---
|
|
services/shape_detection/BUILD.gn | 4 ----
|
|
.../src/org/chromium/shape_detection/BitmapUtils.java | 12 ------------
|
|
.../shape_detection/FaceDetectionProviderImpl.java | 15 ++-------------
|
|
.../org/chromium/shape_detection/InterfaceRegistrar.java | 5 -----
|
|
4 files changed, 2 insertions(+), 34 deletions(-)
|
|
|
|
diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn
|
|
--- a/services/shape_detection/BUILD.gn
|
|
+++ b/services/shape_detection/BUILD.gn
|
|
@@ -86,14 +86,10 @@ if (is_android) {
|
|
|
|
android_library("shape_detection_java") {
|
|
java_files = [
|
|
- "android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java",
|
|
- "android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java",
|
|
"android/java/src/org/chromium/shape_detection/FaceDetectionImpl.java",
|
|
- "android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java",
|
|
"android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java",
|
|
"android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java",
|
|
"android/java/src/org/chromium/shape_detection/BitmapUtils.java",
|
|
- "android/java/src/org/chromium/shape_detection/TextDetectionImpl.java",
|
|
]
|
|
|
|
deps = [
|
|
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java
|
|
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java
|
|
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java
|
|
@@ -6,8 +6,6 @@ package org.chromium.shape_detection;
|
|
|
|
import android.graphics.Bitmap;
|
|
|
|
-import com.google.android.gms.vision.Frame;
|
|
-
|
|
import org.chromium.mojo_base.BigBufferUtil;
|
|
import org.chromium.skia.mojom.ColorType;
|
|
|
|
@@ -44,14 +42,4 @@ public class BitmapUtils {
|
|
|
|
return bitmap;
|
|
}
|
|
-
|
|
- public static Frame convertToFrame(org.chromium.skia.mojom.Bitmap bitmapData) {
|
|
- Bitmap bitmap = convertToBitmap(bitmapData);
|
|
- if (bitmap == null) {
|
|
- return null;
|
|
- }
|
|
-
|
|
- // This constructor implies a pixel format conversion to YUV.
|
|
- return new Frame.Builder().setBitmap(bitmap).build();
|
|
- }
|
|
}
|
|
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
|
|
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
|
|
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
|
|
@@ -4,9 +4,6 @@
|
|
|
|
package org.chromium.shape_detection;
|
|
|
|
-import com.google.android.gms.common.ConnectionResult;
|
|
-import com.google.android.gms.common.GoogleApiAvailability;
|
|
-
|
|
import org.chromium.base.ContextUtils;
|
|
import org.chromium.mojo.bindings.InterfaceRequest;
|
|
import org.chromium.mojo.system.MojoException;
|
|
@@ -24,16 +21,8 @@ public class FaceDetectionProviderImpl implements FaceDetectionProvider {
|
|
@Override
|
|
public void createFaceDetection(
|
|
InterfaceRequest<FaceDetection> request, FaceDetectorOptions options) {
|
|
- final boolean isGmsCoreSupported =
|
|
- GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
|
|
- ContextUtils.getApplicationContext())
|
|
- == ConnectionResult.SUCCESS;
|
|
-
|
|
- if (isGmsCoreSupported) {
|
|
- FaceDetection.MANAGER.bind(new FaceDetectionImplGmsCore(options), request);
|
|
- } else {
|
|
- FaceDetection.MANAGER.bind(new FaceDetectionImpl(options), request);
|
|
- }
|
|
+
|
|
+ FaceDetection.MANAGER.bind(new FaceDetectionImpl(options), request);
|
|
}
|
|
|
|
@Override
|
|
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
|
|
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
|
|
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
|
|
@@ -8,9 +8,7 @@ import org.chromium.base.annotations.CalledByNative;
|
|
import org.chromium.base.annotations.JNINamespace;
|
|
import org.chromium.mojo.system.impl.CoreImpl;
|
|
import org.chromium.services.service_manager.InterfaceRegistry;
|
|
-import org.chromium.shape_detection.mojom.BarcodeDetectionProvider;
|
|
import org.chromium.shape_detection.mojom.FaceDetectionProvider;
|
|
-import org.chromium.shape_detection.mojom.TextDetection;
|
|
|
|
@JNINamespace("shape_detection")
|
|
class InterfaceRegistrar {
|
|
@@ -21,9 +19,6 @@ class InterfaceRegistrar {
|
|
InterfaceRegistry registry = InterfaceRegistry.create(
|
|
CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle());
|
|
registry.addInterface(
|
|
- BarcodeDetectionProvider.MANAGER, new BarcodeDetectionProviderImpl.Factory());
|
|
- registry.addInterface(
|
|
FaceDetectionProvider.MANAGER, new FaceDetectionProviderImpl.Factory());
|
|
- registry.addInterface(TextDetection.MANAGER, new TextDetectionImpl.Factory());
|
|
}
|
|
}
|
|
--
|
|
2.11.0
|
|
|