Roll external/skia c244c2fbb..60c0c8fcd (5 commits)
https://skia.googlesource.com/skia.git/+log/c244c2fbb..60c0c8fcd
2018-11-09 mtklein@google.com remove unused typedef
2018-11-09 halcanary@google.com SkQP: script: fix non-existant build path
2018-11-09 reed@google.com remove guards for hinting in google3
2018-11-09 nathanrogers@google.com Fix another typo in SkSize comments
2018-11-09 nigeltao@google.com Merge SkFooAdapterCodec impls into one impl
The AutoRoll server is located here: https://autoroll-internal.skia.org/r/android-master-autoroll
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.
Test: Presubmit checks will test this change.
Change-Id: If0bafd657dcdb57c787368f70e282dc2ca922577
Exempt-From-Owner-Approval: The autoroll bot does not require owner approval.
diff --git a/Android.bp b/Android.bp
index 5caae3b..c90e1b8 100644
--- a/Android.bp
+++ b/Android.bp
@@ -91,6 +91,7 @@
"src/c/sk_paint.cpp",
"src/c/sk_surface.cpp",
"src/codec/SkAndroidCodec.cpp",
+ "src/codec/SkAndroidCodecAdapter.cpp",
"src/codec/SkBmpBaseCodec.cpp",
"src/codec/SkBmpCodec.cpp",
"src/codec/SkBmpMaskCodec.cpp",
@@ -109,14 +110,12 @@
"src/codec/SkMaskSwizzler.cpp",
"src/codec/SkMasks.cpp",
"src/codec/SkPngCodec.cpp",
- "src/codec/SkRawAdapterCodec.cpp",
"src/codec/SkRawCodec.cpp",
"src/codec/SkSampledCodec.cpp",
"src/codec/SkSampler.cpp",
"src/codec/SkStreamBuffer.cpp",
"src/codec/SkSwizzler.cpp",
"src/codec/SkWbmpCodec.cpp",
- "src/codec/SkWebpAdapterCodec.cpp",
"src/codec/SkWebpCodec.cpp",
"src/core/SkAAClip.cpp",
"src/core/SkATrace.cpp",
diff --git a/BUILD.gn b/BUILD.gn
index e58a6e1..c889c8b 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -721,7 +721,6 @@
configs_to_remove = [ "//gn:no_exceptions" ]
sources = [
- "src/codec/SkRawAdapterCodec.cpp",
"src/codec/SkRawCodec.cpp",
]
}
@@ -762,7 +761,6 @@
"//third_party/libwebp",
]
sources = [
- "src/codec/SkWebpAdapterCodec.cpp",
"src/codec/SkWebpCodec.cpp",
"src/images/SkWebpEncoder.cpp",
]
@@ -879,6 +877,7 @@
"src/android/SkBitmapRegionCodec.cpp",
"src/android/SkBitmapRegionDecoder.cpp",
"src/codec/SkAndroidCodec.cpp",
+ "src/codec/SkAndroidCodecAdapter.cpp",
"src/codec/SkBmpBaseCodec.cpp",
"src/codec/SkBmpCodec.cpp",
"src/codec/SkBmpMaskCodec.cpp",
diff --git a/include/core/SkSize.h b/include/core/SkSize.h
index 4486e36..9e87114 100644
--- a/include/core/SkSize.h
+++ b/include/core/SkSize.h
@@ -66,7 +66,7 @@
*/
bool isZero() const { return 0 == fWidth && 0 == fHeight; }
- /** Returns true if either widht or height are <= 0 */
+ /** Returns true if either width or height are <= 0 */
bool isEmpty() const { return fWidth <= 0 || fHeight <= 0; }
/** Set the width and height to 0 */
diff --git a/public.bzl b/public.bzl
index fdcf980..703f400 100644
--- a/public.bzl
+++ b/public.bzl
@@ -602,8 +602,6 @@
"SK_DISABLE_LOWP_RASTER_PIPELINE",
# JPEG is in codec_limited
"SK_HAS_JPEG_LIBRARY",
- "SK_SUPPORT_LEGACY_NONCLASS_HINTINGENUM",
- "SK_SUPPORT_LEGACY_NESTED_HINTINGENUM",
] + skia_select(
os_conditions,
[
diff --git a/src/codec/SkAndroidCodec.cpp b/src/codec/SkAndroidCodec.cpp
index 10d19f3..581640f 100644
--- a/src/codec/SkAndroidCodec.cpp
+++ b/src/codec/SkAndroidCodec.cpp
@@ -6,14 +6,13 @@
*/
#include "SkAndroidCodec.h"
+#include "SkAndroidCodecAdapter.h"
#include "SkCodec.h"
#include "SkCodecPriv.h"
#include "SkMakeUnique.h"
#include "SkPixmap.h"
#include "SkPixmapPriv.h"
-#include "SkRawAdapterCodec.h"
#include "SkSampledCodec.h"
-#include "SkWebpAdapterCodec.h"
static bool is_valid_sample_size(int sampleSize) {
// FIXME: As Leon has mentioned elsewhere, surely there is also a maximum sampleSize?
@@ -97,16 +96,17 @@
case SkEncodedImageFormat::kWBMP:
case SkEncodedImageFormat::kHEIF:
return skstd::make_unique<SkSampledCodec>(codec.release(), orientationBehavior);
+
#ifdef SK_HAS_WEBP_LIBRARY
case SkEncodedImageFormat::kWEBP:
- return skstd::make_unique<SkWebpAdapterCodec>((SkWebpCodec*) codec.release(),
- orientationBehavior);
#endif
#ifdef SK_CODEC_DECODES_RAW
case SkEncodedImageFormat::kDNG:
- return skstd::make_unique<SkRawAdapterCodec>((SkRawCodec*)codec.release(),
- orientationBehavior);
#endif
+#if defined(SK_HAS_WEBP_LIBRARY) || defined(SK_CODEC_DECODES_RAW)
+ return skstd::make_unique<SkAndroidCodecAdapter>(codec.release(), orientationBehavior);
+#endif
+
default:
return nullptr;
}
diff --git a/src/codec/SkWebpAdapterCodec.cpp b/src/codec/SkAndroidCodecAdapter.cpp
similarity index 62%
rename from src/codec/SkWebpAdapterCodec.cpp
rename to src/codec/SkAndroidCodecAdapter.cpp
index 79a99a7..7f882e1 100644
--- a/src/codec/SkWebpAdapterCodec.cpp
+++ b/src/codec/SkAndroidCodecAdapter.cpp
@@ -5,24 +5,23 @@
* found in the LICENSE file.
*/
-#include "SkCodec.h"
+#include "SkAndroidCodecAdapter.h"
#include "SkCodecPriv.h"
-#include "SkWebpAdapterCodec.h"
-SkWebpAdapterCodec::SkWebpAdapterCodec(SkWebpCodec* codec, ExifOrientationBehavior behavior)
+SkAndroidCodecAdapter::SkAndroidCodecAdapter(SkCodec* codec, ExifOrientationBehavior behavior)
: INHERITED(codec, behavior)
{}
-SkISize SkWebpAdapterCodec::onGetSampledDimensions(int sampleSize) const {
+SkISize SkAndroidCodecAdapter::onGetSampledDimensions(int sampleSize) const {
float scale = get_scale_from_sample_size(sampleSize);
return this->codec()->getScaledDimensions(scale);
}
-bool SkWebpAdapterCodec::onGetSupportedSubset(SkIRect* desiredSubset) const {
+bool SkAndroidCodecAdapter::onGetSupportedSubset(SkIRect* desiredSubset) const {
return this->codec()->getValidSubset(desiredSubset);
}
-SkCodec::Result SkWebpAdapterCodec::onGetAndroidPixels(const SkImageInfo& info, void* pixels,
+SkCodec::Result SkAndroidCodecAdapter::onGetAndroidPixels(const SkImageInfo& info, void* pixels,
size_t rowBytes, const AndroidOptions& options) {
SkCodec::Options codecOptions;
codecOptions.fZeroInitialized = options.fZeroInitialized;
diff --git a/src/codec/SkAndroidCodecAdapter.h b/src/codec/SkAndroidCodecAdapter.h
new file mode 100644
index 0000000..ac494c9
--- /dev/null
+++ b/src/codec/SkAndroidCodecAdapter.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SkAndroidCodecAdapter_DEFINED
+#define SkAndroidCodecAdapter_DEFINED
+
+#include "SkAndroidCodec.h"
+
+/**
+ * This class wraps SkCodec to implement the functionality of SkAndroidCodec.
+ * The underlying SkCodec implements sampled decodes. SkCodec's that do not
+ * implement that are wrapped with SkSampledCodec instead.
+ */
+class SkAndroidCodecAdapter : public SkAndroidCodec {
+public:
+
+ explicit SkAndroidCodecAdapter(SkCodec*, ExifOrientationBehavior);
+
+ ~SkAndroidCodecAdapter() override {}
+
+protected:
+
+ SkISize onGetSampledDimensions(int sampleSize) const override;
+
+ bool onGetSupportedSubset(SkIRect* desiredSubset) const override;
+
+ SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
+ const AndroidOptions& options) override;
+
+private:
+
+ typedef SkAndroidCodec INHERITED;
+};
+#endif // SkAndroidCodecAdapter_DEFINED
diff --git a/src/codec/SkRawAdapterCodec.cpp b/src/codec/SkRawAdapterCodec.cpp
deleted file mode 100644
index d4b3149..0000000
--- a/src/codec/SkRawAdapterCodec.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkCodec.h"
-#include "SkCodecPriv.h"
-#include "SkRawAdapterCodec.h"
-
-SkRawAdapterCodec::SkRawAdapterCodec(SkRawCodec* codec, ExifOrientationBehavior behavior)
- : INHERITED(codec, behavior)
-{}
-
-SkISize SkRawAdapterCodec::onGetSampledDimensions(int sampleSize) const {
- float scale = 1.f / static_cast<float>(sampleSize);
- return this->codec()->getScaledDimensions(scale);
-}
-
-SkCodec::Result SkRawAdapterCodec::onGetAndroidPixels(
- const SkImageInfo& info, void* pixels, size_t rowBytes,
- const AndroidOptions& options) {
- SkCodec::Options codecOptions;
- codecOptions.fZeroInitialized = options.fZeroInitialized;
- codecOptions.fSubset = options.fSubset;
- return this->codec()->getPixels(info, pixels, rowBytes, &codecOptions);
-}
diff --git a/src/codec/SkRawAdapterCodec.h b/src/codec/SkRawAdapterCodec.h
deleted file mode 100644
index d4828ce..0000000
--- a/src/codec/SkRawAdapterCodec.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkRawAdapterCodec_DEFINED
-#define SkRawAdapterCodec_DEFINED
-
-#include "SkAndroidCodec.h"
-#include "SkCodec.h"
-#include "SkEncodedImageFormat.h"
-#include "SkRawCodec.h"
-#include "SkStream.h"
-#include "SkTypes.h"
-
-/**
- * This class implements the functionality of SkAndroidCodec. It uses an
- * SkRawCodec.
- */
-class SkRawAdapterCodec : public SkAndroidCodec {
-public:
- explicit SkRawAdapterCodec(SkRawCodec*, ExifOrientationBehavior);
-
- ~SkRawAdapterCodec() override {}
-
-protected:
-
- SkISize onGetSampledDimensions(int sampleSize) const override;
-
- bool onGetSupportedSubset(SkIRect* /*desiredSubset*/) const override { return false; }
-
- SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
- const AndroidOptions& options) override;
-
-private:
-
- typedef SkAndroidCodec INHERITED;
-};
-#endif // SkRawAdapterCodec_DEFINED
diff --git a/src/codec/SkWebpAdapterCodec.h b/src/codec/SkWebpAdapterCodec.h
deleted file mode 100644
index fc8328c..0000000
--- a/src/codec/SkWebpAdapterCodec.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifndef SkWebpAdapterCodec_DEFINED
-#define SkWebpAdapterCodec_DEFINED
-
-#include "SkAndroidCodec.h"
-#include "SkWebpCodec.h"
-
-/**
- * This class implements the functionality of SkAndroidCodec. It uses an
- * SkWebpCodec.
- */
-class SkWebpAdapterCodec : public SkAndroidCodec {
-public:
-
- explicit SkWebpAdapterCodec(SkWebpCodec*, ExifOrientationBehavior);
-
- ~SkWebpAdapterCodec() override {}
-
-protected:
-
- SkISize onGetSampledDimensions(int sampleSize) const override;
-
- bool onGetSupportedSubset(SkIRect* desiredSubset) const override;
-
- SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
- const AndroidOptions& options) override;
-
-private:
-
- typedef SkAndroidCodec INHERITED;
-};
-#endif // SkWebpAdapterCodec_DEFINED
diff --git a/src/core/SkBlitMask.h b/src/core/SkBlitMask.h
index 5c4838d..916da50 100644
--- a/src/core/SkBlitMask.h
+++ b/src/core/SkBlitMask.h
@@ -22,15 +22,6 @@
const SkIRect& clip, SkColor color);
/**
- * Function pointer that blits the mask into a device (dst) colorized
- * by color. The number of pixels to blit is specified by width and height,
- * but each scanline is offset by dstRB (rowbytes) and srcRB respectively.
- */
- typedef void (*ColorProc)(void* dst, size_t dstRB,
- const void* mask, size_t maskRB,
- SkColor color, int width, int height);
-
- /**
* Function pointer that blits a row of mask(lcd16) into a row of dst
* colorized by a single color. The number of pixels to blit is specified
* by width.
diff --git a/tools/skqp/make_universal_apk.py b/tools/skqp/make_universal_apk.py
index 4d84efe..029238f 100755
--- a/tools/skqp/make_universal_apk.py
+++ b/tools/skqp/make_universal_apk.py
@@ -84,11 +84,14 @@
assert os.path.exists(android_ndk)
assert os.path.exists(android_home)
assert os.path.exists(skia_dir)
- assert os.path.exists(build_dir)
assert architectures
assert all(arch in skia_to_android_arch_name_map
for arch in architectures)
+ for d in [build_dir, final_output_dir]:
+ if not os.path.exists(d):
+ os.makedirs(d)
+
os.chdir(skia_dir)
apps_dir = 'platform_tools/android/apps'
@@ -205,6 +208,7 @@
('SKQP_BUILD_DIR', build_dir),
('Architectures', architectures)]:
sys.stdout.write('%s = %r\n' % (k, v))
+ sys.stdout.flush()
make_apk(architectures,
android_ndk,
android_home,