Chromium Code Reviews| Index: ui/gfx/skbitmap_operations.cc |
| diff --git a/ui/gfx/skbitmap_operations.cc b/ui/gfx/skbitmap_operations.cc |
| index c2d26612991e7681921e58e08622f770a11b4891..d1f255e574588cd34ef9e649afa2dbe28415ea1f 100644 |
| --- a/ui/gfx/skbitmap_operations.cc |
| +++ b/ui/gfx/skbitmap_operations.cc |
| @@ -27,7 +27,6 @@ SkBitmap SkBitmapOperations::CreateInvertedBitmap(const SkBitmap& image) { |
| SkBitmap inverted; |
| inverted.allocN32Pixels(image.width(), image.height()); |
|
danakj
2014/07/16 15:18:25
will it be filled with opaque values? you can save
hyunki
2014/07/16 15:28:48
Yes. I think so. Please check below codes to fill
danakj
2014/07/16 15:30:42
It depends on the input image right?
hyunki
2014/07/16 15:35:16
Yes. It depends on the input image. All alphas for
danakj
2014/07/16 15:38:11
So, do you want to tell allocN32 if it will be opa
hyunki
2014/07/16 15:42:17
No. I'm telling below operation fills whole alloce
danakj
2014/07/16 15:52:29
So then how about passing true for opaque to alloc
hyunki
2014/07/16 16:03:03
Sorry. For clarification,
(your question) will it
|
| - inverted.eraseARGB(0, 0, 0, 0); |
| for (int y = 0; y < image.height(); ++y) { |
| uint32* image_row = image.getAddr32(0, y); |
| @@ -44,35 +43,6 @@ SkBitmap SkBitmapOperations::CreateInvertedBitmap(const SkBitmap& image) { |
| } |
| // static |
| -SkBitmap SkBitmapOperations::CreateSuperimposedBitmap(const SkBitmap& first, |
| - const SkBitmap& second) { |
| - DCHECK(first.width() == second.width()); |
| - DCHECK(first.height() == second.height()); |
| - DCHECK(first.bytesPerPixel() == second.bytesPerPixel()); |
| - DCHECK(first.colorType() == kN32_SkColorType); |
| - |
| - SkAutoLockPixels lock_first(first); |
| - SkAutoLockPixels lock_second(second); |
| - |
| - SkBitmap superimposed; |
| - superimposed.allocN32Pixels(first.width(), first.height()); |
| - superimposed.eraseARGB(0, 0, 0, 0); |
| - |
| - SkCanvas canvas(superimposed); |
| - |
| - SkRect rect; |
| - rect.fLeft = 0; |
| - rect.fTop = 0; |
| - rect.fRight = SkIntToScalar(first.width()); |
| - rect.fBottom = SkIntToScalar(first.height()); |
| - |
| - canvas.drawBitmapRect(first, NULL, rect); |
| - canvas.drawBitmapRect(second, NULL, rect); |
| - |
| - return superimposed; |
| -} |
| - |
| -// static |
| SkBitmap SkBitmapOperations::CreateBlendedBitmap(const SkBitmap& first, |
| const SkBitmap& second, |
| double alpha) { |
| @@ -95,7 +65,6 @@ SkBitmap SkBitmapOperations::CreateBlendedBitmap(const SkBitmap& first, |
| SkBitmap blended; |
| blended.allocN32Pixels(first.width(), first.height()); |
| - blended.eraseARGB(0, 0, 0, 0); |
|
danakj
2014/07/16 15:18:25
ditto for the rest
hyunki
2014/07/16 15:28:48
ditto.
dst_row[x] = SkColorSetARGB(a, r, g, b);
|
| double first_alpha = 1 - alpha; |
| @@ -135,7 +104,6 @@ SkBitmap SkBitmapOperations::CreateMaskedBitmap(const SkBitmap& rgb, |
| SkBitmap masked; |
| masked.allocN32Pixels(rgb.width(), rgb.height()); |
| - masked.eraseARGB(0, 0, 0, 0); |
| SkAutoLockPixels lock_rgb(rgb); |
| SkAutoLockPixels lock_alpha(alpha); |
| @@ -551,7 +519,6 @@ SkBitmap SkBitmapOperations::CreateHSLShiftedBitmap( |
| SkBitmap shifted; |
| shifted.allocN32Pixels(bitmap.width(), bitmap.height()); |
| - shifted.eraseARGB(0, 0, 0, 0); |
| SkAutoLockPixels lock_bitmap(bitmap); |
| SkAutoLockPixels lock_shifted(shifted); |
| @@ -575,7 +542,6 @@ SkBitmap SkBitmapOperations::CreateTiledBitmap(const SkBitmap& source, |
| SkBitmap cropped; |
| cropped.allocN32Pixels(dst_w, dst_h); |
| - cropped.eraseARGB(0, 0, 0, 0); |
| SkAutoLockPixels lock_source(source); |
| SkAutoLockPixels lock_cropped(cropped); |