summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Lubick <kjlubick@google.com> 2023-01-05 19:07:26 +0000
committer Kevin Lubick <kjlubick@google.com> 2023-01-05 19:15:07 +0000
commitd9ccdf63bd17c05016d94fdc6d9106baa3698298 (patch)
tree39509fcc9c3c35196e073501e8032a44fa772910
parent45d7f9c5bee90bd82b9fe561a8b70b87806e7ab0 (diff)
Remove use of private Skia SkTo.h file
Also removes dead code hiding behind SK_DEBUG (which is never set). Change-Id: I76d626c508921800c7fcd8cac11827d0bcca0f1e
-rw-r--r--libs/hwui/SkiaInterpolator.cpp12
-rw-r--r--libs/hwui/SkiaInterpolator.h12
2 files changed, 8 insertions, 16 deletions
diff --git a/libs/hwui/SkiaInterpolator.cpp b/libs/hwui/SkiaInterpolator.cpp
index 153c3b6f7e04..b28b15aa6cf4 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 @@ static float SkUnitCubicInterp(float value, float bx, float by, float cx, float
SkiaInterpolatorBase::SkiaInterpolatorBase() {
fStorage = nullptr;
fTimes = nullptr;
- SkDEBUGCODE(fTimesArray = nullptr;)
}
SkiaInterpolatorBase::~SkiaInterpolatorBase() {
@@ -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);
}
}
@@ -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) {
@@ -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)
diff --git a/libs/hwui/SkiaInterpolator.h b/libs/hwui/SkiaInterpolator.h
index c03f502528be..9422cb526a8f 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 @@ 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.
@@ -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;
@@ -75,9 +78,6 @@ protected:
};
SkTimeCode* fTimes; // pointer into fStorage
void* fStorage;
-#ifdef SK_DEBUG
- SkTimeCode (*fTimesArray)[10];
-#endif
};
class SkiaInterpolator : public SkiaInterpolatorBase {