gfx/skia/trunk/src/animator/SkOperandInterpolator.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1
michael@0 2 /*
michael@0 3 * Copyright 2006 The Android Open Source Project
michael@0 4 *
michael@0 5 * Use of this source code is governed by a BSD-style license that can be
michael@0 6 * found in the LICENSE file.
michael@0 7 */
michael@0 8
michael@0 9
michael@0 10 #ifndef SkOperandInterpolator_DEFINED
michael@0 11 #define SkOperandInterpolator_DEFINED
michael@0 12
michael@0 13 #include "SkDisplayType.h"
michael@0 14 #include "SkInterpolator.h"
michael@0 15 #include "SkOperand.h"
michael@0 16
michael@0 17 class SkOperandInterpolator : public SkInterpolatorBase {
michael@0 18 public:
michael@0 19 SkOperandInterpolator();
michael@0 20 SkOperandInterpolator(int elemCount, int frameCount, SkDisplayTypes type);
michael@0 21 SkOperand* getValues() { return fValues; }
michael@0 22 int getValuesCount() { return fFrameCount * fElemCount; }
michael@0 23 void reset(int elemCount, int frameCount, SkDisplayTypes type);
michael@0 24
michael@0 25 /** Add or replace a key frame, copying the values[] data into the interpolator.
michael@0 26 @param index The index of this frame (frames must be ordered by time)
michael@0 27 @param time The millisecond time for this frame
michael@0 28 @param values The array of values [elemCount] for this frame. The data is copied
michael@0 29 into the interpolator.
michael@0 30 @param blend A positive scalar specifying how to blend between this and the next key frame.
michael@0 31 [0...1) is a cubic lag/log/lag blend (slow to change at the beginning and end)
michael@0 32 1 is a linear blend (default)
michael@0 33 (1...inf) is a cubic log/lag/log blend (fast to change at the beginning and end)
michael@0 34 */
michael@0 35 bool setKeyFrame(int index, SkMSec time, const SkOperand values[], SkScalar blend = SK_Scalar1);
michael@0 36 Result timeToValues(SkMSec time, SkOperand values[]) const;
michael@0 37 SkDEBUGCODE(static void UnitTest();)
michael@0 38 private:
michael@0 39 SkDisplayTypes fType;
michael@0 40 SkOperand* fValues; // pointer into fStorage
michael@0 41 #ifdef SK_DEBUG
michael@0 42 SkOperand(* fValuesArray)[10];
michael@0 43 #endif
michael@0 44 typedef SkInterpolatorBase INHERITED;
michael@0 45 };
michael@0 46
michael@0 47 #endif // SkOperandInterpolator_DEFINED

mercurial