diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 03:25:30 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 03:25:30 +0000 |
commit | 7281e4cf77a6ebcd7c79db4f87629c7565ff4289 (patch) | |
tree | a0c5b4c4b7b64453ffe6f5cc606e0e9384808e74 /gfx/skbitmap_operations.cc | |
parent | b83af49ec37d7354cd6134d0cac0ea85101f9c4f (diff) | |
download | chromium_src-7281e4cf77a6ebcd7c79db4f87629c7565ff4289.zip chromium_src-7281e4cf77a6ebcd7c79db4f87629c7565ff4289.tar.gz chromium_src-7281e4cf77a6ebcd7c79db4f87629c7565ff4289.tar.bz2 |
Move implementation of linux scrollbars from webkit using new
WebThemeEngine api. Also implement chromeos specific version.
BUG=chromium-os:6857
TEST=Verify that both linux and chromeos scrollbars look right.
Review URL: http://codereview.chromium.org/3618014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62068 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/skbitmap_operations.cc')
-rw-r--r-- | gfx/skbitmap_operations.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gfx/skbitmap_operations.cc b/gfx/skbitmap_operations.cc index b8cec11..6899553 100644 --- a/gfx/skbitmap_operations.cc +++ b/gfx/skbitmap_operations.cc @@ -695,3 +695,27 @@ SkBitmap SkBitmapOperations::UnPreMultiply(const SkBitmap& bitmap) { opaque_bitmap.setIsOpaque(true); return opaque_bitmap; } + +// static +SkBitmap SkBitmapOperations::CreateTransposedBtmap(const SkBitmap& image) { + DCHECK(image.config() == SkBitmap::kARGB_8888_Config); + + SkAutoLockPixels lock_image(image); + + SkBitmap transposed; + transposed.setConfig( + SkBitmap::kARGB_8888_Config, image.height(), image.width(), 0); + transposed.allocPixels(); + transposed.eraseARGB(0, 0, 0, 0); + + for (int y = 0; y < image.height(); ++y) { + uint32* image_row = image.getAddr32(0, y); + for (int x = 0; x < image.width(); ++x) { + uint32* dst = transposed.getAddr32(y, x); + *dst = image_row[x]; + } + } + + return transposed; +} + |