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