Loading libs/hwui/Animator.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ BaseRenderNodeAnimator::BaseRenderNodeAnimator(float finalValue) , mFinalValue(finalValue) , mDeltaValue(0) , mFromValue(0) , mInterpolator(0) , mStagingPlayState(NOT_STARTED) , mPlayState(NOT_STARTED) , mHasStartValue(false) Loading @@ -47,7 +46,6 @@ BaseRenderNodeAnimator::BaseRenderNodeAnimator(float finalValue) } BaseRenderNodeAnimator::~BaseRenderNodeAnimator() { delete mInterpolator; } void BaseRenderNodeAnimator::checkMutable() { Loading @@ -58,8 +56,7 @@ void BaseRenderNodeAnimator::checkMutable() { void BaseRenderNodeAnimator::setInterpolator(Interpolator* interpolator) { checkMutable(); delete mInterpolator; mInterpolator = interpolator; mInterpolator.reset(interpolator); } void BaseRenderNodeAnimator::setStartValue(float value) { Loading Loading @@ -119,7 +116,7 @@ void BaseRenderNodeAnimator::transitionToRunning(AnimationContext& context) { } // No interpolator was set, use the default if (!mInterpolator) { mInterpolator = Interpolator::createDefaultInterpolator(); mInterpolator.reset(Interpolator::createDefaultInterpolator()); } if (mDuration < 0 || mDuration > 50000) { ALOGW("Your duration is strange and confusing: %" PRId64, mDuration); Loading libs/hwui/Animator.h +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #ifndef ANIMATOR_H #define ANIMATOR_H #include <memory> #include <cutils/compiler.h> #include <utils/RefBase.h> #include <utils/StrongPointer.h> Loading Loading @@ -99,7 +100,7 @@ protected: float mDeltaValue; float mFromValue; Interpolator* mInterpolator; std::unique_ptr<Interpolator> mInterpolator; PlayState mStagingPlayState; PlayState mPlayState; bool mHasStartValue; Loading libs/hwui/Caches.cpp +8 −13 Original line number Diff line number Diff line Loading @@ -224,9 +224,8 @@ void Caches::terminate() { mCurrentBuffer = 0; glDeleteBuffers(1, &mMeshIndices); delete[] mRegionMesh; mMeshIndices = 0; mRegionMesh = NULL; mRegionMesh.release(); glDeleteBuffers(1, &mShadowStripsIndices); mShadowStripsIndices = 0; Loading Loading @@ -406,7 +405,7 @@ bool Caches::bindIndicesBufferInternal(const GLuint buffer) { bool Caches::bindQuadIndicesBuffer() { if (!mMeshIndices) { uint16_t* regionIndices = new uint16_t[gMaxNumberOfQuads * 6]; std::unique_ptr<uint16_t[]> regionIndices(new uint16_t[gMaxNumberOfQuads * 6]); for (uint32_t i = 0; i < gMaxNumberOfQuads; i++) { uint16_t quad = i * 4; int index = i * 6; Loading @@ -421,9 +420,7 @@ bool Caches::bindQuadIndicesBuffer() { glGenBuffers(1, &mMeshIndices); bool force = bindIndicesBufferInternal(mMeshIndices); glBufferData(GL_ELEMENT_ARRAY_BUFFER, gMaxNumberOfQuads * 6 * sizeof(uint16_t), regionIndices, GL_STATIC_DRAW); delete[] regionIndices; regionIndices.get(), GL_STATIC_DRAW); return force; } Loading @@ -432,14 +429,12 @@ bool Caches::bindQuadIndicesBuffer() { bool Caches::bindShadowIndicesBuffer() { if (!mShadowStripsIndices) { uint16_t* shadowIndices = new uint16_t[MAX_SHADOW_INDEX_COUNT]; ShadowTessellator::generateShadowIndices(shadowIndices); std::unique_ptr<uint16_t[]> shadowIndices(new uint16_t[MAX_SHADOW_INDEX_COUNT]); ShadowTessellator::generateShadowIndices(shadowIndices.get()); glGenBuffers(1, &mShadowStripsIndices); bool force = bindIndicesBufferInternal(mShadowStripsIndices); glBufferData(GL_ELEMENT_ARRAY_BUFFER, MAX_SHADOW_INDEX_COUNT * sizeof(uint16_t), shadowIndices, GL_STATIC_DRAW); delete[] shadowIndices; shadowIndices.get(), GL_STATIC_DRAW); return force; } Loading Loading @@ -687,10 +682,10 @@ void Caches::unregisterFunctors(uint32_t functorCount) { TextureVertex* Caches::getRegionMesh() { // Create the mesh, 2 triangles and 4 vertices per rectangle in the region if (!mRegionMesh) { mRegionMesh = new TextureVertex[gMaxNumberOfQuads * 4]; mRegionMesh.reset(new TextureVertex[gMaxNumberOfQuads * 4]); } return mRegionMesh; return mRegionMesh.get(); } /////////////////////////////////////////////////////////////////////////////// Loading libs/hwui/Caches.h +1 −1 Original line number Diff line number Diff line Loading @@ -416,7 +416,7 @@ private: Extensions& mExtensions; // Used to render layers TextureVertex* mRegionMesh; std::unique_ptr<TextureVertex[]> mRegionMesh; // Global index buffer GLuint mMeshIndices; Loading libs/hwui/DisplayList.cpp +0 −12 Original line number Diff line number Diff line Loading @@ -62,18 +62,6 @@ void DisplayListData::cleanupResources() { resourceCache.unlock(); for (size_t i = 0; i < paints.size(); i++) { delete paints.itemAt(i); } for (size_t i = 0; i < regions.size(); i++) { delete regions.itemAt(i); } for (size_t i = 0; i < paths.size(); i++) { delete paths.itemAt(i); } bitmapResources.clear(); ownedBitmapResources.clear(); patchResources.clear(); Loading Loading
libs/hwui/Animator.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ BaseRenderNodeAnimator::BaseRenderNodeAnimator(float finalValue) , mFinalValue(finalValue) , mDeltaValue(0) , mFromValue(0) , mInterpolator(0) , mStagingPlayState(NOT_STARTED) , mPlayState(NOT_STARTED) , mHasStartValue(false) Loading @@ -47,7 +46,6 @@ BaseRenderNodeAnimator::BaseRenderNodeAnimator(float finalValue) } BaseRenderNodeAnimator::~BaseRenderNodeAnimator() { delete mInterpolator; } void BaseRenderNodeAnimator::checkMutable() { Loading @@ -58,8 +56,7 @@ void BaseRenderNodeAnimator::checkMutable() { void BaseRenderNodeAnimator::setInterpolator(Interpolator* interpolator) { checkMutable(); delete mInterpolator; mInterpolator = interpolator; mInterpolator.reset(interpolator); } void BaseRenderNodeAnimator::setStartValue(float value) { Loading Loading @@ -119,7 +116,7 @@ void BaseRenderNodeAnimator::transitionToRunning(AnimationContext& context) { } // No interpolator was set, use the default if (!mInterpolator) { mInterpolator = Interpolator::createDefaultInterpolator(); mInterpolator.reset(Interpolator::createDefaultInterpolator()); } if (mDuration < 0 || mDuration > 50000) { ALOGW("Your duration is strange and confusing: %" PRId64, mDuration); Loading
libs/hwui/Animator.h +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #ifndef ANIMATOR_H #define ANIMATOR_H #include <memory> #include <cutils/compiler.h> #include <utils/RefBase.h> #include <utils/StrongPointer.h> Loading Loading @@ -99,7 +100,7 @@ protected: float mDeltaValue; float mFromValue; Interpolator* mInterpolator; std::unique_ptr<Interpolator> mInterpolator; PlayState mStagingPlayState; PlayState mPlayState; bool mHasStartValue; Loading
libs/hwui/Caches.cpp +8 −13 Original line number Diff line number Diff line Loading @@ -224,9 +224,8 @@ void Caches::terminate() { mCurrentBuffer = 0; glDeleteBuffers(1, &mMeshIndices); delete[] mRegionMesh; mMeshIndices = 0; mRegionMesh = NULL; mRegionMesh.release(); glDeleteBuffers(1, &mShadowStripsIndices); mShadowStripsIndices = 0; Loading Loading @@ -406,7 +405,7 @@ bool Caches::bindIndicesBufferInternal(const GLuint buffer) { bool Caches::bindQuadIndicesBuffer() { if (!mMeshIndices) { uint16_t* regionIndices = new uint16_t[gMaxNumberOfQuads * 6]; std::unique_ptr<uint16_t[]> regionIndices(new uint16_t[gMaxNumberOfQuads * 6]); for (uint32_t i = 0; i < gMaxNumberOfQuads; i++) { uint16_t quad = i * 4; int index = i * 6; Loading @@ -421,9 +420,7 @@ bool Caches::bindQuadIndicesBuffer() { glGenBuffers(1, &mMeshIndices); bool force = bindIndicesBufferInternal(mMeshIndices); glBufferData(GL_ELEMENT_ARRAY_BUFFER, gMaxNumberOfQuads * 6 * sizeof(uint16_t), regionIndices, GL_STATIC_DRAW); delete[] regionIndices; regionIndices.get(), GL_STATIC_DRAW); return force; } Loading @@ -432,14 +429,12 @@ bool Caches::bindQuadIndicesBuffer() { bool Caches::bindShadowIndicesBuffer() { if (!mShadowStripsIndices) { uint16_t* shadowIndices = new uint16_t[MAX_SHADOW_INDEX_COUNT]; ShadowTessellator::generateShadowIndices(shadowIndices); std::unique_ptr<uint16_t[]> shadowIndices(new uint16_t[MAX_SHADOW_INDEX_COUNT]); ShadowTessellator::generateShadowIndices(shadowIndices.get()); glGenBuffers(1, &mShadowStripsIndices); bool force = bindIndicesBufferInternal(mShadowStripsIndices); glBufferData(GL_ELEMENT_ARRAY_BUFFER, MAX_SHADOW_INDEX_COUNT * sizeof(uint16_t), shadowIndices, GL_STATIC_DRAW); delete[] shadowIndices; shadowIndices.get(), GL_STATIC_DRAW); return force; } Loading Loading @@ -687,10 +682,10 @@ void Caches::unregisterFunctors(uint32_t functorCount) { TextureVertex* Caches::getRegionMesh() { // Create the mesh, 2 triangles and 4 vertices per rectangle in the region if (!mRegionMesh) { mRegionMesh = new TextureVertex[gMaxNumberOfQuads * 4]; mRegionMesh.reset(new TextureVertex[gMaxNumberOfQuads * 4]); } return mRegionMesh; return mRegionMesh.get(); } /////////////////////////////////////////////////////////////////////////////// Loading
libs/hwui/Caches.h +1 −1 Original line number Diff line number Diff line Loading @@ -416,7 +416,7 @@ private: Extensions& mExtensions; // Used to render layers TextureVertex* mRegionMesh; std::unique_ptr<TextureVertex[]> mRegionMesh; // Global index buffer GLuint mMeshIndices; Loading
libs/hwui/DisplayList.cpp +0 −12 Original line number Diff line number Diff line Loading @@ -62,18 +62,6 @@ void DisplayListData::cleanupResources() { resourceCache.unlock(); for (size_t i = 0; i < paints.size(); i++) { delete paints.itemAt(i); } for (size_t i = 0; i < regions.size(); i++) { delete regions.itemAt(i); } for (size_t i = 0; i < paths.size(); i++) { delete paths.itemAt(i); } bitmapResources.clear(); ownedBitmapResources.clear(); patchResources.clear(); Loading