Make AndroidOptions const
Make the struct passed to SkAndroidCodec::getAndroidPixels const. This matches SkCodec, and makes sense, since it is not used as an output. Brought up in crrev.com/1417583009 Review URL: https://codereview.chromium.org/1411693005
This commit is contained in:
parent
07b41eb962
commit
e95a06883b
@ -192,7 +192,7 @@ public:
|
||||
// this getPixels() when it is a slightly different API than SkCodec's getPixels().
|
||||
// Maybe this should be decode() or decodeSubset()?
|
||||
SkCodec::Result getAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
|
||||
AndroidOptions* options);
|
||||
const AndroidOptions* options);
|
||||
|
||||
/**
|
||||
* Simplified version of getAndroidPixels() where we supply the default AndroidOptions.
|
||||
@ -213,7 +213,7 @@ protected:
|
||||
virtual bool onGetSupportedSubset(SkIRect* desiredSubset) const = 0;
|
||||
|
||||
virtual SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels,
|
||||
size_t rowBytes, AndroidOptions& options) = 0;
|
||||
size_t rowBytes, const AndroidOptions& options) = 0;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -94,7 +94,7 @@ SkISize SkAndroidCodec::getSampledSubsetDimensions(int sampleSize, const SkIRect
|
||||
}
|
||||
|
||||
SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void* pixels,
|
||||
size_t rowBytes, AndroidOptions* options) {
|
||||
size_t rowBytes, const AndroidOptions* options) {
|
||||
if (!pixels) {
|
||||
return SkCodec::kInvalidParameters;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ SkISize SkSampledCodec::onGetSampledDimensions(int sampleSize) const {
|
||||
}
|
||||
|
||||
SkCodec::Result SkSampledCodec::onGetAndroidPixels(const SkImageInfo& info, void* pixels,
|
||||
size_t rowBytes, AndroidOptions& options) {
|
||||
size_t rowBytes, const AndroidOptions& options) {
|
||||
// Create an Options struct for the codec.
|
||||
SkCodec::Options codecOptions;
|
||||
codecOptions.fZeroInitialized = options.fZeroInitialized;
|
||||
@ -135,7 +135,7 @@ SkCodec::Result SkSampledCodec::onGetAndroidPixels(const SkImageInfo& info, void
|
||||
|
||||
|
||||
SkCodec::Result SkSampledCodec::sampledDecode(const SkImageInfo& info, void* pixels,
|
||||
size_t rowBytes, AndroidOptions& options) {
|
||||
size_t rowBytes, const AndroidOptions& options) {
|
||||
// We should only call this function when sampling.
|
||||
SkASSERT(options.fSampleSize > 1);
|
||||
|
||||
|
@ -30,7 +30,7 @@ protected:
|
||||
bool onGetSupportedSubset(SkIRect* desiredSubset) const override { return true; }
|
||||
|
||||
SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
|
||||
AndroidOptions& options) override;
|
||||
const AndroidOptions& options) override;
|
||||
|
||||
private:
|
||||
/**
|
||||
@ -55,7 +55,7 @@ private:
|
||||
* provide the scale by sampling.
|
||||
*/
|
||||
SkCodec::Result sampledDecode(const SkImageInfo& info, void* pixels, size_t rowBytes,
|
||||
AndroidOptions& options);
|
||||
const AndroidOptions& options);
|
||||
|
||||
SkAutoTDelete<SkCodec> fCodec;
|
||||
|
||||
|
@ -24,7 +24,7 @@ bool SkWebpAdapterCodec::onGetSupportedSubset(SkIRect* desiredSubset) const {
|
||||
}
|
||||
|
||||
SkCodec::Result SkWebpAdapterCodec::onGetAndroidPixels(const SkImageInfo& info, void* pixels,
|
||||
size_t rowBytes, AndroidOptions& options) {
|
||||
size_t rowBytes, const AndroidOptions& options) {
|
||||
// SkWebpCodec will support pretty much any dimensions that we provide, but we want
|
||||
// to be stricter about the type of scaling that we allow, so we will add an extra
|
||||
// check here.
|
||||
|
@ -30,7 +30,7 @@ protected:
|
||||
bool onGetSupportedSubset(SkIRect* desiredSubset) const override;
|
||||
|
||||
SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
|
||||
AndroidOptions& options) override;
|
||||
const AndroidOptions& options) override;
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user