Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ANDROID_HWUI_VPATH_H |
| 18 | #define ANDROID_HWUI_VPATH_H |
| 19 | |
| 20 | #include "Canvas.h" |
| 21 | #include <SkBitmap.h> |
| 22 | #include <SkColor.h> |
Doris Liu | c2de46f | 2016-01-21 12:55:54 -0800 | [diff] [blame] | 23 | #include <SkCanvas.h> |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 24 | #include <SkMatrix.h> |
| 25 | #include <SkPaint.h> |
| 26 | #include <SkPath.h> |
| 27 | #include <SkPathMeasure.h> |
| 28 | #include <SkRect.h> |
Teng-Hui Zhu | dbee9bb | 2015-12-15 11:01:27 -0800 | [diff] [blame] | 29 | #include <SkShader.h> |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 30 | |
| 31 | #include <cutils/compiler.h> |
| 32 | #include <stddef.h> |
| 33 | #include <vector> |
| 34 | #include <string> |
| 35 | |
| 36 | namespace android { |
| 37 | namespace uirenderer { |
| 38 | |
| 39 | namespace VectorDrawable { |
| 40 | #define VD_SET_PROP_WITH_FLAG(field, value, flag) (VD_SET_PROP(field, value) ? (flag = true, true): false); |
| 41 | #define VD_SET_PROP(field, value) (value != field ? (field = value, true) : false) |
| 42 | |
| 43 | /* A VectorDrawable is composed of a tree of nodes. |
| 44 | * Each node can be a group node, or a path. |
| 45 | * A group node can have groups or paths as children, but a path node has |
| 46 | * no children. |
| 47 | * One example can be: |
| 48 | * Root Group |
| 49 | * / | \ |
| 50 | * Group Path Group |
| 51 | * / \ | |
| 52 | * Path Path Path |
| 53 | * |
| 54 | */ |
| 55 | class ANDROID_API Node { |
| 56 | public: |
| 57 | Node(const Node& node) { |
| 58 | mName = node.mName; |
| 59 | } |
| 60 | Node() {} |
Doris Liu | c2de46f | 2016-01-21 12:55:54 -0800 | [diff] [blame] | 61 | virtual void draw(SkCanvas* outCanvas, const SkMatrix& currentMatrix, |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 62 | float scaleX, float scaleY) = 0; |
| 63 | virtual void dump() = 0; |
| 64 | void setName(const char* name) { |
| 65 | mName = name; |
| 66 | } |
| 67 | virtual ~Node(){} |
| 68 | protected: |
| 69 | std::string mName; |
| 70 | }; |
| 71 | |
| 72 | class ANDROID_API Path : public Node { |
| 73 | public: |
| 74 | struct ANDROID_API Data { |
| 75 | std::vector<char> verbs; |
| 76 | std::vector<size_t> verbSizes; |
| 77 | std::vector<float> points; |
| 78 | bool operator==(const Data& data) const { |
| 79 | return verbs == data.verbs && verbSizes == data.verbSizes |
| 80 | && points == data.points; |
| 81 | } |
| 82 | }; |
| 83 | Path(const Data& nodes); |
| 84 | Path(const Path& path); |
| 85 | Path(const char* path, size_t strLength); |
| 86 | Path() {} |
| 87 | void dump() override; |
| 88 | bool canMorph(const Data& path); |
| 89 | bool canMorph(const Path& path); |
Doris Liu | c2de46f | 2016-01-21 12:55:54 -0800 | [diff] [blame] | 90 | void draw(SkCanvas* outCanvas, const SkMatrix& groupStackedMatrix, |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 91 | float scaleX, float scaleY) override; |
| 92 | void setPath(const char* path, size_t strLength); |
| 93 | void setPathData(const Data& data); |
| 94 | static float getMatrixScale(const SkMatrix& groupStackedMatrix); |
| 95 | |
| 96 | protected: |
| 97 | virtual const SkPath& getUpdatedPath(); |
Doris Liu | c2de46f | 2016-01-21 12:55:54 -0800 | [diff] [blame] | 98 | virtual void drawPath(SkCanvas *outCanvas, const SkPath& renderPath, |
Teng-Hui Zhu | dbee9bb | 2015-12-15 11:01:27 -0800 | [diff] [blame] | 99 | float strokeScale, const SkMatrix& matrix) = 0; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 100 | Data mData; |
| 101 | SkPath mSkPath; |
| 102 | bool mSkPathDirty = true; |
| 103 | }; |
| 104 | |
| 105 | class ANDROID_API FullPath: public Path { |
| 106 | public: |
| 107 | FullPath(const FullPath& path); // for cloning |
| 108 | FullPath(const char* path, size_t strLength) : Path(path, strLength) {} |
| 109 | FullPath() : Path() {} |
| 110 | FullPath(const Data& nodes) : Path(nodes) {} |
| 111 | |
Teng-Hui Zhu | dbee9bb | 2015-12-15 11:01:27 -0800 | [diff] [blame] | 112 | ~FullPath() { |
| 113 | SkSafeUnref(mFillGradient); |
| 114 | SkSafeUnref(mStrokeGradient); |
| 115 | } |
| 116 | |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 117 | void updateProperties(float strokeWidth, SkColor strokeColor, |
| 118 | float strokeAlpha, SkColor fillColor, float fillAlpha, |
| 119 | float trimPathStart, float trimPathEnd, float trimPathOffset, |
| 120 | float strokeMiterLimit, int strokeLineCap, int strokeLineJoin); |
| 121 | float getStrokeWidth() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 122 | return mStrokeWidth; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 123 | } |
| 124 | void setStrokeWidth(float strokeWidth) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 125 | mStrokeWidth = strokeWidth; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 126 | } |
| 127 | SkColor getStrokeColor() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 128 | return mStrokeColor; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 129 | } |
| 130 | void setStrokeColor(SkColor strokeColor) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 131 | mStrokeColor = strokeColor; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 132 | } |
| 133 | float getStrokeAlpha() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 134 | return mStrokeAlpha; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 135 | } |
| 136 | void setStrokeAlpha(float strokeAlpha) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 137 | mStrokeAlpha = strokeAlpha; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 138 | } |
| 139 | SkColor getFillColor() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 140 | return mFillColor; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 141 | } |
| 142 | void setFillColor(SkColor fillColor) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 143 | mFillColor = fillColor; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 144 | } |
| 145 | float getFillAlpha() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 146 | return mFillAlpha; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 147 | } |
| 148 | void setFillAlpha(float fillAlpha) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 149 | mFillAlpha = fillAlpha; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 150 | } |
| 151 | float getTrimPathStart() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 152 | return mTrimPathStart; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 153 | } |
| 154 | void setTrimPathStart(float trimPathStart) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 155 | VD_SET_PROP_WITH_FLAG(mTrimPathStart, trimPathStart, mTrimDirty); |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 156 | } |
| 157 | float getTrimPathEnd() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 158 | return mTrimPathEnd; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 159 | } |
| 160 | void setTrimPathEnd(float trimPathEnd) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 161 | VD_SET_PROP_WITH_FLAG(mTrimPathEnd, trimPathEnd, mTrimDirty); |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 162 | } |
| 163 | float getTrimPathOffset() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 164 | return mTrimPathOffset; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 165 | } |
| 166 | void setTrimPathOffset(float trimPathOffset) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 167 | VD_SET_PROP_WITH_FLAG(mTrimPathOffset, trimPathOffset, mTrimDirty); |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 168 | } |
| 169 | bool getProperties(int8_t* outProperties, int length); |
| 170 | |
Teng-Hui Zhu | dbee9bb | 2015-12-15 11:01:27 -0800 | [diff] [blame] | 171 | void setFillGradient(SkShader* fillGradient) { |
| 172 | SkRefCnt_SafeAssign(mFillGradient, fillGradient); |
| 173 | }; |
| 174 | void setStrokeGradient(SkShader* strokeGradient) { |
| 175 | SkRefCnt_SafeAssign(mStrokeGradient, strokeGradient); |
| 176 | }; |
| 177 | |
| 178 | |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 179 | protected: |
| 180 | const SkPath& getUpdatedPath() override; |
Doris Liu | c2de46f | 2016-01-21 12:55:54 -0800 | [diff] [blame] | 181 | void drawPath(SkCanvas* outCanvas, const SkPath& renderPath, |
Teng-Hui Zhu | dbee9bb | 2015-12-15 11:01:27 -0800 | [diff] [blame] | 182 | float strokeScale, const SkMatrix& matrix) override; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 183 | |
| 184 | private: |
| 185 | // Applies trimming to the specified path. |
| 186 | void applyTrim(); |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 187 | float mStrokeWidth = 0; |
| 188 | SkColor mStrokeColor = SK_ColorTRANSPARENT; |
| 189 | float mStrokeAlpha = 1; |
| 190 | SkColor mFillColor = SK_ColorTRANSPARENT; |
Doris Liu | f276acd | 2016-01-07 13:49:26 -0800 | [diff] [blame] | 191 | SkShader* mStrokeGradient = nullptr; |
| 192 | SkShader* mFillGradient = nullptr; |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 193 | float mFillAlpha = 1; |
| 194 | float mTrimPathStart = 0; |
| 195 | float mTrimPathEnd = 1; |
| 196 | float mTrimPathOffset = 0; |
| 197 | bool mTrimDirty = true; |
| 198 | SkPaint::Cap mStrokeLineCap = SkPaint::Cap::kButt_Cap; |
| 199 | SkPaint::Join mStrokeLineJoin = SkPaint::Join::kMiter_Join; |
| 200 | float mStrokeMiterLimit = 4; |
| 201 | SkPath mTrimmedSkPath; |
| 202 | SkPaint mPaint; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 203 | }; |
| 204 | |
| 205 | class ANDROID_API ClipPath: public Path { |
| 206 | public: |
| 207 | ClipPath(const ClipPath& path) : Path(path) {} |
| 208 | ClipPath(const char* path, size_t strLength) : Path(path, strLength) {} |
| 209 | ClipPath() : Path() {} |
| 210 | ClipPath(const Data& nodes) : Path(nodes) {} |
| 211 | |
| 212 | protected: |
Doris Liu | c2de46f | 2016-01-21 12:55:54 -0800 | [diff] [blame] | 213 | void drawPath(SkCanvas* outCanvas, const SkPath& renderPath, |
Teng-Hui Zhu | dbee9bb | 2015-12-15 11:01:27 -0800 | [diff] [blame] | 214 | float strokeScale, const SkMatrix& matrix) override; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 215 | }; |
| 216 | |
| 217 | class ANDROID_API Group: public Node { |
| 218 | public: |
| 219 | Group(const Group& group); |
| 220 | Group() {} |
| 221 | float getRotation() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 222 | return mRotate; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 223 | } |
| 224 | void setRotation(float rotation) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 225 | mRotate = rotation; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 226 | } |
| 227 | float getPivotX() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 228 | return mPivotX; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 229 | } |
| 230 | void setPivotX(float pivotX) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 231 | mPivotX = pivotX; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 232 | } |
| 233 | float getPivotY() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 234 | return mPivotY; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 235 | } |
| 236 | void setPivotY(float pivotY) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 237 | mPivotY = pivotY; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 238 | } |
| 239 | float getScaleX() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 240 | return mScaleX; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 241 | } |
| 242 | void setScaleX(float scaleX) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 243 | mScaleX = scaleX; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 244 | } |
| 245 | float getScaleY() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 246 | return mScaleY; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 247 | } |
| 248 | void setScaleY(float scaleY) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 249 | mScaleY = scaleY; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 250 | } |
| 251 | float getTranslateX() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 252 | return mTranslateX; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 253 | } |
| 254 | void setTranslateX(float translateX) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 255 | mTranslateX = translateX; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 256 | } |
| 257 | float getTranslateY() { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 258 | return mTranslateY; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 259 | } |
| 260 | void setTranslateY(float translateY) { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 261 | mTranslateY = translateY; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 262 | } |
Doris Liu | c2de46f | 2016-01-21 12:55:54 -0800 | [diff] [blame] | 263 | virtual void draw(SkCanvas* outCanvas, const SkMatrix& currentMatrix, |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 264 | float scaleX, float scaleY) override; |
| 265 | void updateLocalMatrix(float rotate, float pivotX, float pivotY, |
| 266 | float scaleX, float scaleY, float translateX, float translateY); |
| 267 | void getLocalMatrix(SkMatrix* outMatrix); |
| 268 | void addChild(Node* child); |
| 269 | void dump() override; |
| 270 | bool getProperties(float* outProperties, int length); |
| 271 | |
| 272 | private: |
| 273 | enum class Property { |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 274 | Rotate_Property = 0, |
| 275 | PivotX_Property, |
| 276 | PivotY_Property, |
| 277 | ScaleX_Property, |
| 278 | ScaleY_Property, |
| 279 | TranslateX_Property, |
| 280 | TranslateY_Property, |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 281 | // Count of the properties, must be at the end. |
| 282 | Count, |
| 283 | }; |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 284 | float mRotate = 0; |
| 285 | float mPivotX = 0; |
| 286 | float mPivotY = 0; |
| 287 | float mScaleX = 1; |
| 288 | float mScaleY = 1; |
| 289 | float mTranslateX = 0; |
| 290 | float mTranslateY = 0; |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 291 | std::vector<Node*> mChildren; |
| 292 | }; |
| 293 | |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 294 | class ANDROID_API Tree { |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 295 | public: |
| 296 | Tree(Group* rootNode) : mRootNode(rootNode) {} |
| 297 | void draw(Canvas* outCanvas, SkColorFilter* colorFilter, |
| 298 | const SkRect& bounds, bool needsMirroring, bool canReuseCache); |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 299 | void drawCachedBitmapWithRootAlpha(Canvas* outCanvas, SkColorFilter* filter, |
| 300 | const SkRect& originalBounds); |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 301 | |
Doris Liu | 5a11e8d | 2016-02-04 20:04:10 +0000 | [diff] [blame^] | 302 | void updateCachedBitmap(int width, int height); |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 303 | void createCachedBitmapIfNeeded(int width, int height); |
| 304 | bool canReuseBitmap(int width, int height); |
| 305 | void setAllowCaching(bool allowCaching) { |
| 306 | mAllowCaching = allowCaching; |
| 307 | } |
| 308 | bool setRootAlpha(float rootAlpha) { |
| 309 | return VD_SET_PROP(mRootAlpha, rootAlpha); |
| 310 | } |
| 311 | |
| 312 | float getRootAlpha() { |
| 313 | return mRootAlpha; |
| 314 | } |
| 315 | void setViewportSize(float viewportWidth, float viewportHeight) { |
| 316 | mViewportWidth = viewportWidth; |
| 317 | mViewportHeight = viewportHeight; |
| 318 | } |
Doris Liu | 4bbc293 | 2015-12-01 17:59:40 -0800 | [diff] [blame] | 319 | |
| 320 | private: |
| 321 | // Cap the bitmap size, such that it won't hurt the performance too much |
| 322 | // and it won't crash due to a very large scale. |
| 323 | // The drawable will look blurry above this size. |
| 324 | const static int MAX_CACHED_BITMAP_SIZE; |
| 325 | |
| 326 | bool mCacheDirty = true; |
| 327 | bool mAllowCaching = true; |
| 328 | float mViewportWidth = 0; |
| 329 | float mViewportHeight = 0; |
| 330 | float mRootAlpha = 1.0f; |
| 331 | |
| 332 | Group* mRootNode; |
| 333 | SkRect mBounds; |
| 334 | SkMatrix mCanvasMatrix; |
| 335 | SkPaint mPaint; |
| 336 | SkPathMeasure mPathMeasure; |
| 337 | SkBitmap mCachedBitmap; |
| 338 | |
| 339 | }; |
| 340 | |
| 341 | } // namespace VectorDrawable |
| 342 | |
| 343 | typedef VectorDrawable::Path::Data PathData; |
| 344 | } // namespace uirenderer |
| 345 | } // namespace android |
| 346 | |
| 347 | #endif // ANDROID_HWUI_VPATH_H |