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