| Index: ui/gfx/skbitmap_operations.cc
|
| diff --git a/ui/gfx/skbitmap_operations.cc b/ui/gfx/skbitmap_operations.cc
|
| index 3865916c9032e0b18d062a962e6582cec007f3e1..31b5eaa357ccaf7290a479c62c923a96b83fe4da 100644
|
| --- a/ui/gfx/skbitmap_operations.cc
|
| +++ b/ui/gfx/skbitmap_operations.cc
|
| @@ -694,6 +694,26 @@ SkBitmap SkBitmapOperations::CreateTransposedBitmap(const SkBitmap& image) {
|
| }
|
|
|
| // static
|
| +SkBitmap SkBitmapOperations::CreateMirroredBitmap(const SkBitmap& image) {
|
| + DCHECK(image.colorType() == kN32_SkColorType);
|
| +
|
| + SkBitmap mirrored;
|
| + mirrored.allocN32Pixels(image.width(), image.height());
|
| +
|
| + SkAutoLockPixels lock_image(image);
|
| + SkAutoLockPixels lock_mirrored(mirrored);
|
| +
|
| + for (int y = 0; y < image.height(); ++y) {
|
| + uint32_t* image_row_src = image.getAddr32(0, y);
|
| + uint32_t* image_row_dst = mirrored.getAddr32(0, y);
|
| + for (int src_x = image.width() - 1, dst_x = 0; src_x >= 0; --src_x, ++dst_x)
|
| + image_row_dst[dst_x] = image_row_src[src_x];
|
| + }
|
| +
|
| + return mirrored;
|
| +}
|
| +
|
| +// static
|
| SkBitmap SkBitmapOperations::CreateColorMask(const SkBitmap& bitmap,
|
| SkColor c) {
|
| DCHECK(bitmap.colorType() == kN32_SkColorType);
|
|
|