Index: ui/gfx/codec/png_codec.cc |
diff --git a/ui/gfx/codec/png_codec.cc b/ui/gfx/codec/png_codec.cc |
index 1bf2aad717e4229300745dab62e9f0d435415d52..645f1858093e35863e3228f4e62f93bc5809c973 100644 |
--- a/ui/gfx/codec/png_codec.cc |
+++ b/ui/gfx/codec/png_codec.cc |
@@ -33,13 +33,8 @@ void ConvertBetweenBGRAandRGBA(const unsigned char* input, int pixel_width, |
void ConvertRGBAtoRGB(const unsigned char* rgba, int pixel_width, |
unsigned char* rgb, bool* is_opaque) { |
- for (int x = 0; x < pixel_width; x++) { |
- const unsigned char* pixel_in = &rgba[x * 4]; |
- unsigned char* pixel_out = &rgb[x * 3]; |
- pixel_out[0] = pixel_in[0]; |
- pixel_out[1] = pixel_in[1]; |
- pixel_out[2] = pixel_in[2]; |
- } |
+ for (int x = 0; x < pixel_width; x++) |
+ memcpy(&rgb[x * 3], &rgba[x * 4], 3); |
} |
void ConvertSkiatoRGB(const unsigned char* skia, int pixel_width, |