gfx/skia/trunk/src/animator/SkAnimatorScript2.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.

     2 /*
     3  * Copyright 2011 Google Inc.
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
     8 #ifndef SkAnimatorScript2_DEFINED
     9 #define SkAnimatorScript2_DEFINED
    11 #include "SkDisplayable.h"
    12 #include "SkScript2.h"
    13 #include "SkTypedArray.h"
    15 class SkAnimateMaker;
    16 struct SkMemberInfo;
    18 #ifndef SkAnimatorScript_DEFINED
    19 struct SkDisplayEnumMap {
    20     SkDisplayTypes fType;
    21     const char* fValues;
    22 };
    23 #endif
    25 class SkAnimatorScript2 : public SkScriptEngine2 {
    26 public:
    27     SkAnimatorScript2(SkAnimateMaker& , SkDisplayable* working, SkDisplayTypes type);
    28     ~SkAnimatorScript2();
    29     bool evalMemberCommon(const SkMemberInfo* info,
    30         SkDisplayable* displayable, SkOperand2* value);
    31     SkAnimateMaker& getMaker() { return fMaker; }
    32     SkDisplayable* getWorking() { return fWorking; }
    33     static bool MapEnums(const char* ptr, const char* match, size_t len, int* value);
    34     static const SkDisplayEnumMap& GetEnumValues(SkDisplayTypes type);
    35     static SkDisplayTypes ToDisplayType(SkOperand2::OpType type);
    36     static SkOperand2::OpType ToOpType(SkDisplayTypes type);
    37 private:
    38     SkAnimateMaker& fMaker;
    39     SkDisplayable* fWorking;
    40     friend class SkDump;
    41     friend struct SkScriptNAnswer;
    42     // illegal
    43     SkAnimatorScript2& operator=(const SkAnimatorScript2&);
    44 #ifdef SK_DEBUG
    45 public:
    46     static void UnitTest();
    47 #endif
    48 };
    50 #endif // SkAnimatorScript2_DEFINED

mercurial