diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-10 00:04:34 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-10 00:04:34 +0000 |
commit | 8d1b864d1d90a055a6280b62541624793842ce9c (patch) | |
tree | 85932f19dc4ad3771fed903cd3ed7cfaf9857e1b /gfx/skbitmap_operations_unittest.cc | |
parent | af1f9f3ab83cd5184d2b0f71492358aabc3129fc (diff) | |
download | chromium_src-8d1b864d1d90a055a6280b62541624793842ce9c.zip chromium_src-8d1b864d1d90a055a6280b62541624793842ce9c.tar.gz chromium_src-8d1b864d1d90a055a6280b62541624793842ce9c.tar.bz2 |
Fixed include in test_webkit_client
retrying "Revert 62068 - Move implementation of linux scrollbars from webkit using new"
See: http://codereview.chromium.org/3618014
TBR:jam@chromium.org
BUG=chromium-os:6857
TEST=Verify that both linux and chromeos scrollbars look right.
Review URL: http://codereview.chromium.org/3697001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/skbitmap_operations_unittest.cc')
-rw-r--r-- | gfx/skbitmap_operations_unittest.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gfx/skbitmap_operations_unittest.cc b/gfx/skbitmap_operations_unittest.cc index 83b732a0..bcad287 100644 --- a/gfx/skbitmap_operations_unittest.cc +++ b/gfx/skbitmap_operations_unittest.cc @@ -492,3 +492,26 @@ TEST(SkBitmapOperationsTest, UnPreMultiply) { EXPECT_EQ(0xFF00CC88, *result.getAddr32(0, 1)); EXPECT_EQ(0x00000000u, *result.getAddr32(1, 1)); // "Division by zero". } + +TEST(SkBitmapOperationsTest, CreateTransposedBtmap) { + SkBitmap input; + input.setConfig(SkBitmap::kARGB_8888_Config, 2, 3); + input.allocPixels(); + + for (int x = 0; x < input.width(); ++x) { + for (int y = 0; y < input.height(); ++y) { + *input.getAddr32(x, y) = x * input.width() + y; + } + } + + SkBitmap result = SkBitmapOperations::CreateTransposedBtmap(input); + EXPECT_EQ(3, result.width()); + EXPECT_EQ(2, result.height()); + + SkAutoLockPixels lock(result); + for (int x = 0; x < input.width(); ++x) { + for (int y = 0; y < input.height(); ++y) { + EXPECT_EQ(*input.getAddr32(x, y), *result.getAddr32(y, x)); + } + } +} |