[webkit-changes] [WebKit/WebKit] a13230: Create scaffolding for Shape Detection API

Myles C. Maxfield noreply at github.com
Fri Apr 14 15:50:20 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a132303fd6a0c4b8ee96b6cc986723477ffefb98
      https://github.com/WebKit/WebKit/commit/a132303fd6a0c4b8ee96b6cc986723477ffefb98
  Author: Myles C. Maxfield <mmaxfield at apple.com>
  Date:   2023-04-14 (Fri, 14 Apr 2023)

  Changed paths:
    M Source/WebCore/CMakeLists.txt
    M Source/WebCore/Modules/ShapeDetection/BarcodeDetector.cpp
    M Source/WebCore/Modules/ShapeDetection/BarcodeDetector.h
    M Source/WebCore/Modules/ShapeDetection/BarcodeDetectorOptions.h
    M Source/WebCore/Modules/ShapeDetection/BarcodeFormat.h
    M Source/WebCore/Modules/ShapeDetection/DetectedBarcode.h
    M Source/WebCore/Modules/ShapeDetection/DetectedBarcode.idl
    M Source/WebCore/Modules/ShapeDetection/DetectedFace.h
    M Source/WebCore/Modules/ShapeDetection/DetectedFace.idl
    M Source/WebCore/Modules/ShapeDetection/DetectedText.h
    M Source/WebCore/Modules/ShapeDetection/DetectedText.idl
    M Source/WebCore/Modules/ShapeDetection/FaceDetector.cpp
    M Source/WebCore/Modules/ShapeDetection/FaceDetector.h
    M Source/WebCore/Modules/ShapeDetection/FaceDetectorOptions.h
    A Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/BarcodeDetectorImplementation.h
    A Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/BarcodeDetectorImplementation.mm
    A Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/FaceDetectorImplementation.h
    A Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/FaceDetectorImplementation.mm
    A Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/TextDetectorImplementation.h
    A Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/TextDetectorImplementation.mm
    A Source/WebCore/Modules/ShapeDetection/Interfaces/BarcodeDetectorInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/BarcodeDetectorOptionsInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/BarcodeFormatInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/DetectedBarcodeInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/DetectedFaceInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/DetectedTextInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/FaceDetectorInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/FaceDetectorOptionsInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/LandmarkInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/LandmarkTypeInterface.h
    A Source/WebCore/Modules/ShapeDetection/Interfaces/TextDetectorInterface.h
    M Source/WebCore/Modules/ShapeDetection/Landmark.h
    M Source/WebCore/Modules/ShapeDetection/Landmark.idl
    M Source/WebCore/Modules/ShapeDetection/LandmarkType.h
    M Source/WebCore/Modules/ShapeDetection/Point2D.h
    M Source/WebCore/Modules/ShapeDetection/Point2D.idl
    M Source/WebCore/Modules/ShapeDetection/TextDetector.cpp
    M Source/WebCore/Modules/ShapeDetection/TextDetector.h
    M Source/WebCore/Modules/system-preview/ARKitBadgeSystemImage.h
    M Source/WebCore/Modules/system-preview/ARKitBadgeSystemImage.mm
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj

  Log Message:
  -----------
  Create scaffolding for Shape Detection API
https://bugs.webkit.org/show_bug.cgi?id=255215
rdar://107821288

Reviewed by Mike Wyrzykowski.

The implementation of the Shape Detection API needs to run in the GPU process. However, in
WebKitLegacy, it can run in-process. Therefore, we're going to have to have 2 different
implementations: one that implements the functionality directly (that the GPU process and
WebKitLegacy will use) and another one that uses IPC to forward the calls across processes.

This patch implements this by creating a virtual interface for the API. This interface will
have 2 concrete implementations, and this patch stubs out one of them. The IPC implementation
will be implemented in another patch. This virtual interface is in
Source/WebCore/Modules/ShapeDetection/Interfaces, and the stubs for the first implementation
are in Source/WebCore/Modules/ShapeDetection/Implementation.

The original classes inside Source/WebCore/Modules/ShapeDetection, which are what the IDL
files target, delegate to this virtual interface. Each one of these classes has a Ref to a
"backing" object which is an implementation of this virtual interface.

No tests because there is no behavior change.

