summaryrefslogtreecommitdiffstats
path: root/skia/ext/image_operations_unittest.cc
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 16:16:35 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 16:16:35 +0000
commitc4b347b36152d693f2914f13c3b6f83f16a6d9b8 (patch)
tree9ef3b6ea138959fb4f59f97a791c0c4c4efebecd /skia/ext/image_operations_unittest.cc
parentf3750b3846cc639d75046be16826ff1cf109d76e (diff)
downloadchromium_src-c4b347b36152d693f2914f13c3b6f83f16a6d9b8.zip
chromium_src-c4b347b36152d693f2914f13c3b6f83f16a6d9b8.tar.gz
chromium_src-c4b347b36152d693f2914f13c3b6f83f16a6d9b8.tar.bz2
Reverting 6709,6708,6706.
Review URL: http://codereview.chromium.org/13345 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/image_operations_unittest.cc')
-rw-r--r--skia/ext/image_operations_unittest.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/skia/ext/image_operations_unittest.cc b/skia/ext/image_operations_unittest.cc
index c8f365f..e6ecda9 100644
--- a/skia/ext/image_operations_unittest.cc
+++ b/skia/ext/image_operations_unittest.cc
@@ -6,9 +6,7 @@
#include "skia/ext/image_operations.h"
#include "testing/gtest/include/gtest/gtest.h"
-
#include "SkBitmap.h"
-#include "SkRect.h"
namespace {
@@ -69,8 +67,8 @@ TEST(ImageOperations, Halve) {
FillDataToBitmap(src_w, src_h, &src);
// Do a halving of the full bitmap.
- SkBitmap actual_results = skia::ImageOperations::Resize(
- src, skia::ImageOperations::RESIZE_BOX, src_w / 2, src_h / 2);
+ SkBitmap actual_results = gfx::ImageOperations::Resize(
+ src, gfx::ImageOperations::RESIZE_BOX, gfx::Size(src_w / 2, src_h / 2));
ASSERT_EQ(src_w / 2, actual_results.width());
ASSERT_EQ(src_h / 2, actual_results.height());
@@ -98,17 +96,17 @@ TEST(ImageOperations, HalveSubset) {
FillDataToBitmap(src_w, src_h, &src);
// Do a halving of the full bitmap.
- SkBitmap full_results = skia::ImageOperations::Resize(
- src, skia::ImageOperations::RESIZE_BOX, src_w / 2, src_h / 2);
+ SkBitmap full_results = gfx::ImageOperations::Resize(
+ src, gfx::ImageOperations::RESIZE_BOX, gfx::Size(src_w / 2, src_h / 2));
ASSERT_EQ(src_w / 2, full_results.width());
ASSERT_EQ(src_h / 2, full_results.height());
// Now do a halving of a a subset, recall the destination subset is in the
// destination coordinate system (max = half of the original image size).
- SkIRect subset_rect = {2, 3, 5, 9};
- SkBitmap subset_results = skia::ImageOperations::Resize(
- src, skia::ImageOperations::RESIZE_BOX,
- src_w / 2, src_h / 2, subset_rect);
+ gfx::Rect subset_rect(2, 3, 3, 6);
+ SkBitmap subset_results = gfx::ImageOperations::Resize(
+ src, gfx::ImageOperations::RESIZE_BOX,
+ gfx::Size(src_w / 2, src_h / 2), subset_rect);
ASSERT_EQ(subset_rect.width(), subset_results.width());
ASSERT_EQ(subset_rect.height(), subset_results.height());
@@ -119,7 +117,7 @@ TEST(ImageOperations, HalveSubset) {
for (int y = 0; y < subset_rect.height(); y++) {
for (int x = 0; x < subset_rect.width(); x++) {
ASSERT_EQ(
- *full_results.getAddr32(x + subset_rect.fLeft, y + subset_rect.fTop),
+ *full_results.getAddr32(x + subset_rect.x(), y + subset_rect.y()),
*subset_results.getAddr32(x, y));
}
}
@@ -134,8 +132,8 @@ TEST(ImageOperations, ResampleToSame) {
// Do a resize of the full bitmap to the same size. The lanczos filter is good
// enough that we should get exactly the same image for output.
- SkBitmap results = skia::ImageOperations::Resize(
- src, skia::ImageOperations::RESIZE_LANCZOS3, src_w, src_h);
+ SkBitmap results = gfx::ImageOperations::Resize(
+ src, gfx::ImageOperations::RESIZE_LANCZOS3, gfx::Size(src_w, src_h));
ASSERT_EQ(src_w, results.width());
ASSERT_EQ(src_h, results.height());