gfx/skia/trunk/src/animator/SkDrawMatrix.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 2006 The Android Open Source Project
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef SkDrawMatrix_DEFINED
    11 #define SkDrawMatrix_DEFINED
    13 #include "SkDrawable.h"
    14 #include "SkMatrix.h"
    15 #include "SkMemberInfo.h"
    16 #include "SkIntArray.h"
    18 class SkMatrixPart;
    20 class SkDrawMatrix : public SkDrawable {
    21     DECLARE_DRAW_MEMBER_INFO(Matrix);
    22     SkDrawMatrix();
    23     virtual ~SkDrawMatrix();
    24     virtual bool addChild(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
    25     virtual bool childrenNeedDisposing() const;
    26     virtual void dirty();
    27     virtual bool draw(SkAnimateMaker& );
    28 #ifdef SK_DUMP_ENABLED
    29     virtual void dump(SkAnimateMaker* );
    30 #endif
    31     SkMatrix& getMatrix();
    32     virtual bool getProperty(int index, SkScriptValue* value) const;
    33     virtual void initialize();
    34     virtual void onEndElement(SkAnimateMaker& );
    35     virtual void setChildHasID();
    36     virtual bool setProperty(int index, SkScriptValue& );
    38     void concat(SkMatrix& inMatrix) {
    39         fConcat.preConcat(inMatrix);
    40     }
    42     virtual SkDisplayable* deepCopy(SkAnimateMaker* );
    45     void rotate(SkScalar degrees, SkPoint& center) {
    46         fMatrix.preRotate(degrees, center.fX, center.fY);
    47     }
    49     void set(SkMatrix& src) {
    50         fMatrix.preConcat(src);
    51     }
    53     void scale(SkScalar scaleX, SkScalar scaleY, SkPoint& center) {
    54         fMatrix.preScale(scaleX, scaleY, center.fX, center.fY);
    55     }
    57     void skew(SkScalar skewX, SkScalar skewY, SkPoint& center) {
    58         fMatrix.preSkew(skewX, skewY, center.fX, center.fY);
    59     }
    61     void translate(SkScalar x, SkScalar y) {
    62         fMatrix.preTranslate(x, y);
    63     }
    64 private:
    65     SkTDScalarArray matrix;
    66     SkMatrix fConcat;
    67     SkMatrix fMatrix;
    68     SkTDMatrixPartArray fParts;
    69     SkBool8 fChildHasID;
    70     SkBool8 fDirty;
    71     typedef SkDrawable INHERITED;
    72 };
    74 #endif // SkDrawMatrix_DEFINED

mercurial