Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: tests/CodexTest.cpp

Issue 1738913002: Enable RAW codec for Windows (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Black RAW codec tests for Win32 bots Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/codec/SkRawCodec.cpp ('k') | tools/dm_flags.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "Resources.h" 8 #include "Resources.h"
9 #include "SkAndroidCodec.h" 9 #include "SkAndroidCodec.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 check(r, "mandrill_32.png", SkISize::Make(32, 32), true, false, false); 390 check(r, "mandrill_32.png", SkISize::Make(32, 32), true, false, false);
391 check(r, "mandrill_512.png", SkISize::Make(512, 512), true, false, false); 391 check(r, "mandrill_512.png", SkISize::Make(512, 512), true, false, false);
392 check(r, "mandrill_64.png", SkISize::Make(64, 64), true, false, false); 392 check(r, "mandrill_64.png", SkISize::Make(64, 64), true, false, false);
393 check(r, "plane.png", SkISize::Make(250, 126), true, false, false); 393 check(r, "plane.png", SkISize::Make(250, 126), true, false, false);
394 // FIXME: We are not ready to test incomplete interlaced pngs 394 // FIXME: We are not ready to test incomplete interlaced pngs
395 check(r, "plane_interlaced.png", SkISize::Make(250, 126), true, false, false ); 395 check(r, "plane_interlaced.png", SkISize::Make(250, 126), true, false, false );
396 check(r, "randPixels.png", SkISize::Make(8, 8), true, false, false); 396 check(r, "randPixels.png", SkISize::Make(8, 8), true, false, false);
397 check(r, "yellow_rose.png", SkISize::Make(400, 301), true, false, false); 397 check(r, "yellow_rose.png", SkISize::Make(400, 301), true, false, false);
398 398
399 // RAW 399 // RAW
400 #if defined(SK_CODEC_DECODES_RAW) 400 // Disable RAW tests for Win32.
401 #if defined(SK_CODEC_DECODES_RAW) && (!defined(_WIN32))
401 check(r, "sample_1mp.dng", SkISize::Make(600, 338), false, false, false); 402 check(r, "sample_1mp.dng", SkISize::Make(600, 338), false, false, false);
402 check(r, "sample_1mp_rotated.dng", SkISize::Make(600, 338), false, false, fa lse); 403 check(r, "sample_1mp_rotated.dng", SkISize::Make(600, 338), false, false, fa lse);
403 check(r, "dng_with_preview.dng", SkISize::Make(600, 338), true, false, false ); 404 check(r, "dng_with_preview.dng", SkISize::Make(600, 338), true, false, false );
404 #endif 405 #endif
405 } 406 }
406 407
407 // Test interlaced PNG in stripes, similar to DM's kStripe_Mode 408 // Test interlaced PNG in stripes, similar to DM's kStripe_Mode
408 DEF_TEST(Codec_stripes, r) { 409 DEF_TEST(Codec_stripes, r) {
409 const char * path = "plane_interlaced.png"; 410 const char * path = "plane_interlaced.png";
410 SkAutoTDelete<SkStream> stream(resource(path)); 411 SkAutoTDelete<SkStream> stream(resource(path));
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 test_dimensions(r, "1x1.png"); 590 test_dimensions(r, "1x1.png");
590 test_dimensions(r, "2x2.png"); 591 test_dimensions(r, "2x2.png");
591 test_dimensions(r, "3x3.png"); 592 test_dimensions(r, "3x3.png");
592 test_dimensions(r, "3x1.png"); 593 test_dimensions(r, "3x1.png");
593 test_dimensions(r, "1x1.png"); 594 test_dimensions(r, "1x1.png");
594 test_dimensions(r, "16x1.png"); 595 test_dimensions(r, "16x1.png");
595 test_dimensions(r, "1x16.png"); 596 test_dimensions(r, "1x16.png");
596 test_dimensions(r, "mandrill_16.png"); 597 test_dimensions(r, "mandrill_16.png");
597 598
598 // RAW 599 // RAW
599 #if defined(SK_CODEC_DECODES_RAW) 600 // Disable RAW tests for Win32.
601 #if defined(SK_CODEC_DECODES_RAW) && (!defined(_WIN32))
600 test_dimensions(r, "sample_1mp.dng"); 602 test_dimensions(r, "sample_1mp.dng");
601 test_dimensions(r, "sample_1mp_rotated.dng"); 603 test_dimensions(r, "sample_1mp_rotated.dng");
602 test_dimensions(r, "dng_with_preview.dng"); 604 test_dimensions(r, "dng_with_preview.dng");
603 #endif 605 #endif
604 } 606 }
605 607
606 static void test_invalid(skiatest::Reporter* r, const char path[]) { 608 static void test_invalid(skiatest::Reporter* r, const char path[]) {
607 SkAutoTDelete<SkStream> stream(resource(path)); 609 SkAutoTDelete<SkStream> stream(resource(path));
608 if (!stream) { 610 if (!stream) {
609 SkDebugf("Missing resource '%s'\n", path); 611 SkDebugf("Missing resource '%s'\n", path);
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 bool rewind() override { 867 bool rewind() override {
866 return fStream.rewind(); 868 return fStream.rewind();
867 } 869 }
868 bool isAtEnd() const override { 870 bool isAtEnd() const override {
869 return fStream.isAtEnd(); 871 return fStream.isAtEnd();
870 } 872 }
871 private: 873 private:
872 SkMemoryStream fStream; 874 SkMemoryStream fStream;
873 }; 875 };
874 876
877 // Disable RAW tests for Win32.
878 #if defined(SK_CODEC_DECODES_RAW) && (!defined(_WIN32))
875 // Test that the RawCodec works also for not asset stream. This will test the co de path using 879 // Test that the RawCodec works also for not asset stream. This will test the co de path using
876 // SkRawBufferedStream instead of SkRawAssetStream. 880 // SkRawBufferedStream instead of SkRawAssetStream.
877 #if defined(SK_CODEC_DECODES_RAW)
878 DEF_TEST(Codec_raw_notseekable, r) { 881 DEF_TEST(Codec_raw_notseekable, r) {
879 const char* path = "dng_with_preview.dng"; 882 const char* path = "dng_with_preview.dng";
880 SkString fullPath(GetResourcePath(path)); 883 SkString fullPath(GetResourcePath(path));
881 SkAutoTUnref<SkData> data(SkData::NewFromFileName(fullPath.c_str())); 884 SkAutoTUnref<SkData> data(SkData::NewFromFileName(fullPath.c_str()));
882 if (!data) { 885 if (!data) {
883 SkDebugf("Missing resource '%s'\n", path); 886 SkDebugf("Missing resource '%s'\n", path);
884 return; 887 return;
885 } 888 }
886 889
887 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(new NotAssetMemStream(da ta))); 890 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(new NotAssetMemStream(da ta)));
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 // Now test an image which is too big. Any image with a larger header (i.e. 969 // Now test an image which is too big. Any image with a larger header (i.e.
967 // has bigger width/height) is also too big. 970 // has bigger width/height) is also too big.
968 const unsigned char tooBigWbmp[] = { 0x00, 0x00, // Header 971 const unsigned char tooBigWbmp[] = { 0x00, 0x00, // Header
969 0x84, 0x80, 0x00, // W: 65536 972 0x84, 0x80, 0x00, // W: 65536
970 0x84, 0x80, 0x00 }; // H: 65536 973 0x84, 0x80, 0x00 }; // H: 65536
971 stream.reset(new SkMemoryStream(tooBigWbmp, sizeof(tooBigWbmp), false)); 974 stream.reset(new SkMemoryStream(tooBigWbmp, sizeof(tooBigWbmp), false));
972 codec.reset(SkCodec::NewFromStream(stream.detach())); 975 codec.reset(SkCodec::NewFromStream(stream.detach()));
973 976
974 REPORTER_ASSERT(r, !codec); 977 REPORTER_ASSERT(r, !codec);
975 } 978 }
OLDNEW
« no previous file with comments | « src/codec/SkRawCodec.cpp ('k') | tools/dm_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698