Remove use of private Skia SkTo.h file
Also removes dead code hiding behind SK_DEBUG (which is never set).
Change-Id: I76d626c508921800c7fcd8cac11827d0bcca0f1e
diff --git a/libs/hwui/SkiaInterpolator.cpp b/libs/hwui/SkiaInterpolator.cpp
index 153c3b6..b28b15a 100644
--- a/libs/hwui/SkiaInterpolator.cpp
+++ b/libs/hwui/SkiaInterpolator.cpp
@@ -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;
@@ -93,7 +92,6 @@
SkiaInterpolatorBase::SkiaInterpolatorBase() {
fStorage = nullptr;
fTimes = nullptr;
- SkDEBUGCODE(fTimesArray = nullptr;)
}
SkiaInterpolatorBase::~SkiaInterpolatorBase() {
@@ -104,14 +102,13 @@
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);
}
}
@@ -207,7 +204,6 @@
SkiaInterpolator::SkiaInterpolator() {
INHERITED::reset(0, 0);
fValues = nullptr;
- SkDEBUGCODE(fScalarsArray = nullptr;)
}
SkiaInterpolator::SkiaInterpolator(int elemCount, int frameCount) {
@@ -220,10 +216,6 @@
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)
diff --git a/libs/hwui/SkiaInterpolator.h b/libs/hwui/SkiaInterpolator.h
index c03f502..9422cb5 100644
--- a/libs/hwui/SkiaInterpolator.h
+++ b/libs/hwui/SkiaInterpolator.h
@@ -17,7 +17,8 @@
#ifndef SkiaInterpolator_DEFINED
#define SkiaInterpolator_DEFINED
-#include "include/private/SkTo.h"
+#include <cstddef>
+#include <cstdint>
class SkiaInterpolatorBase {
public:
@@ -46,7 +47,9 @@
@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.
@@ -57,7 +60,7 @@
@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;
@@ -75,9 +78,6 @@
};
SkTimeCode* fTimes; // pointer into fStorage
void* fStorage;
-#ifdef SK_DEBUG
- SkTimeCode (*fTimesArray)[10];
-#endif
};
class SkiaInterpolator : public SkiaInterpolatorBase {