| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/gfx/half_float.h" |
| 6 |
| 7 namespace gfx { |
| 8 |
| 9 void FloatToHalfFloat(const float* input, HalfFloat* output, size_t num) { |
| 10 for (size_t i = 0; i < num; i++) { |
| 11 float tmp = input[i] * 1.9259299444e-34f; |
| 12 uint32_t tmp2 = *reinterpret_cast<uint32_t*>(&tmp) + (1 << 12); |
| 13 output[i] = (tmp2 & 0x80000000UL) >> 16 | (tmp2 >> 13); |
| 14 } |
| 15 } |
| 16 }; |
| OLD | NEW |