Move SkBitmapRegionCodec into client_utils/android
Bug: skia:10154
This will make it clear that these files are for Android use and
avoid compiling them for other clients.
Update testing tools to use android::skia::BitmapRegionDecoder, but
only if SK_ENABLE_ANDROID_UTILS is defined.
Take this opportunity to clean up the class:
- The base class, which was originally designed to allow switching
amongst different implementations, is no longer needed. Rename
SkBitmapRegionCodec to android::skia::BitmapRegionDecoder
(following the new convention and matching the Java API name).
Continue to inherit from SkBitmapRegionDecoder temporarily, to
allow Android to switch to the new API.
- Use std::unique_ptr instead of passing raw pointers.
Add a test to verify that we only create a BitmapRegionDecoder if
it is one of the supported types.
Change-Id: Ied13fc8acb105fde042553331846d95ae15d6b57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287498
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 33dbc35..333995d 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -275,9 +275,16 @@
optional("android_utils") {
enabled = skia_enable_android_utils
- public = [ "client_utils/android/FrontBufferedStream.h" ]
+ public = [
+ "client_utils/android/BRDAllocator.h",
+ "client_utils/android/BitmapRegionDecoder.h",
+ "client_utils/android/FrontBufferedStream.h",
+ ]
public_defines = [ "SK_ENABLE_ANDROID_UTILS" ]
- sources = [ "client_utils/android/FrontBufferedStream.cpp" ]
+ sources = [
+ "client_utils/android/BitmapRegionDecoder.cpp",
+ "client_utils/android/FrontBufferedStream.cpp",
+ ]
}
optional("fontmgr_android") {
@@ -922,7 +929,6 @@
sources += [
"src/android/SkAndroidFrameworkUtils.cpp",
"src/android/SkAnimatedImage.cpp",
- "src/android/SkBitmapRegionCodec.cpp",
"src/android/SkBitmapRegionDecoder.cpp",
"src/codec/SkAndroidCodec.cpp",
"src/codec/SkAndroidCodecAdapter.cpp",