aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBlitter.cpp
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2017-09-15 17:39:09 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-18 18:10:03 +0000
commit6d1aaca8276ff4ae2e10870f7e2c3222907cc4aa (patch)
treea38b2a56507ec0b3906322bf842905ebfc88e7b2 /src/core/SkBlitter.cpp
parente6c0dee067f6cdb84c98aab3bd9270c24b995084 (diff)
Call blitFatAntiRect to avoid overhead in MaskAdditiveBlitter
This results in 25% (720ns vs 560ns) 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: Icf96c966edf87427b3d1f53da09a49930eda2ac1 Reviewed-on: https://skia-review.googlesource.com/46584 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/core/SkBlitter.cpp')
-rw-r--r--src/core/SkBlitter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index 5eb5dd80d0..8059f6ed57 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -45,9 +45,8 @@ inline static SkAlpha ScalarToAlpha(SkScalar a) {
return (SkAlpha)(a * 255);
}
-void SkBlitter::blitFatAntiRect(const SkRect& rect) {
- SkIRect bounds = rect.roundOut();
- SkASSERT(bounds.width() >= 3 && bounds.height() >= 3);
+void SkBlitter::blitFatAntiRect(const SkRect& rect, const SkIRect& bounds) {
+ SkASSERT(rect.roundOut() == bounds && bounds.width() >= 3 && bounds.height() >= 3);
int runSize = bounds.width() + 1; // +1 so we can set runs[bounds.width()] = 0
void* storage = this->allocBlitMemory(runSize * (sizeof(int16_t) + sizeof(SkAlpha)));