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.

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 SkDrawMatrix_DEFINED
michael@0 11 #define SkDrawMatrix_DEFINED
michael@0 12
michael@0 13 #include "SkDrawable.h"
michael@0 14 #include "SkMatrix.h"
michael@0 15 #include "SkMemberInfo.h"
michael@0 16 #include "SkIntArray.h"
michael@0 17
michael@0 18 class SkMatrixPart;
michael@0 19
michael@0 20 class SkDrawMatrix : public SkDrawable {
michael@0 21 DECLARE_DRAW_MEMBER_INFO(Matrix);
michael@0 22 SkDrawMatrix();
michael@0 23 virtual ~SkDrawMatrix();
michael@0 24 virtual bool addChild(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
michael@0 25 virtual bool childrenNeedDisposing() const;
michael@0 26 virtual void dirty();
michael@0 27 virtual bool draw(SkAnimateMaker& );
michael@0 28 #ifdef SK_DUMP_ENABLED
michael@0 29 virtual void dump(SkAnimateMaker* );
michael@0 30 #endif
michael@0 31 SkMatrix& getMatrix();
michael@0 32 virtual bool getProperty(int index, SkScriptValue* value) const;
michael@0 33 virtual void initialize();
michael@0 34 virtual void onEndElement(SkAnimateMaker& );
michael@0 35 virtual void setChildHasID();
michael@0 36 virtual bool setProperty(int index, SkScriptValue& );
michael@0 37
michael@0 38 void concat(SkMatrix& inMatrix) {
michael@0 39 fConcat.preConcat(inMatrix);
michael@0 40 }
michael@0 41
michael@0 42 virtual SkDisplayable* deepCopy(SkAnimateMaker* );
michael@0 43
michael@0 44
michael@0 45 void rotate(SkScalar degrees, SkPoint& center) {
michael@0 46 fMatrix.preRotate(degrees, center.fX, center.fY);
michael@0 47 }
michael@0 48
michael@0 49 void set(SkMatrix& src) {
michael@0 50 fMatrix.preConcat(src);
michael@0 51 }
michael@0 52
michael@0 53 void scale(SkScalar scaleX, SkScalar scaleY, SkPoint& center) {
michael@0 54 fMatrix.preScale(scaleX, scaleY, center.fX, center.fY);
michael@0 55 }
michael@0 56
michael@0 57 void skew(SkScalar skewX, SkScalar skewY, SkPoint& center) {
michael@0 58 fMatrix.preSkew(skewX, skewY, center.fX, center.fY);
michael@0 59 }
michael@0 60
michael@0 61 void translate(SkScalar x, SkScalar y) {
michael@0 62 fMatrix.preTranslate(x, y);
michael@0 63 }
michael@0 64 private:
michael@0 65 SkTDScalarArray matrix;
michael@0 66 SkMatrix fConcat;
michael@0 67 SkMatrix fMatrix;
michael@0 68 SkTDMatrixPartArray fParts;
michael@0 69 SkBool8 fChildHasID;
michael@0 70 SkBool8 fDirty;
michael@0 71 typedef SkDrawable INHERITED;
michael@0 72 };
michael@0 73
michael@0 74 #endif // SkDrawMatrix_DEFINED

mercurial