aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkScan_DAAPath.cpp
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2017-09-25 11:18:08 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-25 18:56:10 +0000
commitf60c1a3ef905dc034dfcc91267fea382f77acea6 (patch)
tree1d70ea45a01b917ab4e091102656efcf7dfc8f11 /src/core/SkScan_DAAPath.cpp
parent29bf84f08a3716ae672dc06c237fc259fccbd136 (diff)
Reland blitFatAntiRect with guard to avoid overhead in MaskAdditiveBlitter
This results in ~15% (~700ns vs ~600ns) speedup for path_fill_small_rect bench in 8888 config. Some skps have a lot of stroked horizontal/vertical lines (e.g., bar charts) so this improvement could have a great impact there. For example, cereal converts Microsoft word docx to PNGs on server and the sample docx has a big bar chart. That inspired this improvement. Bug: skia: Change-Id: If191b8beca58c5c08b356b64ffef93d51761fd0a Reviewed-on: https://skia-review.googlesource.com/50043 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/core/SkScan_DAAPath.cpp')
-rw-r--r--src/core/SkScan_DAAPath.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/core/SkScan_DAAPath.cpp b/src/core/SkScan_DAAPath.cpp
index 9250d02f07..a9195eb085 100644
--- a/src/core/SkScan_DAAPath.cpp
+++ b/src/core/SkScan_DAAPath.cpp
@@ -328,14 +328,9 @@ void SkScan::DAAFillPath(const SkPath& path, const SkRegion& origClip, SkBlitter
SkIRect clippedIR = ir;
clippedIR.intersect(clipBounds);
- SkRect rect;
- if (!isInverse && path.isRect(&rect) && clippedIR.height() >= 3 && clippedIR.width() >= 3) {
- // The overhead of even constructing SkCoverageDeltaList/Mask is too big. So just blit.
- bool nonEmpty = rect.intersect(SkRect::Make(clipBounds));
- SkASSERT(nonEmpty); // do_fill_path should have already handled the empty case
- if (nonEmpty) {
- blitter->blitFatAntiRect(rect);
- }
+ // The overhead of even constructing SkCoverageDeltaList/Mask is too big.
+ // So TryBlitFatAntiRect and return if it's successful.
+ if (TryBlitFatAntiRect(blitter, path, clipBounds)) {
return;
}