/* * 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 "include/utils/SkInterpolator.h" #include "include/core/SkMath.h" #include "include/private/SkFixed.h" #include "include/private/SkMalloc.h" #include "include/private/SkTo.h" #include "src/core/SkTSearch.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: