| 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 "CrashHandler.h" | 8 #include "CrashHandler.h" |
| 9 #include "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
| 10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 // SkScaledCodec Scales | 318 // SkScaledCodec Scales |
| 319 // The native scales are included to make sure that SkScaledCodec defaults t
o the native | 319 // The native scales are included to make sure that SkScaledCodec defaults t
o the native |
| 320 // scaling strategy when possible. | 320 // scaling strategy when possible. |
| 321 // 0.1, 0.16, 0.2 etc allow us to test SkScaledCodec with sampleSize 10, 6,
5, etc. | 321 // 0.1, 0.16, 0.2 etc allow us to test SkScaledCodec with sampleSize 10, 6,
5, etc. |
| 322 // 0.4, 0.7 etc allow to test what happens when the client requests a scale
that | 322 // 0.4, 0.7 etc allow to test what happens when the client requests a scale
that |
| 323 // does not exactly match a sampleSize or native scaling capability. | 323 // does not exactly match a sampleSize or native scaling capability. |
| 324 const float samplingScales[] = { 0.1f, 0.125f, 0.167f, 0.2f, 0.25f, 0.333f,
0.375f, 0.4f, 0.5f, | 324 const float samplingScales[] = { 0.1f, 0.125f, 0.167f, 0.2f, 0.25f, 0.333f,
0.375f, 0.4f, 0.5f, |
| 325 0.6f, 0.625f, 0.750f, 0.8f, 0.875f, 1.0f }; | 325 0.6f, 0.625f, 0.750f, 0.8f, 0.875f, 1.0f }; |
| 326 | 326 |
| 327 for (float scale : samplingScales) { | 327 for (float scale : samplingScales) { |
| 328 if (scale != 1.0f && (path.endsWith(".webp") || path.endsWith(".WEBP")))
{ | |
| 329 // FIXME: skbug.com/4038 Scaling webp seems to leave some pixels uni
nitialized/ | |
| 330 // compute their colors based on uninitialized values. | |
| 331 continue; | |
| 332 } | |
| 333 | |
| 334 for (uint32_t i = 0; i < numColorTypes; i++) { | 328 for (uint32_t i = 0; i < numColorTypes; i++) { |
| 335 push_codec_src(path, CodecSrc::kScaledCodec_Mode, colorTypes[i], sca
le); | 329 push_codec_src(path, CodecSrc::kScaledCodec_Mode, colorTypes[i], sca
le); |
| 336 } | 330 } |
| 337 } | 331 } |
| 338 } | 332 } |
| 339 | 333 |
| 340 static bool brd_color_type_supported(SkBitmapRegionDecoderInterface::Strategy st
rategy, | 334 static bool brd_color_type_supported(SkBitmapRegionDecoderInterface::Strategy st
rategy, |
| 341 CodecSrc::DstColorType dstColorType) { | 335 CodecSrc::DstColorType dstColorType) { |
| 342 switch (strategy) { | 336 switch (strategy) { |
| 343 case SkBitmapRegionDecoderInterface::kCanvas_Strategy: | 337 case SkBitmapRegionDecoderInterface::kCanvas_Strategy: |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 #endif // SK_PDF_IMAGE_STATS | 1102 #endif // SK_PDF_IMAGE_STATS |
| 1109 return 0; | 1103 return 0; |
| 1110 } | 1104 } |
| 1111 | 1105 |
| 1112 #if !defined(SK_BUILD_FOR_IOS) | 1106 #if !defined(SK_BUILD_FOR_IOS) |
| 1113 int main(int argc, char** argv) { | 1107 int main(int argc, char** argv) { |
| 1114 SkCommandLineFlags::Parse(argc, argv); | 1108 SkCommandLineFlags::Parse(argc, argv); |
| 1115 return dm_main(); | 1109 return dm_main(); |
| 1116 } | 1110 } |
| 1117 #endif | 1111 #endif |
| OLD | NEW |