diff options
author | mtklein <mtklein@chromium.org> | 2014-12-03 11:08:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-03 11:08:47 -0800 |
commit | 96a6c4df417a2382dd183b0dbc1c614819795f2a (patch) | |
tree | 4419b5def582eaeb7923625708ab486b006c70e8 /src/core/SkDrawLooper.cpp | |
parent | 85a5750ffa71bf595d5e70e14b233d708be24ee9 (diff) |
Copy src in SkDrawLooper::computeFastBounds().
We do alias src and dst when building the BBH. This meant we calculated
the wrong bounds in LayoutTests/ietestcenter/css3/text/textshadow-010.htm.
Not sure how best to test this inside Skia. It may become moot after I
work through the API changes we were talking about today, but if not I'll
make sure it's tested somehow before I'm done with SkDrawLoopers.
BUG=skia:3186
Review URL: https://codereview.chromium.org/760023004
Diffstat (limited to 'src/core/SkDrawLooper.cpp')
-rw-r--r-- | src/core/SkDrawLooper.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/SkDrawLooper.cpp b/src/core/SkDrawLooper.cpp index d18d12710a..1af68a2289 100644 --- a/src/core/SkDrawLooper.cpp +++ b/src/core/SkDrawLooper.cpp @@ -32,8 +32,11 @@ bool SkDrawLooper::canComputeFastBounds(const SkPaint& paint) const { return true; } -void SkDrawLooper::computeFastBounds(const SkPaint& paint, const SkRect& src, +void SkDrawLooper::computeFastBounds(const SkPaint& paint, const SkRect& s, SkRect* dst) const { + // src and dst rects may alias and we need to keep the original src, so copy it. + const SkRect src = s; + SkCanvas canvas; SkSmallAllocator<1, 32> allocator; void* buffer = allocator.reserveT<SkDrawLooper::Context>(this->contextSize()); |