diff options
author | 2011-03-04 22:27:10 +0000 | |
---|---|---|
committer | 2011-03-04 22:27:10 +0000 | |
commit | 6f8f292aa768869a9e85c314b124875f57504f2c (patch) | |
tree | f6131fb47de094839c6a3defecabf8c0fec6e26d /gpu/src/GrClip.cpp | |
parent | f966fd35cf37562df7aaaf08a490582b764ba170 (diff) |
add origin to device
used for interpreting the clipstack when a device is a layer
git-svn-id: http://skia.googlecode.com/svn/trunk@894 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrClip.cpp')
-rw-r--r-- | gpu/src/GrClip.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gpu/src/GrClip.cpp b/gpu/src/GrClip.cpp index 924c01b9f8..5ba991bb1c 100644 --- a/gpu/src/GrClip.cpp +++ b/gpu/src/GrClip.cpp @@ -38,9 +38,10 @@ GrClip::GrClip(const GrRect& rect) this->setFromRect(rect); } -GrClip::GrClip(GrClipIterator* iter, const GrRect* bounds) +GrClip::GrClip(GrClipIterator* iter, GrScalar tx, GrScalar ty, + const GrRect* bounds) : fList(fListMemory, kPreAllocElements) { - this->setFromIterator(iter, bounds); + this->setFromIterator(iter, tx, ty, bounds); } GrClip::~GrClip() {} @@ -86,7 +87,8 @@ void GrClip::setFromIRect(const GrIRect& r) { } } -void GrClip::setFromIterator(GrClipIterator* iter, const GrRect* bounds) { +void GrClip::setFromIterator(GrClipIterator* iter, GrScalar tx, GrScalar ty, + const GrRect* bounds) { fList.reset(); int rectCount = 0; @@ -104,6 +106,9 @@ void GrClip::setFromIterator(GrClipIterator* iter, const GrRect* bounds) { switch (e.fType) { case kRect_ClipType: iter->getRect(&e.fRect); + if (tx || ty) { + e.fRect.offset(tx, ty); + } ++rectCount; if (isectRectValid) { if (1 == rectCount || kIntersect_SetOp == e.fOp) { @@ -122,6 +127,9 @@ void GrClip::setFromIterator(GrClipIterator* iter, const GrRect* bounds) { break; case kPath_ClipType: e.fPath.resetFromIter(iter->getPathIter()); + if (tx || ty) { + e.fPath.offset(tx, ty); + } e.fPathFill = iter->getPathFill(); isectRectValid = false; break; |