OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 #include <iomanip> | 6 #include <iomanip> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 | 500 |
501 // RESIZE_SUBPIXEL is only supported on Linux/non-GTV platforms. | 501 // RESIZE_SUBPIXEL is only supported on Linux/non-GTV platforms. |
502 static const TestedResizeMethod tested_methods[] = { | 502 static const TestedResizeMethod tested_methods[] = { |
503 { skia::ImageOperations::RESIZE_GOOD, "GOOD", 0.0f }, | 503 { skia::ImageOperations::RESIZE_GOOD, "GOOD", 0.0f }, |
504 { skia::ImageOperations::RESIZE_BETTER, "BETTER", 0.0f }, | 504 { skia::ImageOperations::RESIZE_BETTER, "BETTER", 0.0f }, |
505 { skia::ImageOperations::RESIZE_BEST, "BEST", 0.0f }, | 505 { skia::ImageOperations::RESIZE_BEST, "BEST", 0.0f }, |
506 { skia::ImageOperations::RESIZE_BOX, "BOX", 0.0f }, | 506 { skia::ImageOperations::RESIZE_BOX, "BOX", 0.0f }, |
507 { skia::ImageOperations::RESIZE_HAMMING1, "HAMMING1", 0.0f }, | 507 { skia::ImageOperations::RESIZE_HAMMING1, "HAMMING1", 0.0f }, |
508 { skia::ImageOperations::RESIZE_LANCZOS2, "LANCZOS2", 0.0f }, | 508 { skia::ImageOperations::RESIZE_LANCZOS2, "LANCZOS2", 0.0f }, |
509 { skia::ImageOperations::RESIZE_LANCZOS3, "LANCZOS3", 0.0f }, | 509 { skia::ImageOperations::RESIZE_LANCZOS3, "LANCZOS3", 0.0f }, |
510 #if defined(OS_POSIX) && !defined(GTV) && !defined(OS_MACOSX) | 510 #if defined(OS_LINUX) && !defined(GTV) |
511 // SUBPIXEL has slightly worse performance than the other filters: | 511 // SUBPIXEL has slightly worse performance than the other filters: |
512 // 6.324 Bottom left/right corners | 512 // 6.324 Bottom left/right corners |
513 // 5.099 Top left/right corners | 513 // 5.099 Top left/right corners |
514 // 2.828 Bottom middle | 514 // 2.828 Bottom middle |
515 // 1.414 Top/Left/Right middle, center | 515 // 1.414 Top/Left/Right middle, center |
516 // | 516 // |
517 // This is expected since, in order to judge RESIZE_SUBPIXEL accurately, | 517 // This is expected since, in order to judge RESIZE_SUBPIXEL accurately, |
518 // we'd need to compute distances for each sub-pixel, and potentially | 518 // we'd need to compute distances for each sub-pixel, and potentially |
519 // tweak the test parameters so that expectations were realistic when | 519 // tweak the test parameters so that expectations were realistic when |
520 // looking at sub-pixels in isolation. | 520 // looking at sub-pixels in isolation. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 ADD_FAILURE() << "Maximum observed color distance: " | 636 ADD_FAILURE() << "Maximum observed color distance: " |
637 << max_observed_distance; | 637 << max_observed_distance; |
638 | 638 |
639 #if DEBUG_BITMAP_GENERATION | 639 #if DEBUG_BITMAP_GENERATION |
640 SaveBitmapToPNG(src, "/tmp/CompareLanczosMethods_source.png"); | 640 SaveBitmapToPNG(src, "/tmp/CompareLanczosMethods_source.png"); |
641 SaveBitmapToPNG(dest_l2, "/tmp/CompareLanczosMethods_lanczos2.png"); | 641 SaveBitmapToPNG(dest_l2, "/tmp/CompareLanczosMethods_lanczos2.png"); |
642 SaveBitmapToPNG(dest_l3, "/tmp/CompareLanczosMethods_lanczos3.png"); | 642 SaveBitmapToPNG(dest_l3, "/tmp/CompareLanczosMethods_lanczos3.png"); |
643 #endif // #if DEBUG_BITMAP_GENERATION | 643 #endif // #if DEBUG_BITMAP_GENERATION |
644 } | 644 } |
645 } | 645 } |
OLD | NEW |