diff options
| author | 2019-08-23 18:14:00 +0000 | |
|---|---|---|
| committer | 2019-08-23 18:14:00 +0000 | |
| commit | 6b6168ab973b0e3c33e94e94fd4e6a440cef40e0 (patch) | |
| tree | d1dde4830e58e7254ddb0ccd7d592d2b3d60d3f0 /opengl/libagl/fp.cpp | |
| parent | 194e1069a4bf40e670db59741d0fe38fcc384071 (diff) | |
| parent | b856aff7430b57f5d32436ecb4e4d232d37723ed (diff) | |
Merge changes from topic "libagl"
* changes:
  Remove mention of legacy software renderer
  Nuke libagl and setEmulatorGlesValue
Diffstat (limited to 'opengl/libagl/fp.cpp')
| -rw-r--r-- | opengl/libagl/fp.cpp | 87 | 
1 files changed, 0 insertions, 87 deletions
diff --git a/opengl/libagl/fp.cpp b/opengl/libagl/fp.cpp deleted file mode 100644 index a7a4f7b102..0000000000 --- a/opengl/libagl/fp.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* libs/opengles/fp.cpp -** -** Copyright 2006, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License");  -** you may not use this file except in compliance with the License.  -** You may obtain a copy of the License at  -** -**     http://www.apache.org/licenses/LICENSE-2.0  -** -** Unless required by applicable law or agreed to in writing, software  -** distributed under the License is distributed on an "AS IS" BASIS,  -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  -** See the License for the specific language governing permissions and  -** limitations under the License. -*/ - -#include "fp.h" - -// ---------------------------------------------------------------------------- - -#if !(defined(__arm__) || (defined(__mips__) && !defined(__LP64__) && __mips_isa_rev < 6)) -GGLfixed gglFloatToFixed(float v) {    -    return GGLfixed(floorf(v * 65536.0f + 0.5f)); -} -#endif - -// ---------------------------------------------------------------------------- - -namespace android { - -namespace gl { - -GLfloat fixedToFloat(GLfixed x) -{ -#if DEBUG_USE_FLOATS -    return x / 65536.0f; -#else -    if (!x) return 0; -    const uint32_t s = x & 0x80000000; -    union { -        uint32_t i; -        float f; -    }; -    i = s ? -x : x; -    const int c = gglClz(i) - 8; -    i = (c>=0) ? (i<<c) : (i>>-c); -    const uint32_t e = 134 - c; -    i &= ~0x800000; -    i |= e<<23; -    i |= s; -    return f; -#endif -} - -float sinef(float x) -{ -    const float A =   1.0f / (2.0f*M_PI); -    const float B = -16.0f; -    const float C =   8.0f; - -    // scale angle for easy argument reduction -    x *= A; -     -    if (fabsf(x) >= 0.5f) { -        // Argument reduction -        x = x - ceilf(x + 0.5f) + 1.0f;  -    } - -    const float y = B*x*fabsf(x) + C*x; -    return 0.2215f * (y*fabsf(y) - y) + y; -} - -float cosinef(float x) -{ -    return sinef(x + float(M_PI/2)); -} - -void sincosf(GLfloat angle, GLfloat* s, GLfloat* c) { -    *s = sinef(angle); -    *c = cosinef(angle); -} - -}; // namespace fp_utils - -// ---------------------------------------------------------------------------- -}; // namespace android  |