Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / src / libGLESv2 / renderer / copyimage.inl
1 //
2 // Copyright (c) 2014 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.inl: Defines image copying functions
8
9 namespace rx
10 {
11
12 template <typename sourceType, typename colorDataType>
13 inline void ReadColor(const uint8_t *source, uint8_t *dest)
14 {
15     sourceType::readColor(reinterpret_cast<gl::Color<colorDataType>*>(dest), reinterpret_cast<const sourceType*>(source));
16 }
17
18 template <typename destType, typename colorDataType>
19 inline void WriteColor(const uint8_t *source, uint8_t *dest)
20 {
21     destType::writeColor(reinterpret_cast<destType*>(dest), reinterpret_cast<const gl::Color<colorDataType>*>(source));
22 }
23
24 template <typename sourceType, typename destType, typename colorDataType>
25 inline void CopyPixel(const uint8_t *source, uint8_t *dest)
26 {
27     colorType temp;
28     ReadColor<sourceType, colorDataType>(source, &temp);
29     WriteColor<destType, colorDataType>(&temp, dest);
30 }
31
32 }