| OLD | NEW | 
|     1 /* |     1 /* | 
|     2  * Copyright 2013 Google Inc. |     2  * Copyright 2013 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 "DMJsonWriter.h" |     8 #include "DMJsonWriter.h" | 
|     9 #include "DMSrcSink.h" |     9 #include "DMSrcSink.h" | 
|    10 #include "DMSrcSinkAndroid.h" |    10 #include "DMSrcSinkAndroid.h" | 
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   297 #if defined(SK_BUILD_FOR_WIN32) |   297 #if defined(SK_BUILD_FOR_WIN32) | 
|   298     static const char* kNewline = "\r\n"; |   298     static const char* kNewline = "\r\n"; | 
|   299 #else |   299 #else | 
|   300     static const char* kNewline = "\n"; |   300     static const char* kNewline = "\n"; | 
|   301 #endif |   301 #endif | 
|   302  |   302  | 
|   303 static SkTHashSet<SkString> gUninterestingHashes; |   303 static SkTHashSet<SkString> gUninterestingHashes; | 
|   304  |   304  | 
|   305 static void gather_uninteresting_hashes() { |   305 static void gather_uninteresting_hashes() { | 
|   306     if (!FLAGS_uninterestingHashesFile.isEmpty()) { |   306     if (!FLAGS_uninterestingHashesFile.isEmpty()) { | 
|   307         SkAutoTUnref<SkData> data(SkData::NewFromFileName(FLAGS_uninterestingHas
      hesFile[0])); |   307         sk_sp<SkData> data(SkData::MakeFromFileName(FLAGS_uninterestingHashesFil
      e[0])); | 
|   308         if (!data) { |   308         if (!data) { | 
|   309             info("WARNING: unable to read uninteresting hashes from %s\n", |   309             info("WARNING: unable to read uninteresting hashes from %s\n", | 
|   310                  FLAGS_uninterestingHashesFile[0]); |   310                  FLAGS_uninterestingHashesFile[0]); | 
|   311             return; |   311             return; | 
|   312         } |   312         } | 
|   313         SkTArray<SkString> hashes; |   313         SkTArray<SkString> hashes; | 
|   314         SkStrSplit((const char*)data->data(), kNewline, &hashes); |   314         SkStrSplit((const char*)data->data(), kNewline, &hashes); | 
|   315         for (const SkString& hash : hashes) { |   315         for (const SkString& hash : hashes) { | 
|   316             gUninterestingHashes.add(hash); |   316             gUninterestingHashes.add(hash); | 
|   317         } |   317         } | 
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   482             default: |   482             default: | 
|   483                 break; |   483                 break; | 
|   484         } |   484         } | 
|   485     } |   485     } | 
|   486  |   486  | 
|   487     ImageGenSrc* src = new ImageGenSrc(path, mode, alphaType, isGpu); |   487     ImageGenSrc* src = new ImageGenSrc(path, mode, alphaType, isGpu); | 
|   488     push_src("image", folder, src); |   488     push_src("image", folder, src); | 
|   489 } |   489 } | 
|   490  |   490  | 
|   491 static void push_codec_srcs(Path path) { |   491 static void push_codec_srcs(Path path) { | 
|   492     SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str())); |   492     sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str())); | 
|   493     if (!encoded) { |   493     if (!encoded) { | 
|   494         info("Couldn't read %s.", path.c_str()); |   494         info("Couldn't read %s.", path.c_str()); | 
|   495         return; |   495         return; | 
|   496     } |   496     } | 
|   497     SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded)); |   497     SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get())); | 
|   498     if (nullptr == codec.get()) { |   498     if (nullptr == codec.get()) { | 
|   499         info("Couldn't create codec for %s.", path.c_str()); |   499         info("Couldn't create codec for %s.", path.c_str()); | 
|   500         return; |   500         return; | 
|   501     } |   501     } | 
|   502  |   502  | 
|   503     // native scaling is only supported by WEBP and JPEG |   503     // native scaling is only supported by WEBP and JPEG | 
|   504     bool supportsNativeScaling = false; |   504     bool supportsNativeScaling = false; | 
|   505  |   505  | 
|   506     SkTArray<CodecSrc::Mode> nativeModes; |   506     SkTArray<CodecSrc::Mode> nativeModes; | 
|   507     nativeModes.push_back(CodecSrc::kCodec_Mode); |   507     nativeModes.push_back(CodecSrc::kCodec_Mode); | 
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1435 #endif |  1435 #endif | 
|  1436 } |  1436 } | 
|  1437 } // namespace skiatest |  1437 } // namespace skiatest | 
|  1438  |  1438  | 
|  1439 #if !defined(SK_BUILD_FOR_IOS) |  1439 #if !defined(SK_BUILD_FOR_IOS) | 
|  1440 int main(int argc, char** argv) { |  1440 int main(int argc, char** argv) { | 
|  1441     SkCommandLineFlags::Parse(argc, argv); |  1441     SkCommandLineFlags::Parse(argc, argv); | 
|  1442     return dm_main(); |  1442     return dm_main(); | 
|  1443 } |  1443 } | 
|  1444 #endif |  1444 #endif | 
| OLD | NEW |