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.
7 // copyimage.cpp: Defines image copying functions
9 #include "libGLESv2/renderer/copyimage.h"
14 void CopyBGRA8ToRGBA8(const uint8_t *source, uint8_t *dest)
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