Loading core/jni/android/opengl/util.cpp +3 −26 Original line number Diff line number Diff line Loading @@ -49,27 +49,6 @@ void mx4transform(float x, float y, float z, float w, const float* pM, float* pD pDest[3] = pM[3 + 4 * 0] * x + pM[3 + 4 * 1] * y + pM[3 + 4 * 2] * z + pM[3 + 4 * 3] * w; } class MallocHelper { public: MallocHelper() { mData = 0; } ~MallocHelper() { if (mData != 0) { free(mData); } } void* alloc(size_t size) { mData = malloc(size); return mData; } private: void* mData; }; #if 0 static void Loading @@ -85,10 +64,7 @@ print_poly(const char* label, Poly* pPoly) { static int visibilityTest(float* pWS, float* pPositions, int positionsLength, unsigned short* pIndices, int indexCount) { MallocHelper mallocHelper; int result = POLY_CLIP_OUT; float* pTransformed = 0; int transformedIndexCount = 0; if ( indexCount < 3 ) { return POLY_CLIP_OUT; Loading Loading @@ -116,8 +92,9 @@ int visibilityTest(float* pWS, float* pPositions, int positionsLength, return -1; } transformedIndexCount = maxIndex - minIndex + 1; pTransformed = (float*) mallocHelper.alloc(transformedIndexCount * 4 * sizeof(float)); int transformedIndexCount = maxIndex - minIndex + 1; std::unique_ptr<float[]> holder{new float[transformedIndexCount * 4]}; float* pTransformed = holder.get(); if (pTransformed == 0 ) { return -2; Loading Loading
core/jni/android/opengl/util.cpp +3 −26 Original line number Diff line number Diff line Loading @@ -49,27 +49,6 @@ void mx4transform(float x, float y, float z, float w, const float* pM, float* pD pDest[3] = pM[3 + 4 * 0] * x + pM[3 + 4 * 1] * y + pM[3 + 4 * 2] * z + pM[3 + 4 * 3] * w; } class MallocHelper { public: MallocHelper() { mData = 0; } ~MallocHelper() { if (mData != 0) { free(mData); } } void* alloc(size_t size) { mData = malloc(size); return mData; } private: void* mData; }; #if 0 static void Loading @@ -85,10 +64,7 @@ print_poly(const char* label, Poly* pPoly) { static int visibilityTest(float* pWS, float* pPositions, int positionsLength, unsigned short* pIndices, int indexCount) { MallocHelper mallocHelper; int result = POLY_CLIP_OUT; float* pTransformed = 0; int transformedIndexCount = 0; if ( indexCount < 3 ) { return POLY_CLIP_OUT; Loading Loading @@ -116,8 +92,9 @@ int visibilityTest(float* pWS, float* pPositions, int positionsLength, return -1; } transformedIndexCount = maxIndex - minIndex + 1; pTransformed = (float*) mallocHelper.alloc(transformedIndexCount * 4 * sizeof(float)); int transformedIndexCount = maxIndex - minIndex + 1; std::unique_ptr<float[]> holder{new float[transformedIndexCount * 4]}; float* pTransformed = holder.get(); if (pTransformed == 0 ) { return -2; Loading