| OLD | NEW |
| 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 | 7 |
| 8 #include "SkAndroidCodec.h" | 8 #include "SkAndroidCodec.h" |
| 9 #include "SkCodec.h" | 9 #include "SkCodec.h" |
| 10 #include "SkCodecPriv.h" | 10 #include "SkCodecPriv.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 return this->getSampledDimensions(sampleSize); | 87 return this->getSampledDimensions(sampleSize); |
| 88 } | 88 } |
| 89 | 89 |
| 90 // This should perhaps call a virtual function, but currently both of our su
bclasses | 90 // This should perhaps call a virtual function, but currently both of our su
bclasses |
| 91 // want the same implementation. | 91 // want the same implementation. |
| 92 return SkISize::Make(get_scaled_dimension(subset.width(), sampleSize), | 92 return SkISize::Make(get_scaled_dimension(subset.width(), sampleSize), |
| 93 get_scaled_dimension(subset.height(), sampleSize)); | 93 get_scaled_dimension(subset.height(), sampleSize)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void*
pixels, | 96 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void*
pixels, |
| 97 size_t rowBytes, AndroidOptions* options) { | 97 size_t rowBytes, const AndroidOptions* options) { |
| 98 if (!pixels) { | 98 if (!pixels) { |
| 99 return SkCodec::kInvalidParameters; | 99 return SkCodec::kInvalidParameters; |
| 100 } | 100 } |
| 101 if (rowBytes < info.minRowBytes()) { | 101 if (rowBytes < info.minRowBytes()) { |
| 102 return SkCodec::kInvalidParameters; | 102 return SkCodec::kInvalidParameters; |
| 103 } | 103 } |
| 104 | 104 |
| 105 AndroidOptions defaultOptions; | 105 AndroidOptions defaultOptions; |
| 106 if (!options) { | 106 if (!options) { |
| 107 options = &defaultOptions; | 107 options = &defaultOptions; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 return this->onGetAndroidPixels(info, pixels, rowBytes, *options); | 123 return this->onGetAndroidPixels(info, pixels, rowBytes, *options); |
| 124 } | 124 } |
| 125 | 125 |
| 126 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void*
pixels, | 126 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void*
pixels, |
| 127 size_t rowBytes) { | 127 size_t rowBytes) { |
| 128 return this->getAndroidPixels(info, pixels, rowBytes, nullptr); | 128 return this->getAndroidPixels(info, pixels, rowBytes, nullptr); |
| 129 } | 129 } |
| OLD | NEW |