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 #ifndef SkCodec_DEFINED | 8 #ifndef SkCodec_DEFINED |
9 #define SkCodec_DEFINED | 9 #define SkCodec_DEFINED |
10 | 10 |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 /** | 519 /** |
520 * Takes ownership of SkStream* | 520 * Takes ownership of SkStream* |
521 */ | 521 */ |
522 SkCodec(int width, | 522 SkCodec(int width, |
523 int height, | 523 int height, |
524 const SkEncodedInfo&, | 524 const SkEncodedInfo&, |
525 SkStream*, | 525 SkStream*, |
526 sk_sp<SkColorSpace> = nullptr, | 526 sk_sp<SkColorSpace> = nullptr, |
527 Origin = kTopLeft_Origin); | 527 Origin = kTopLeft_Origin); |
528 | 528 |
| 529 /** |
| 530 * Takes ownership of SkStream* |
| 531 * Allows the subclass to set the recommended SkImageInfo |
| 532 */ |
| 533 SkCodec(const SkEncodedInfo&, |
| 534 const SkImageInfo&, |
| 535 SkStream*, |
| 536 Origin = kTopLeft_Origin); |
| 537 |
529 virtual SkISize onGetScaledDimensions(float /*desiredScale*/) const { | 538 virtual SkISize onGetScaledDimensions(float /*desiredScale*/) const { |
530 // By default, scaling is not supported. | 539 // By default, scaling is not supported. |
531 return this->getInfo().dimensions(); | 540 return this->getInfo().dimensions(); |
532 } | 541 } |
533 | 542 |
534 // FIXME: What to do about subsets?? | 543 // FIXME: What to do about subsets?? |
535 /** | 544 /** |
536 * Subclasses should override if they support dimensions other than the | 545 * Subclasses should override if they support dimensions other than the |
537 * srcInfo's. | 546 * srcInfo's. |
538 */ | 547 */ |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 | 729 |
721 // For testing with qcms | 730 // For testing with qcms |
722 // FIXME: Remove these when we are done comparing with qcms. | 731 // FIXME: Remove these when we are done comparing with qcms. |
723 friend class DM::ColorCodecSrc; | 732 friend class DM::ColorCodecSrc; |
724 friend class ColorCodecBench; | 733 friend class ColorCodecBench; |
725 | 734 |
726 friend class SkSampledCodec; | 735 friend class SkSampledCodec; |
727 friend class SkIcoCodec; | 736 friend class SkIcoCodec; |
728 }; | 737 }; |
729 #endif // SkCodec_DEFINED | 738 #endif // SkCodec_DEFINED |
OLD | NEW |