Loading libs/hwui/SkiaInterpolator.cpp +2 −10 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ #include "include/core/SkTypes.h" #include "include/private/SkFixed.h" #include "include/private/SkMalloc.h" #include "include/private/SkTo.h" #include "src/core/SkTSearch.h" typedef int Dot14; Loading Loading @@ -93,7 +92,6 @@ static float SkUnitCubicInterp(float value, float bx, float by, float cx, float SkiaInterpolatorBase::SkiaInterpolatorBase() { fStorage = nullptr; fTimes = nullptr; SkDEBUGCODE(fTimesArray = nullptr;) } SkiaInterpolatorBase::~SkiaInterpolatorBase() { Loading @@ -104,14 +102,13 @@ SkiaInterpolatorBase::~SkiaInterpolatorBase() { void SkiaInterpolatorBase::reset(int elemCount, int frameCount) { fFlags = 0; fElemCount = SkToU8(elemCount); fFrameCount = SkToS16(frameCount); fElemCount = static_cast<uint8_t>(elemCount); fFrameCount = static_cast<int16_t>(frameCount); fRepeat = SK_Scalar1; if (fStorage) { sk_free(fStorage); fStorage = nullptr; fTimes = nullptr; SkDEBUGCODE(fTimesArray = nullptr); } } Loading Loading @@ -207,7 +204,6 @@ SkiaInterpolatorBase::Result SkiaInterpolatorBase::timeToT(SkMSec time, float* T SkiaInterpolator::SkiaInterpolator() { INHERITED::reset(0, 0); fValues = nullptr; SkDEBUGCODE(fScalarsArray = nullptr;) } SkiaInterpolator::SkiaInterpolator(int elemCount, int frameCount) { Loading @@ -220,10 +216,6 @@ void SkiaInterpolator::reset(int elemCount, int frameCount) { fStorage = sk_malloc_throw((sizeof(float) * elemCount + sizeof(SkTimeCode)) * frameCount); fTimes = (SkTimeCode*)fStorage; fValues = (float*)((char*)fStorage + sizeof(SkTimeCode) * frameCount); #ifdef SK_DEBUG fTimesArray = (SkTimeCode(*)[10])fTimes; fScalarsArray = (float(*)[10])fValues; #endif } #define SK_Fixed1Third (SK_Fixed1 / 3) Loading libs/hwui/SkiaInterpolator.h +6 −6 Original line number Diff line number Diff line Loading @@ -17,7 +17,8 @@ #ifndef SkiaInterpolator_DEFINED #define SkiaInterpolator_DEFINED #include "include/private/SkTo.h" #include <cstddef> #include <cstdint> class SkiaInterpolatorBase { public: Loading Loading @@ -46,7 +47,9 @@ public: @param mirror If true, the odd repeats interpolate from the last key frame and the first. */ void setMirror(bool mirror) { fFlags = SkToU8((fFlags & ~kMirror) | (int)mirror); } void setMirror(bool mirror) { fFlags = static_cast<uint8_t>((fFlags & ~kMirror) | (int)mirror); } /** Set the repeat count. The repeat count may be fractional. @param repeatCount Multiplies the total time by this scalar. Loading @@ -57,7 +60,7 @@ public: @param reset If true, the odd repeats interpolate from the last key frame and the first. */ void setReset(bool reset) { fFlags = SkToU8((fFlags & ~kReset) | (int)reset); } void setReset(bool reset) { fFlags = static_cast<uint8_t>((fFlags & ~kReset) | (int)reset); } Result timeToT(uint32_t time, float* T, int* index, bool* exact) const; Loading @@ -75,9 +78,6 @@ protected: }; SkTimeCode* fTimes; // pointer into fStorage void* fStorage; #ifdef SK_DEBUG SkTimeCode (*fTimesArray)[10]; #endif }; class SkiaInterpolator : public SkiaInterpolatorBase { Loading Loading
libs/hwui/SkiaInterpolator.cpp +2 −10 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ #include "include/core/SkTypes.h" #include "include/private/SkFixed.h" #include "include/private/SkMalloc.h" #include "include/private/SkTo.h" #include "src/core/SkTSearch.h" typedef int Dot14; Loading Loading @@ -93,7 +92,6 @@ static float SkUnitCubicInterp(float value, float bx, float by, float cx, float SkiaInterpolatorBase::SkiaInterpolatorBase() { fStorage = nullptr; fTimes = nullptr; SkDEBUGCODE(fTimesArray = nullptr;) } SkiaInterpolatorBase::~SkiaInterpolatorBase() { Loading @@ -104,14 +102,13 @@ SkiaInterpolatorBase::~SkiaInterpolatorBase() { void SkiaInterpolatorBase::reset(int elemCount, int frameCount) { fFlags = 0; fElemCount = SkToU8(elemCount); fFrameCount = SkToS16(frameCount); fElemCount = static_cast<uint8_t>(elemCount); fFrameCount = static_cast<int16_t>(frameCount); fRepeat = SK_Scalar1; if (fStorage) { sk_free(fStorage); fStorage = nullptr; fTimes = nullptr; SkDEBUGCODE(fTimesArray = nullptr); } } Loading Loading @@ -207,7 +204,6 @@ SkiaInterpolatorBase::Result SkiaInterpolatorBase::timeToT(SkMSec time, float* T SkiaInterpolator::SkiaInterpolator() { INHERITED::reset(0, 0); fValues = nullptr; SkDEBUGCODE(fScalarsArray = nullptr;) } SkiaInterpolator::SkiaInterpolator(int elemCount, int frameCount) { Loading @@ -220,10 +216,6 @@ void SkiaInterpolator::reset(int elemCount, int frameCount) { fStorage = sk_malloc_throw((sizeof(float) * elemCount + sizeof(SkTimeCode)) * frameCount); fTimes = (SkTimeCode*)fStorage; fValues = (float*)((char*)fStorage + sizeof(SkTimeCode) * frameCount); #ifdef SK_DEBUG fTimesArray = (SkTimeCode(*)[10])fTimes; fScalarsArray = (float(*)[10])fValues; #endif } #define SK_Fixed1Third (SK_Fixed1 / 3) Loading
libs/hwui/SkiaInterpolator.h +6 −6 Original line number Diff line number Diff line Loading @@ -17,7 +17,8 @@ #ifndef SkiaInterpolator_DEFINED #define SkiaInterpolator_DEFINED #include "include/private/SkTo.h" #include <cstddef> #include <cstdint> class SkiaInterpolatorBase { public: Loading Loading @@ -46,7 +47,9 @@ public: @param mirror If true, the odd repeats interpolate from the last key frame and the first. */ void setMirror(bool mirror) { fFlags = SkToU8((fFlags & ~kMirror) | (int)mirror); } void setMirror(bool mirror) { fFlags = static_cast<uint8_t>((fFlags & ~kMirror) | (int)mirror); } /** Set the repeat count. The repeat count may be fractional. @param repeatCount Multiplies the total time by this scalar. Loading @@ -57,7 +60,7 @@ public: @param reset If true, the odd repeats interpolate from the last key frame and the first. */ void setReset(bool reset) { fFlags = SkToU8((fFlags & ~kReset) | (int)reset); } void setReset(bool reset) { fFlags = static_cast<uint8_t>((fFlags & ~kReset) | (int)reset); } Result timeToT(uint32_t time, float* T, int* index, bool* exact) const; Loading @@ -75,9 +78,6 @@ protected: }; SkTimeCode* fTimes; // pointer into fStorage void* fStorage; #ifdef SK_DEBUG SkTimeCode (*fTimesArray)[10]; #endif }; class SkiaInterpolator : public SkiaInterpolatorBase { Loading