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

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

Issue 1411693005: Make AndroidOptions const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/SkAndroidCodec.cpp ('k') | src/codec/SkSampledCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #ifndef SkSampledCodec_DEFINED 7 #ifndef SkSampledCodec_DEFINED
8 #define SkSampledCodec_DEFINED 8 #define SkSampledCodec_DEFINED
9 9
10 #include "SkAndroidCodec.h" 10 #include "SkAndroidCodec.h"
(...skipping 12 matching lines...) Expand all
23 23
24 protected: 24 protected:
25 25
26 SkEncodedFormat onGetEncodedFormat() const override { return fCodec->getEnco dedFormat(); }; 26 SkEncodedFormat onGetEncodedFormat() const override { return fCodec->getEnco dedFormat(); };
27 27
28 SkISize onGetSampledDimensions(int sampleSize) const override; 28 SkISize onGetSampledDimensions(int sampleSize) const override;
29 29
30 bool onGetSupportedSubset(SkIRect* desiredSubset) const override { return tr ue; } 30 bool onGetSupportedSubset(SkIRect* desiredSubset) const override { return tr ue; }
31 31
32 SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, si ze_t rowBytes, 32 SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, si ze_t rowBytes,
33 AndroidOptions& options) override; 33 const AndroidOptions& options) override;
34 34
35 private: 35 private:
36 /** 36 /**
37 * Find the best way to account for native scaling. 37 * Find the best way to account for native scaling.
38 * 38 *
39 * Return a size that fCodec can scale to, and adjust sampleSize to finish scaling. 39 * Return a size that fCodec can scale to, and adjust sampleSize to finish scaling.
40 * 40 *
41 * @param sampleSize As an input, the requested sample size. 41 * @param sampleSize As an input, the requested sample size.
42 * As an output, sampling needed after letting fCodec 42 * As an output, sampling needed after letting fCodec
43 * scale to the returned dimensions. 43 * scale to the returned dimensions.
44 * @param nativeSampleSize Optional output parameter. Will be set to the 44 * @param nativeSampleSize Optional output parameter. Will be set to the
45 * effective sample size done by fCodec. 45 * effective sample size done by fCodec.
46 * @return SkISize The size that fCodec should scale to. 46 * @return SkISize The size that fCodec should scale to.
47 */ 47 */
48 SkISize accountForNativeScaling(int* sampleSize, int* nativeSampleSize = nul lptr) const; 48 SkISize accountForNativeScaling(int* sampleSize, int* nativeSampleSize = nul lptr) const;
49 49
50 /** 50 /**
51 * This fulfills the same contract as onGetAndroidPixels(). 51 * This fulfills the same contract as onGetAndroidPixels().
52 * 52 *
53 * We call this function from onGetAndroidPixels() if we have determined 53 * We call this function from onGetAndroidPixels() if we have determined
54 * that fCodec does not support the requested scale, and we need to 54 * that fCodec does not support the requested scale, and we need to
55 * provide the scale by sampling. 55 * provide the scale by sampling.
56 */ 56 */
57 SkCodec::Result sampledDecode(const SkImageInfo& info, void* pixels, size_t rowBytes, 57 SkCodec::Result sampledDecode(const SkImageInfo& info, void* pixels, size_t rowBytes,
58 AndroidOptions& options); 58 const AndroidOptions& options);
59 59
60 SkAutoTDelete<SkCodec> fCodec; 60 SkAutoTDelete<SkCodec> fCodec;
61 61
62 typedef SkAndroidCodec INHERITED; 62 typedef SkAndroidCodec INHERITED;
63 }; 63 };
64 #endif // SkSampledCodec_DEFINED 64 #endif // SkSampledCodec_DEFINED
OLDNEW
« no previous file with comments | « src/codec/SkAndroidCodec.cpp ('k') | src/codec/SkSampledCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698