aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDraw.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/SkDraw.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/SkDraw.cpp')
-rw-r--r--src/core/SkDraw.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 478617f828..4b847db295 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1019,7 +1019,7 @@ void SkDraw::drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawC
if (iData == nullptr) {
proc(devPath, *fRC, blitter); // proceed directly if we're not in threaded init-once
- } else if (true || !doFill || !paint.isAntiAlias()) {
+ } else if (!doFill || !paint.isAntiAlias()) {
// TODO remove true in the if statement above so we can proceed to DAA.
// We're in threaded init-once but we can't use DAA. Hence we'll stop here and hand all the
@@ -1033,7 +1033,15 @@ void SkDraw::drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawC
});
} else {
// We can use DAA to do scan conversion in the init-once phase.
- // TODO To be implemented
+ SkDAARecord* record = iData->fAlloc->make<SkDAARecord>(iData->fAlloc);
+ SkNullBlitter nullBlitter; // We don't want to blit anything during the init phase
+ SkScan::AntiFillPath(devPath, *fRC, &nullBlitter, record);
+ iData->fElement->setDrawFn([record, devPath, blitter](SkArenaAlloc* alloc,
+ const SkThreadedBMPDevice::DrawState& ds, const SkIRect& tileBounds) {
+ SkASSERT(record->fType != SkDAARecord::Type::kToBeComputed);
+ SkThreadedBMPDevice::TileDraw tileDraw(ds, tileBounds);
+ SkScan::AntiFillPath(devPath, *tileDraw.fRC, blitter, record);
+ });
}
}