Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: src/codec/SkSampledCodec.h

Issue 1406223002: Create an SkAndroidCodec API separate from SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Win bot fix Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/codec/SkMaskSwizzler.cpp ('k') | src/codec/SkScaledCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7 #ifndef SkSampledCodec_DEFINED
8 #define SkSampledCodec_DEFINED
9
10 #include "SkAndroidCodec.h"
11 #include "SkCodec.h"
12
13 /**
14 * This class implements the functionality of SkAndroidCodec. Scaling will
15 * be provided by sampling if it cannot be provided by fCodec.
16 */
17 class SkSampledCodec : public SkAndroidCodec {
18 public:
19
20 explicit SkSampledCodec(SkCodec*);
21
22 virtual ~SkSampledCodec() {}
23
24 protected:
25
26 SkEncodedFormat onGetEncodedFormat() const override { return fCodec->getEnco dedFormat(); };
27
28 SkISize onGetSampledDimensions(int sampleSize) const override;
29
30 bool onGetSupportedSubset(SkIRect* desiredSubset) const override { return tr ue; }
31
32 SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, si ze_t rowBytes,
33 AndroidOptions& options) override;
34
35 private:
36
37 /**
38 * This fulfills the same contract as onGetAndroidPixels().
39 *
40 * We call this function from onGetAndroidPixels() if we have determined
41 * that fCodec does not support the requested scale, and we need to
42 * provide the scale by sampling.
43 */
44 SkCodec::Result sampledDecode(const SkImageInfo& info, void* pixels, size_t rowBytes,
45 AndroidOptions& options);
46
47 SkAutoTDelete<SkCodec> fCodec;
48
49 typedef SkAndroidCodec INHERITED;
50 };
51 #endif // SkSampledCodec_DEFINED
OLDNEW
« no previous file with comments | « src/codec/SkMaskSwizzler.cpp ('k') | src/codec/SkScaledCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698