diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-13 15:29:01 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-13 15:29:01 +0000 |
commit | da96563e31e57d28648087f0ef2806f4489b13d4 (patch) | |
tree | 9c2a4b98dc931dc9ef28fa260dabcfd12d88713a /src/core/SkScan.cpp | |
parent | 29ffc03677195bf6f82fa0b168f6f787bc80417f (diff) |
add FillIRect variant that takes a rasterclip
git-svn-id: http://skia.googlecode.com/svn/trunk@2478 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkScan.cpp')
-rw-r--r-- | src/core/SkScan.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/core/SkScan.cpp b/src/core/SkScan.cpp index 719b0bcc7f..ce46669fbd 100644 --- a/src/core/SkScan.cpp +++ b/src/core/SkScan.cpp @@ -9,7 +9,7 @@ #include "SkScan.h" #include "SkBlitter.h" -#include "SkRegion.h" +#include "SkRasterClip.h" static inline void blitrect(SkBlitter* blitter, const SkIRect& r) { blitter->blitRect(r.fLeft, r.fTop, r.width(), r.height()); @@ -65,3 +65,25 @@ void SkScan::FillRect(const SkRect& r, const SkRegion* clip, #endif +/////////////////////////////////////////////////////////////////////////////// + +void SkScan::FillIRect(const SkIRect& r, const SkRasterClip& clip, + SkBlitter* blitter) { + if (clip.isEmpty() || r.isEmpty()) { + return; + } + + if (clip.isBW()) { + FillIRect(r, &clip.bwRgn(), blitter); + return; + } + + const SkAAClip* aaClip = &clip.aaRgn(); + SkRegion tmp; + SkAAClipBlitter aaBlitter; + + tmp.setRect(aaClip->getBounds()); + aaBlitter.init(blitter, aaClip); + FillIRect(r, &tmp, &aaBlitter); +} + |