| 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 "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
| 9 #include "SkAndroidCodec.h" | 9 #include "SkAndroidCodec.h" |
| 10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 static bool get_decode_info(SkImageInfo* decodeInfo, SkColorType canvasColorType
, | 316 static bool get_decode_info(SkImageInfo* decodeInfo, SkColorType canvasColorType
, |
| 317 CodecSrc::DstColorType dstColorType, SkAlphaType dst
AlphaType) { | 317 CodecSrc::DstColorType dstColorType, SkAlphaType dst
AlphaType) { |
| 318 switch (dstColorType) { | 318 switch (dstColorType) { |
| 319 case CodecSrc::kIndex8_Always_DstColorType: | 319 case CodecSrc::kIndex8_Always_DstColorType: |
| 320 if (kRGB_565_SkColorType == canvasColorType) { | 320 if (kRGB_565_SkColorType == canvasColorType) { |
| 321 return false; | 321 return false; |
| 322 } | 322 } |
| 323 *decodeInfo = decodeInfo->makeColorType(kIndex_8_SkColorType); | 323 *decodeInfo = decodeInfo->makeColorType(kIndex_8_SkColorType); |
| 324 break; | 324 break; |
| 325 case CodecSrc::kGrayscale_Always_DstColorType: | 325 case CodecSrc::kGrayscale_Always_DstColorType: |
| 326 if (kRGB_565_SkColorType == canvasColorType || | 326 if (kRGB_565_SkColorType == canvasColorType) { |
| 327 kOpaque_SkAlphaType != decodeInfo->alphaType()) { | |
| 328 return false; | 327 return false; |
| 329 } | 328 } |
| 330 *decodeInfo = decodeInfo->makeColorType(kGray_8_SkColorType); | 329 *decodeInfo = decodeInfo->makeColorType(kGray_8_SkColorType); |
| 331 break; | 330 break; |
| 332 case CodecSrc::kNonNative8888_Always_DstColorType: | 331 case CodecSrc::kNonNative8888_Always_DstColorType: |
| 333 if (kRGB_565_SkColorType == canvasColorType) { | 332 if (kRGB_565_SkColorType == canvasColorType) { |
| 334 return false; | 333 return false; |
| 335 } | 334 } |
| 336 #ifdef SK_PMCOLOR_IS_RGBA | 335 #ifdef SK_PMCOLOR_IS_RGBA |
| 337 *decodeInfo = decodeInfo->makeColorType(kBGRA_8888_SkColorType); | 336 *decodeInfo = decodeInfo->makeColorType(kBGRA_8888_SkColorType); |
| (...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1457 skr.visit(i, drawsAsSingletonPictures); | 1456 skr.visit(i, drawsAsSingletonPictures); |
| 1458 } | 1457 } |
| 1459 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); | 1458 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); |
| 1460 | 1459 |
| 1461 canvas->drawPicture(macroPic); | 1460 canvas->drawPicture(macroPic); |
| 1462 return check_against_reference(bitmap, src, fSink); | 1461 return check_against_reference(bitmap, src, fSink); |
| 1463 }); | 1462 }); |
| 1464 } | 1463 } |
| 1465 | 1464 |
| 1466 } // namespace DM | 1465 } // namespace DM |
| OLD | NEW |