diff options
author | msarett <msarett@google.com> | 2016-09-02 11:24:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-02 11:24:30 -0700 |
commit | 0764efe6a9ae65ad83992f614f57ca9db5b1f191 (patch) | |
tree | 0093acd4cd619336ccd5f6b06748e9928af438ef /src/core/SkRecorder.cpp | |
parent | 005327b9ddbf0bb2890c7d563b3d9a8ea8a284f6 (diff) |
Add option to skip rects to drawImageLattice()
HWUI skips transparent rects when drawing.
When skia draws using bilerp, we will blend
transparent rects with neighboring rects and might
draw a bit of a smudge.
This CL adds the option to skip rects, allowing us
to have compatible behavior with the framework.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2305433002
Review-Url: https://codereview.chromium.org/2305433002
Diffstat (limited to 'src/core/SkRecorder.cpp')
-rw-r--r-- | src/core/SkRecorder.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp index 840e19b90d..4c09e514be 100644 --- a/src/core/SkRecorder.cpp +++ b/src/core/SkRecorder.cpp @@ -238,9 +238,11 @@ void SkRecorder::onDrawImageNine(const SkImage* image, const SkIRect& center, void SkRecorder::onDrawImageLattice(const SkImage* image, const Lattice& lattice, const SkRect& dst, const SkPaint* paint) { + int flagCount = lattice.fFlags ? (lattice.fXCount + 1) * (lattice.fYCount + 1) : 0; APPEND(DrawImageLattice, this->copy(paint), sk_ref_sp(image), lattice.fXCount, this->copy(lattice.fXDivs, lattice.fXCount), - lattice.fYCount, this->copy(lattice.fYDivs, lattice.fYCount), dst); + lattice.fYCount, this->copy(lattice.fYDivs, lattice.fYCount), + flagCount, this->copy(lattice.fFlags, flagCount), dst); } void SkRecorder::onDrawText(const void* text, size_t byteLength, |