* Source/WebCore/Modules/ShapeDetection/BarcodeDetector.cpp:
(WebCore::BarcodeDetector::create):
(WebCore::BarcodeDetector::BarcodeDetector):
(WebCore::BarcodeDetector::getSupportedFormats):
(WebCore::BarcodeDetector::detect):
* Source/WebCore/Modules/ShapeDetection/BarcodeDetector.h:
* Source/WebCore/Modules/ShapeDetection/BarcodeDetectorOptions.h:
(WebCore::BarcodeDetectorOptions::convertToBacking const):
(WebCore::convertFromBacking):
* Source/WebCore/Modules/ShapeDetection/BarcodeFormat.h:
(WebCore::convertToBacking):
(WebCore::convertFromBacking):
* Source/WebCore/Modules/ShapeDetection/DetectedBarcode.h:
(WebCore::DetectedBarcode::convertToBacking const):
(WebCore::convertFromBacking):
* Source/WebCore/Modules/ShapeDetection/DetectedBarcode.idl:
* Source/WebCore/Modules/ShapeDetection/DetectedFace.h:
(WebCore::DetectedFace::convertToBacking const):
(WebCore::convertFromBacking):
* Source/WebCore/Modules/ShapeDetection/DetectedFace.idl:
* Source/WebCore/Modules/ShapeDetection/DetectedText.h:
(WebCore::DetectedText::convertToBacking const):
(WebCore::convertFromBacking):
* Source/WebCore/Modules/ShapeDetection/DetectedText.idl:
* Source/WebCore/Modules/ShapeDetection/FaceDetector.cpp:
(WebCore::FaceDetector::create):
(WebCore::FaceDetector::FaceDetector):
(WebCore::FaceDetector::detect):
* Source/WebCore/Modules/ShapeDetection/FaceDetector.h:
* Source/WebCore/Modules/ShapeDetection/FaceDetectorOptions.h:
(WebCore::FaceDetectorOptions::convertToBacking const):
(WebCore::convertFromBacking):
* Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/BarcodeDetectorImplementation.h: Copied from Source/WebCore/Modules/ShapeDetection/BarcodeDetector.h.
* Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/BarcodeDetectorImplementation.mm: Copied from Source/WebCore/Modules/ShapeDetection/BarcodeDetector.cpp.
(WebCore::ShapeDetection::BarcodeDetectorImpl::BarcodeDetectorImpl):
(WebCore::ShapeDetection::BarcodeDetectorImpl::getSupportedFormats):
(WebCore::ShapeDetection::BarcodeDetectorImpl::detect):
* Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/FaceDetectorImplementation.h: Copied from Source/WebCore/Modules/ShapeDetection/FaceDetector.h.
* Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/FaceDetectorImplementation.mm: Copied from Source/WebCore/Modules/ShapeDetection/FaceDetector.cpp.
(WebCore::ShapeDetection::FaceDetectorImpl::FaceDetectorImpl):
(WebCore::ShapeDetection::FaceDetectorImpl::detect):
* Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/TextDetectorImplementation.h: Copied from Source/WebCore/Modules/ShapeDetection/FaceDetector.h.
* Source/WebCore/Modules/ShapeDetection/Implementation/Cocoa/TextDetectorImplementation.mm: Copied from Source/WebCore/Modules/ShapeDetection/TextDetector.cpp.
(WebCore::ShapeDetection::TextDetectorImpl::detect):
* Source/WebCore/Modules/ShapeDetection/Interfaces/BarcodeDetectorInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/BarcodeDetector.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/BarcodeDetectorOptionsInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/BarcodeDetectorOptions.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/BarcodeFormatInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/BarcodeFormat.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/DetectedBarcodeInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/DetectedBarcode.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/DetectedFaceInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/DetectedFace.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/DetectedTextInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/DetectedText.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/FaceDetectorInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/FaceDetector.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/FaceDetectorOptionsInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/FaceDetectorOptions.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/LandmarkInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/Landmark.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/LandmarkTypeInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/LandmarkType.h.
* Source/WebCore/Modules/ShapeDetection/Interfaces/TextDetectorInterface.h: Copied from Source/WebCore/Modules/ShapeDetection/TextDetector.h.
* Source/WebCore/Modules/ShapeDetection/Landmark.h:
(WebCore::Landmark::convertToBacking const):
(WebCore::convertFromBacking):
* Source/WebCore/Modules/ShapeDetection/Landmark.idl:
* Source/WebCore/Modules/ShapeDetection/LandmarkType.h:
(WebCore::convertToBacking):
(WebCore::convertFromBacking):
* Source/WebCore/Modules/ShapeDetection/Point2D.h:
(WebCore::Point2D::convertToBacking const):
(WebCore::convertFromBacking):
* Source/WebCore/Modules/ShapeDetection/Point2D.idl:
* Source/WebCore/Modules/ShapeDetection/TextDetector.cpp:
(WebCore::TextDetector::create):
(WebCore::TextDetector::TextDetector):
(WebCore::TextDetector::detect):
* Source/WebCore/Modules/ShapeDetection/TextDetector.h:
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/262994@main




More information about the webkit-changes mailing list