| 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 "SkCodec.h" | 8 #include "SkCodec.h" |
| 9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
| 10 #include "SkSampledCodec.h" | 10 #include "SkSampledCodec.h" |
| 11 | 11 |
| 12 // FIXME: Rename this file to SkSampledCodec.cpp | |
| 13 | |
| 14 SkSampledCodec::SkSampledCodec(SkCodec* codec) | 12 SkSampledCodec::SkSampledCodec(SkCodec* codec) |
| 15 : INHERITED(codec->getInfo()) | 13 : INHERITED(codec->getInfo()) |
| 16 , fCodec(codec) | 14 , fCodec(codec) |
| 17 {} | 15 {} |
| 18 | 16 |
| 19 SkISize SkSampledCodec::onGetSampledDimensions(int sampleSize) const { | 17 SkISize SkSampledCodec::onGetSampledDimensions(int sampleSize) const { |
| 20 // Fast path for when we are not scaling. | 18 // Fast path for when we are not scaling. |
| 21 if (1 == sampleSize) { | 19 if (1 == sampleSize) { |
| 22 return fCodec->getInfo().dimensions(); | 20 return fCodec->getInfo().dimensions(); |
| 23 } | 21 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // fCodec has already handled filling uninitialized memory. | 203 // fCodec has already handled filling uninitialized memory. |
| 206 return SkCodec::kIncompleteInput; | 204 return SkCodec::kIncompleteInput; |
| 207 } | 205 } |
| 208 return SkCodec::kSuccess; | 206 return SkCodec::kSuccess; |
| 209 } | 207 } |
| 210 default: | 208 default: |
| 211 SkASSERT(false); | 209 SkASSERT(false); |
| 212 return SkCodec::kUnimplemented; | 210 return SkCodec::kUnimplemented; |
| 213 } | 211 } |
| 214 } | 212 } |
| OLD | NEW |