diff options
author | Florin Malita <fmalita@chromium.org> | 2018-03-07 14:22:55 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-07 14:23:01 +0000 |
commit | 461ef7af88cc966007c464130a971ec86c803f1d (patch) | |
tree | 0a07bb599914f7e37fd80867ad238ae25c825272 /src/core/SkDraw.cpp | |
parent | 08b44fa4975f2d24960c7bfa948bb7cc1c89bba7 (diff) |
Revert "add tiler for SkDraw"
This reverts commit be1b3971806e3d80aa9673a36e2b35d0145198ac.
Reason for revert:
Unexpected layout test diffs: https://test-results.appspot.com/data/layout_results/linux_trusty_blink_rel/24989/layout-test-results/results.html
Original change's description:
> add tiler for SkDraw
>
> Bug: skia:2122
> Change-Id: I276de2064939151eef5fa14c53188e8b5728b7c9
> Reviewed-on: https://skia-review.googlesource.com/110840
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Yuqian Li <liyuqian@google.com>
TBR=liyuqian@google.com,reed@google.com
Change-Id: Ia598c0d7c4ac6cfcdb905b847040c250fa366402
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2122
Reviewed-on: https://skia-review.googlesource.com/112740
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/core/SkDraw.cpp')
-rw-r--r-- | src/core/SkDraw.cpp | 74 |
1 files changed, 42 insertions, 32 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index cf06b7b3b5..21a89ae5a9 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -14,6 +14,7 @@ #include "SkCanvas.h" #include "SkColorData.h" #include "SkDevice.h" +#include "SkDeviceLooper.h" #include "SkDraw.h" #include "SkDrawProcs.h" #include "SkFindAndPlaceGlyph.h" @@ -784,7 +785,8 @@ void SkDraw::drawRect(const SkRect& prePaintRect, const SkPaint& paint, } } - if (!SkRectPriv::FitsInFixed(bbox) && rtype != kHair_RectType) { + if (!SkRectPriv::MakeLargeS32().contains(bbox)) { + // bbox.roundOut() is undefined; use slow path. draw_rect_as_path(*this, prePaintRect, paint, matrix); return; } @@ -794,37 +796,45 @@ void SkDraw::drawRect(const SkRect& prePaintRect, const SkPaint& paint, return; } - SkAutoBlitterChoose blitterStorage(fDst, *matrix, paint); - const SkRasterClip& clip = *fRC; - SkBlitter* blitter = blitterStorage.get(); - - // we want to "fill" if we are kFill or kStrokeAndFill, since in the latter - // case we are also hairline (if we've gotten to here), which devolves to - // effectively just kFill - switch (rtype) { - case kFill_RectType: - if (paint.isAntiAlias()) { - SkScan::AntiFillRect(devRect, clip, blitter); - } else { - SkScan::FillRect(devRect, clip, blitter); - } - break; - case kStroke_RectType: - if (paint.isAntiAlias()) { - SkScan::AntiFrameRect(devRect, strokeSize, clip, blitter); - } else { - SkScan::FrameRect(devRect, strokeSize, clip, blitter); - } - break; - case kHair_RectType: - if (paint.isAntiAlias()) { - SkScan::AntiHairRect(devRect, clip, blitter); - } else { - SkScan::HairRect(devRect, clip, blitter); - } - break; - default: - SkDEBUGFAIL("bad rtype"); + SkDeviceLooper looper(fDst, *fRC, ir, paint.isAntiAlias()); + while (looper.next()) { + SkRect localDevRect; + looper.mapRect(&localDevRect, devRect); + SkMatrix localMatrix; + looper.mapMatrix(&localMatrix, *matrix); + + SkAutoBlitterChoose blitterStorage(looper.getPixmap(), localMatrix, paint); + const SkRasterClip& clip = looper.getRC(); + SkBlitter* blitter = blitterStorage.get(); + + // we want to "fill" if we are kFill or kStrokeAndFill, since in the latter + // case we are also hairline (if we've gotten to here), which devolves to + // effectively just kFill + switch (rtype) { + case kFill_RectType: + if (paint.isAntiAlias()) { + SkScan::AntiFillRect(localDevRect, clip, blitter); + } else { + SkScan::FillRect(localDevRect, clip, blitter); + } + break; + case kStroke_RectType: + if (paint.isAntiAlias()) { + SkScan::AntiFrameRect(localDevRect, strokeSize, clip, blitter); + } else { + SkScan::FrameRect(localDevRect, strokeSize, clip, blitter); + } + break; + case kHair_RectType: + if (paint.isAntiAlias()) { + SkScan::AntiHairRect(localDevRect, clip, blitter); + } else { + SkScan::HairRect(localDevRect, clip, blitter); + } + break; + default: + SkDEBUGFAIL("bad rtype"); + } } } |