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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 SkASSERT(false); | 811 SkASSERT(false); |
812 return "Invalid image generator mode"; | 812 return "Invalid image generator mode"; |
813 } | 813 } |
814 | 814 |
815 // Test deferred decoding path on GPU | 815 // Test deferred decoding path on GPU |
816 if (fIsGpu) { | 816 if (fIsGpu) { |
817 // FIXME: The gpu backend does not draw kGray sources correctly. (skbug.
com/4822) | 817 // FIXME: The gpu backend does not draw kGray sources correctly. (skbug.
com/4822) |
818 // We have disabled these tests in DM.cpp. | 818 // We have disabled these tests in DM.cpp. |
819 SkASSERT(kGray_8_SkColorType != gen->getInfo().colorType()); | 819 SkASSERT(kGray_8_SkColorType != gen->getInfo().colorType()); |
820 | 820 |
821 SkAutoTDelete<SkImage> image(SkImage::NewFromGenerator(gen.detach(), nul
lptr)); | 821 SkAutoTDelete<SkImage> image(SkImage::NewFromGenerator(gen.release(), nu
llptr)); |
822 if (!image) { | 822 if (!image) { |
823 return "Could not create image from codec image generator."; | 823 return "Could not create image from codec image generator."; |
824 } | 824 } |
825 canvas->drawImage(image, 0, 0); | 825 canvas->drawImage(image, 0, 0); |
826 return ""; | 826 return ""; |
827 } | 827 } |
828 | 828 |
829 // Test various color and alpha types on CPU | 829 // Test various color and alpha types on CPU |
830 SkImageInfo decodeInfo = gen->getInfo().makeAlphaType(fDstAlphaType); | 830 SkImageInfo decodeInfo = gen->getInfo().makeAlphaType(fDstAlphaType); |
831 | 831 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1495 skr.visit<void>(i, drawsAsSingletonPictures); | 1495 skr.visit<void>(i, drawsAsSingletonPictures); |
1496 } | 1496 } |
1497 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); | 1497 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); |
1498 | 1498 |
1499 canvas->drawPicture(macroPic); | 1499 canvas->drawPicture(macroPic); |
1500 return check_against_reference(bitmap, src, fSink); | 1500 return check_against_reference(bitmap, src, fSink); |
1501 }); | 1501 }); |
1502 } | 1502 } |
1503 | 1503 |
1504 } // namespace DM | 1504 } // namespace DM |
OLD | NEW |