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

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

Issue 6312156: Change includes of gfx/* to ui/gfx/* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | « remoting/host/differ.h ('k') | skia/ext/vector_canvas_unittest.cc » ('j') | 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) 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"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "gfx/codec/png_codec.h"
13 #include "skia/ext/image_operations.h" 12 #include "skia/ext/image_operations.h"
14 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
15 #include "third_party/skia/include/core/SkBitmap.h" 14 #include "third_party/skia/include/core/SkBitmap.h"
16 #include "third_party/skia/include/core/SkRect.h" 15 #include "third_party/skia/include/core/SkRect.h"
16 #include "ui/gfx/codec/png_codec.h"
17 17
18 namespace { 18 namespace {
19 19
20 // Computes the average pixel value for the given range, inclusive. 20 // Computes the average pixel value for the given range, inclusive.
21 uint32_t AveragePixel(const SkBitmap& bmp, 21 uint32_t AveragePixel(const SkBitmap& bmp,
22 int x_min, int x_max, 22 int x_min, int x_max,
23 int y_min, int y_max) { 23 int y_min, int y_max) {
24 float accum[4] = {0, 0, 0, 0}; 24 float accum[4] = {0, 0, 0, 0};
25 int count = 0; 25 int count = 0;
26 for (int y = y_min; y <= y_max; y++) { 26 for (int y = y_min; y <= y_max; y++) {
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 ADD_FAILURE() << "Maximum observed color distance: " 634 ADD_FAILURE() << "Maximum observed color distance: "
635 << max_observed_distance; 635 << max_observed_distance;
636 636
637 #if DEBUG_BITMAP_GENERATION 637 #if DEBUG_BITMAP_GENERATION
638 SaveBitmapToPNG(src, "/tmp/CompareLanczosMethods_source.png"); 638 SaveBitmapToPNG(src, "/tmp/CompareLanczosMethods_source.png");
639 SaveBitmapToPNG(dest_l2, "/tmp/CompareLanczosMethods_lanczos2.png"); 639 SaveBitmapToPNG(dest_l2, "/tmp/CompareLanczosMethods_lanczos2.png");
640 SaveBitmapToPNG(dest_l3, "/tmp/CompareLanczosMethods_lanczos3.png"); 640 SaveBitmapToPNG(dest_l3, "/tmp/CompareLanczosMethods_lanczos3.png");
641 #endif // #if DEBUG_BITMAP_GENERATION 641 #endif // #if DEBUG_BITMAP_GENERATION
642 } 642 }
643 } 643 }
OLDNEW
« no previous file with comments | « remoting/host/differ.h ('k') | skia/ext/vector_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698