1 //
2 // Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // copyimage.cpp: Defines image copying functions
8 
9 #include "image_util/copyimage.h"
10 
11 namespace angle
12 {
13 
CopyBGRA8ToRGBA8(const uint8_t * source,uint8_t * dest)14 void CopyBGRA8ToRGBA8(const uint8_t *source, uint8_t *dest)
15 {
16     uint32_t argb                       = *reinterpret_cast<const uint32_t *>(source);
17     *reinterpret_cast<uint32_t *>(dest) = (argb & 0xFF00FF00) |        // Keep alpha and green
18                                           (argb & 0x00FF0000) >> 16 |  // Move red to blue
19                                           (argb & 0x000000FF) << 16;   // Move blue to red
20 }
21 
22 }  // namespace angle
23