Commit a94dd8da authored by Robert Sesek's avatar Robert Sesek Committed by Chromium LUCI CQ

mac: Remove code to support OS X 10.10 in //services/shape_detection

Bug: 1153883
Change-Id: Ic1e2dc39b96c2c5ed1e80c4732e1a2dcee02b675
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2571801Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833422}
parent 08e07eab
......@@ -18,7 +18,7 @@
namespace shape_detection {
class API_AVAILABLE(macosx(10.10)) BarcodeDetectionImplMac
class BarcodeDetectionImplMac
: public shape_detection::mojom::BarcodeDetection {
public:
BarcodeDetectionImplMac();
......
......@@ -120,11 +120,6 @@ TEST_P(BarcodeDetectionImplMacTest, ScanOneBarcode) {
}
impl_ = GetParam().factory.Run(mojom::BarcodeDetectorOptions::New());
if (!impl_) {
LOG(WARNING) << "Barcode Detection is not supported before Mac OSX 10.10."
<< "Skipping test.";
return;
}
// Generate a barcode image as a CIImage by using |qr_code_generator|.
NSData* const qr_code_data =
......
......@@ -4,7 +4,6 @@
#include "services/shape_detection/text_detection_impl_mac.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
......@@ -17,11 +16,8 @@ namespace shape_detection {
// static
void TextDetectionImpl::Create(
mojo::PendingReceiver<mojom::TextDetection> receiver) {
// Text detection needs at least MAC OS X 10.11.
if (@available(macOS 10.11, *)) {
mojo::MakeSelfOwnedReceiver(std::make_unique<TextDetectionImplMac>(),
std::move(receiver));
}
}
TextDetectionImplMac::TextDetectionImplMac() {
......@@ -35,8 +31,6 @@ TextDetectionImplMac::~TextDetectionImplMac() {}
void TextDetectionImplMac::Detect(const SkBitmap& bitmap,
DetectCallback callback) {
DCHECK(base::mac::IsAtLeastOS10_11());
base::scoped_nsobject<CIImage> ci_image = CreateCIImageFromSkBitmap(bitmap);
if (!ci_image) {
std::move(callback).Run({});
......
......@@ -41,14 +41,12 @@ TEST_F(TextDetectionImplMacTest, CreateAndDestroy) {}
// This test generates an image with a single text line and scans it back.
TEST_F(TextDetectionImplMacTest, ScanOnce) {
// Text detection needs at least MAC OS X 10.11, and GPU infrastructure.
// Text detection needs GPU infrastructure.
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseGpuInTests) ||
!base::mac::IsAtLeastOS10_11()) {
switches::kUseGpuInTests)) {
return;
}
if (@available(macOS 10.11, *)) {
impl_.reset(new TextDetectionImplMac);
base::ScopedCFTypeRef<CGColorSpaceRef> rgb_colorspace(
CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB));
......@@ -65,8 +63,8 @@ TEST_F(TextDetectionImplMacTest, ScanOnce) {
CGContextFillRect(context, CGRectMake(0.0, 0.0, width, height));
// Create a line of Helvetica 16 text, and draw it in the |context|.
base::scoped_nsobject<NSFont> helvetica(
[NSFont fontWithName:@"Helvetica" size:16]);
base::scoped_nsobject<NSFont> helvetica([NSFont fontWithName:@"Helvetica"
size:16]);
NSDictionary* attributes = [NSDictionary
dictionaryWithObjectsAndKeys:helvetica, kCTFontAttributeName, nil];
......@@ -98,7 +96,6 @@ TEST_F(TextDetectionImplMacTest, ScanOnce) {
base::Unretained(this)));
run_loop.Run();
}
}
} // shape_detection namespace
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