bool SkDeviceLooper::computeCurrBitmapAndClip() {
SkASSERT(kComplex_State == fState);
-
+
SkIRect r = SkIRect::MakeXYWH(fCurrOffset.x(), fCurrOffset.y(),
fDelta, fDelta);
if (!fBaseBitmap.extractSubset(&fSubsetBitmap, r)) {
return false;
}
fSubsetBitmap.lockPixels();
-
+
fBaseRC.translate(-r.left(), -r.top(), &fSubsetRC);
(void)fSubsetRC.op(SkIRect::MakeWH(fDelta, fDelta), SkRegion::kIntersect_Op);
-
+
fCurrBitmap = &fSubsetBitmap;
fCurrRC = &fSubsetRC;
return true;
// in theory, we should not get called here, since we must have
// previously returned false, but we check anyway.
break;
-
+
case kSimple_State:
// first time for simple
if (NULL == fCurrBitmap) {
case kComplex_State:
// need to propogate fCurrOffset through clippedbounds
// left to right, until we wrap around and move down
-
+
if (fCurrOffset.x() + fDelta < fClippedBounds.right()) {
fCurrOffset.fX += fDelta;
return this->computeCurrBitmapAndClip();
}
break;
}
-
+
fState = kDone_State;
return false;
}
/**
* Call next to setup the looper to return a valid coordinate chunk.
- * Each time this returns true, it is safe to call mapRect() and
+ * Each time this returns true, it is safe to call mapRect() and
* mapMatrix(), to convert from "global" coordinate values to ones that
* are local to this chunk.
*
bool fitsInDelta(const SkIRect& r) const {
return r.right() < fDelta && r.bottom() < fDelta;
}
-
+
bool computeCurrBitmapAndClip();
};