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

Side by Side Diff: skia/ext/image_operations_unittest.cc

Issue 10827051: [Android] Fix ImageOperations.ResizeShouldAverageColors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_POSIX) && !defined(GTV) && !defined(OS_MACOSX) && !defined(OS_AND ROID)
Nico 2012/07/26 20:05:45 80 cols
Yaron 2012/07/26 20:15:54 Done.
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698