/* * Copyright 2008 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "SkInterpolator.h" #include "SkFixed.h" #include "SkMalloc.h" #include "SkMath.h" #include "SkTSearch.h" #include "SkTo.h" SkInterpolatorBase::SkInterpolatorBase() { fStorage = nullptr; fTimes = nullptr; SkDEBUGCODE(fTimesArray = nullptr;) } SkInterpolatorBase::~SkInterpolatorBase() { if (fStorage) { sk_free(fStorage); } } void SkInterpolatorBase::reset(int elemCount, int frameCount) { fFlags = 0; fElemCount = SkToU8(elemCount); fFrameCount = SkToS16(frameCount); fRepeat = SK_Scalar1; if (fStorage) { sk_free(fStorage); fStorage = nullptr; fTimes = nullptr; SkDEBUGCODE(fTimesArray = nullptr); } } /* Each value[] run is formated as: