diff -r 000000000000 -r 6474c204b198 gfx/skia/trunk/src/utils/SkInterpolator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx/skia/trunk/src/utils/SkInterpolator.cpp Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,327 @@ + +/* + * 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 "SkMath.h" +#include "SkTSearch.h" + +SkInterpolatorBase::SkInterpolatorBase() { + fStorage = NULL; + fTimes = NULL; + SkDEBUGCODE(fTimesArray = NULL;) +} + +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 = NULL; + fTimes = NULL; + SkDEBUGCODE(fTimesArray = NULL); + } +} + +/* Each value[] run is formated as: +