43182bccce
Bug: skia:10154 Once ag/11371053 lands, Android will only be referencing the new version at android::skia::BitmapRegionDecoder. Remove the old code that remained for the transition. Change-Id: Ic532d705e8f2861f56dcaa0ac1c68dd2b0712035 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291357 Commit-Queue: Leon Scroggins <scroggo@google.com> Auto-Submit: Leon Scroggins <scroggo@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
/*
|
|
* 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 BitmapRegionDecoder_DEFINED
|
|
#define BitmapRegionDecoder_DEFINED
|
|
|
|
#include "client_utils/android/BRDAllocator.h"
|
|
#include "include/codec/SkAndroidCodec.h"
|
|
#include "include/core/SkBitmap.h"
|
|
#include "include/core/SkData.h"
|
|
|
|
namespace android {
|
|
namespace skia {
|
|
|
|
class BitmapRegionDecoder final {
|
|
public:
|
|
static std::unique_ptr<BitmapRegionDecoder> Make(sk_sp<SkData> data);
|
|
|
|
bool decodeRegion(SkBitmap* bitmap, BRDAllocator* allocator,
|
|
const SkIRect& desiredSubset, int sampleSize,
|
|
SkColorType colorType, bool requireUnpremul,
|
|
sk_sp<SkColorSpace> prefColorSpace);
|
|
|
|
SkEncodedImageFormat getEncodedFormat() { return fCodec->getEncodedFormat(); }
|
|
|
|
SkColorType computeOutputColorType(SkColorType requestedColorType) {
|
|
return fCodec->computeOutputColorType(requestedColorType);
|
|
}
|
|
|
|
sk_sp<SkColorSpace> computeOutputColorSpace(SkColorType outputColorType,
|
|
sk_sp<SkColorSpace> prefColorSpace = nullptr) {
|
|
return fCodec->computeOutputColorSpace(outputColorType, prefColorSpace);
|
|
}
|
|
|
|
int width() const;
|
|
int height() const;
|
|
|
|
private:
|
|
BitmapRegionDecoder(std::unique_ptr<SkAndroidCodec> codec);
|
|
|
|
std::unique_ptr<SkAndroidCodec> fCodec;
|
|
};
|
|
|
|
} // namespace skia
|
|
} // namespace android
|
|
#endif // BitmapRegionDecoder_DEFINED
|