diff options
author | egdaniel <egdaniel@google.com> | 2014-06-12 10:24:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-12 10:24:21 -0700 |
commit | e61c411c1258a323a010558c08de3d9f8d170dca (patch) | |
tree | 295c5f7a9ec0001daf7b87e2573e9f74ffbe3d3b /src/core | |
parent | b205d09b296e01f1c4debdf7f60d2f3e4cd2ea43 (diff) |
Use vertex attributes for dash effect in gpu
This will allow us to batch dashed lines together when drawing. Also, this removes the need for
a coord transform matrix in the shader, thus we save the cost of uploading a new matrix uniform
everytime we do a simple transform to the dashed line we are drawing.
BUG=skia:
R=bsalomon@google.com
Author: egdaniel@google.com
Review URL: https://codereview.chromium.org/326103002
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkStrokeRec.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/SkStrokeRec.cpp b/src/core/SkStrokeRec.cpp index ce744e501b..a4c73af2c5 100644 --- a/src/core/SkStrokeRec.cpp +++ b/src/core/SkStrokeRec.cpp @@ -24,7 +24,15 @@ SkStrokeRec::SkStrokeRec(const SkStrokeRec& src) { } SkStrokeRec::SkStrokeRec(const SkPaint& paint) { - switch (paint.getStyle()) { + this->init(paint, paint.getStyle()); +} + +SkStrokeRec::SkStrokeRec(const SkPaint& paint, SkPaint::Style styleOverride) { + this->init(paint, styleOverride); +} + +void SkStrokeRec::init(const SkPaint& paint, SkPaint::Style style) { + switch (style) { case SkPaint::kFill_Style: fWidth = kStrokeRec_FillStyleWidth; fStrokeAndFill = false; |