aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBlitter.cpp
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2018-02-15 11:19:55 +0800
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-21 09:28:04 +0000
commitaefcccb5d84fb0e0cb8161d4021e8fbd724e2d9e (patch)
tree2a4f50a0abf549dd6d38782a221a849e288458b3 /src/core/SkBlitter.cpp
parent9fd8eb6fecb1d807809e2e58aa35a2f349ff9c2b (diff)
Enable DAA in the init-once phase of threaded backends
Bug: skia: Change-Id: Idb856fe12f0f9fa1014e7d15ef40bd7b456634d6 Reviewed-on: https://skia-review.googlesource.com/107540 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/core/SkBlitter.cpp')
-rw-r--r--src/core/SkBlitter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index 7a3e904e09..24494c1e71 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -92,7 +92,11 @@ void SkBlitter::blitCoverageDeltas(SkCoverageDeltaList* deltas, const SkIRect& c
bool canUseMask = !deltas->forceRLE() &&
SkCoverageDeltaMask::CanHandle(SkIRect::MakeLTRB(0, 0, clip.width(), 1));
const SkAntiRect& antiRect = deltas->getAntiRect();
- for(int y = deltas->top(); y < deltas->bottom(); ++y) {
+
+ // Only access rows within our clip. Otherwise, we'll have data race in the threaded backend.
+ int top = SkTMax(deltas->top(), clip.fTop);
+ int bottom = SkTMin(deltas->bottom(), clip.fBottom);
+ for(int y = top; y < bottom; ++y) {
// If antiRect is non-empty and we're at its top row, blit it and skip to the bottom
if (antiRect.fHeight && y == antiRect.fY) {
this->blitAntiRect(antiRect.fX, antiRect.fY, antiRect.fWidth, antiRect.fHeight,