diff options
author | msarett <msarett@google.com> | 2015-11-13 06:11:09 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-13 06:11:09 -0800 |
commit | 506e19a4c8395178e8da81576b3c37616593e560 (patch) | |
tree | 0877d660a91ef6322059269e7020988459e91ded /src/android/SkBitmapRegionCodec.h | |
parent | 9c8605144a0f15e3e69a4e1dcd5d3e63f339380e (diff) |
Move SkBitmapRegionDecoder to include/android and src/android
This will expose the BitmapRegionDecoder API as a public include
and move the implementation to src.
This makes this code more naturally exposed in Android and easier
to test in DM and nanobench.
BUG=skia:
Review URL: https://codereview.chromium.org/1438873002
Diffstat (limited to 'src/android/SkBitmapRegionCodec.h')
-rw-r--r-- | src/android/SkBitmapRegionCodec.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/android/SkBitmapRegionCodec.h b/src/android/SkBitmapRegionCodec.h new file mode 100644 index 0000000000..79774173b0 --- /dev/null +++ b/src/android/SkBitmapRegionCodec.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. + */ + +#include "SkBitmap.h" +#include "SkBitmapRegionDecoder.h" +#include "SkAndroidCodec.h" + +/* + * This class implements SkBitmapRegionDecoder using an SkAndroidCodec. + */ +class SkBitmapRegionCodec : public SkBitmapRegionDecoder { +public: + + /* + * Takes ownership of pointer to codec + */ + SkBitmapRegionCodec(SkAndroidCodec* codec); + + bool decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocator, + const SkIRect& desiredSubset, int sampleSize, + SkColorType colorType, bool requireUnpremul) override; + + bool conversionSupported(SkColorType colorType) override; + + SkEncodedFormat getEncodedFormat() override { return fCodec->getEncodedFormat(); } + +private: + + SkAutoTDelete<SkAndroidCodec> fCodec; + + typedef SkBitmapRegionDecoder INHERITED; + +}; |