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

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

Issue 832953002: Cleanup: Update the path to gfx size headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 5 years, 11 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
« no previous file with comments | « printing/printed_page.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) 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 <cmath> 6 #include <cmath>
7 #include <iomanip> 7 #include <iomanip>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "skia/ext/image_operations.h" 14 #include "skia/ext/image_operations.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 #include "third_party/skia/include/core/SkBitmap.h" 16 #include "third_party/skia/include/core/SkBitmap.h"
17 #include "third_party/skia/include/core/SkRect.h" 17 #include "third_party/skia/include/core/SkRect.h"
18 #include "ui/gfx/codec/png_codec.h" 18 #include "ui/gfx/codec/png_codec.h"
19 #include "ui/gfx/size.h" 19 #include "ui/gfx/geometry/size.h"
20 20
21 namespace { 21 namespace {
22 22
23 // Computes the average pixel value for the given range, inclusive. 23 // Computes the average pixel value for the given range, inclusive.
24 uint32_t AveragePixel(const SkBitmap& bmp, 24 uint32_t AveragePixel(const SkBitmap& bmp,
25 int x_min, int x_max, 25 int x_min, int x_max,
26 int y_min, int y_max) { 26 int y_min, int y_max) {
27 float accum[4] = {0, 0, 0, 0}; 27 float accum[4] = {0, 0, 0, 0};
28 int count = 0; 28 int count = 0;
29 for (int y = y_min; y <= y_max; y++) { 29 for (int y = y_min; y <= y_max; y++) {
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f); 696 EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
697 EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f); 697 EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
698 EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f); 698 EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
699 EXPECT_LE(fabs(SkColorGetB(dst_color) - b), 1.5f); 699 EXPECT_LE(fabs(SkColorGetB(dst_color) - b), 1.5f);
700 if (HasFailure()) { 700 if (HasFailure()) {
701 return; 701 return;
702 } 702 }
703 } 703 }
704 } 704 }
705 } 705 }
OLDNEW
« no previous file with comments | « printing/printed_page.h ('k') | skia/ext/vector_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698