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

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

Issue 65012: Move skia to DEPS, and put it in third_party. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « skia/ext/image_operations.cc ('k') | skia/ext/skia_utils.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "skia/ext/image_operations.h" 7 #include "skia/ext/image_operations.h"
8 #include "skia/include/SkColorPriv.h"
9 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "SkColorPriv.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
11 11
12 namespace { 12 namespace {
13 13
14 // Computes the average pixel value for the given range, inclusive. 14 // Computes the average pixel value for the given range, inclusive.
15 uint32_t AveragePixel(const SkBitmap& bmp, 15 uint32_t AveragePixel(const SkBitmap& bmp,
16 int x_min, int x_max, 16 int x_min, int x_max,
17 int y_min, int y_max) { 17 int y_min, int y_max) {
18 float accum[4] = {0, 0, 0, 0}; 18 float accum[4] = {0, 0, 0, 0};
19 int count = 0; 19 int count = 0;
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 SkAutoLockPixels cropped_lock(cropped); 392 SkAutoLockPixels cropped_lock(cropped);
393 for (int y = 0; y < src_h; y++) { 393 for (int y = 0; y < src_h; y++) {
394 for (int x = 0; x < src_w; x++) { 394 for (int x = 0; x < src_w; x++) {
395 EXPECT_EQ(*src.getAddr32(x, y), 395 EXPECT_EQ(*src.getAddr32(x, y),
396 *cropped.getAddr32((x + src_w / 2) % src_w, 396 *cropped.getAddr32((x + src_w / 2) % src_w,
397 (y + src_h / 2) % src_h)); 397 (y + src_h / 2) % src_h));
398 } 398 }
399 } 399 }
400 } 400 }
401 401
OLDNEW
« no previous file with comments | « skia/ext/image_operations.cc ('k') | skia/ext/skia_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698