| 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 "SkBmpCodec.h" | 8 #include "SkBmpCodec.h" |
| 9 #include "SkCodec_libico.h" | |
| 10 #include "SkCodec_libpng.h" | 9 #include "SkCodec_libpng.h" |
| 11 #include "SkCodecPriv.h" | 10 #include "SkCodecPriv.h" |
| 12 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
| 13 #include "SkData.h" | 12 #include "SkData.h" |
| 13 #include "SkIcoCodec.h" |
| 14 #include "SkStream.h" | 14 #include "SkStream.h" |
| 15 #include "SkTDArray.h" | 15 #include "SkTDArray.h" |
| 16 #include "SkTSort.h" | 16 #include "SkTSort.h" |
| 17 | 17 |
| 18 static bool ico_conversion_possible(const SkImageInfo& dstInfo) { | 18 static bool ico_conversion_possible(const SkImageInfo& dstInfo) { |
| 19 // We only support kN32_SkColorType. | 19 // We only support kN32_SkColorType. |
| 20 // This makes sense for BMP-in-ICO. The presence of an AND | 20 // This makes sense for BMP-in-ICO. The presence of an AND |
| 21 // mask (which changes colors and adds transparency) means that | 21 // mask (which changes colors and adds transparency) means that |
| 22 // we cannot use k565 or kIndex8. | 22 // we cannot use k565 or kIndex8. |
| 23 // FIXME: For PNG-in-ICO, we could technically support whichever | 23 // FIXME: For PNG-in-ICO, we could technically support whichever |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 SkCodec::SkScanlineOrder SkIcoCodec::onGetScanlineOrder() const { | 369 SkCodec::SkScanlineOrder SkIcoCodec::onGetScanlineOrder() const { |
| 370 // FIXME: This function will possibly return the wrong value if it is called | 370 // FIXME: This function will possibly return the wrong value if it is called |
| 371 // before startScanlineDecode(). | 371 // before startScanlineDecode(). |
| 372 return fCurrScanlineCodec ? fCurrScanlineCodec->getScanlineOrder() : | 372 return fCurrScanlineCodec ? fCurrScanlineCodec->getScanlineOrder() : |
| 373 INHERITED::onGetScanlineOrder(); | 373 INHERITED::onGetScanlineOrder(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 SkSampler* SkIcoCodec::getSampler(bool createIfNecessary) { | 376 SkSampler* SkIcoCodec::getSampler(bool createIfNecessary) { |
| 377 return fCurrScanlineCodec ? fCurrScanlineCodec->getSampler(createIfNecessary
) : nullptr; | 377 return fCurrScanlineCodec ? fCurrScanlineCodec->getSampler(createIfNecessary
) : nullptr; |
| 378 } | 378 } |
| OLD | NEW |