add FillIRect variant that takes a rasterclip
git-svn-id: http://skia.googlecode.com/svn/trunk@2478 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
29ffc03677
commit
da96563e31
@ -78,6 +78,7 @@ public:
|
||||
const SkRegion*, SkBlitter*);
|
||||
|
||||
// rasterclip
|
||||
static void FillIRect(const SkIRect&, const SkRasterClip&, SkBlitter*);
|
||||
static void FillPath(const SkPath&, const SkRasterClip&, SkBlitter*);
|
||||
static void AntiFillPath(const SkPath&, const SkRasterClip&, SkBlitter*);
|
||||
};
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user