diff options
author | 2015-06-08 19:58:07 -0700 | |
---|---|---|
committer | 2015-06-08 19:58:07 -0700 | |
commit | b3f0ec9f9967da2f80f0d842cb7fd53617b48de3 (patch) | |
tree | f00f2095e30e48180a2a3a073be5bf1a1fe3f4c2 /src/core/SkDeviceLooper.cpp | |
parent | 86ae0a9e465f157eaa263ef7515e10619946ff83 (diff) |
Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (patchset #6 id:100001 of https://codereview.chromium.org/1148793007/)
Reason for revert:
speculative revert to try to unblock DEPS roll
Original issue's description:
> change SkDraw and all Blitters to use pixmap instead of bitmap
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c31af44336f5eb4a50e83e76e51962d46c3ed458
TBR=scroggo@google.com,jvanverth@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1164373003
Diffstat (limited to 'src/core/SkDeviceLooper.cpp')
-rw-r--r-- | src/core/SkDeviceLooper.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/core/SkDeviceLooper.cpp b/src/core/SkDeviceLooper.cpp index 840a050436..a8350cc027 100644 --- a/src/core/SkDeviceLooper.cpp +++ b/src/core/SkDeviceLooper.cpp @@ -7,16 +7,17 @@ #include "SkDeviceLooper.h" -SkDeviceLooper::SkDeviceLooper(const SkPixmap& base, const SkRasterClip& rc, const SkIRect& bounds, - bool aa) - : fBaseDst(base) +SkDeviceLooper::SkDeviceLooper(const SkBitmap& base, + const SkRasterClip& rc, + const SkIRect& bounds, bool aa) + : fBaseBitmap(base) , fBaseRC(rc) , fSubsetRC(rc.isForceConservativeRects()) , fDelta(aa ? kAA_Delta : kBW_Delta) { // sentinels that next() has not yet been called, and so our mapper functions // should not be called either. - fCurrDst = NULL; + fCurrBitmap = NULL; fCurrRC = NULL; if (!rc.isEmpty()) { @@ -37,11 +38,12 @@ SkDeviceLooper::SkDeviceLooper(const SkPixmap& base, const SkRasterClip& rc, con } } -SkDeviceLooper::~SkDeviceLooper() {} +SkDeviceLooper::~SkDeviceLooper() { +} void SkDeviceLooper::mapRect(SkRect* dst, const SkRect& src) const { SkASSERT(kDone_State != fState); - SkASSERT(fCurrDst); + SkASSERT(fCurrBitmap); SkASSERT(fCurrRC); *dst = src; @@ -51,11 +53,12 @@ void SkDeviceLooper::mapRect(SkRect* dst, const SkRect& src) const { void SkDeviceLooper::mapMatrix(SkMatrix* dst, const SkMatrix& src) const { SkASSERT(kDone_State != fState); - SkASSERT(fCurrDst); + SkASSERT(fCurrBitmap); SkASSERT(fCurrRC); *dst = src; - dst->postTranslate(SkIntToScalar(-fCurrOffset.fX), SkIntToScalar(-fCurrOffset.fY)); + dst->postTranslate(SkIntToScalar(-fCurrOffset.fX), + SkIntToScalar(-fCurrOffset.fY)); } bool SkDeviceLooper::computeCurrBitmapAndClip() { @@ -63,14 +66,16 @@ bool SkDeviceLooper::computeCurrBitmapAndClip() { SkIRect r = SkIRect::MakeXYWH(fCurrOffset.x(), fCurrOffset.y(), fDelta, fDelta); - if (!fBaseDst.extractSubset(&fSubsetDst, r)) { + if (!fBaseBitmap.extractSubset(&fSubsetBitmap, r)) { fSubsetRC.setEmpty(); } else { + fSubsetBitmap.lockPixels(); fBaseRC.translate(-r.left(), -r.top(), &fSubsetRC); - (void)fSubsetRC.op(SkIRect::MakeWH(fDelta, fDelta), SkRegion::kIntersect_Op); + (void)fSubsetRC.op(SkIRect::MakeWH(fDelta, fDelta), + SkRegion::kIntersect_Op); } - fCurrDst = &fSubsetDst; + fCurrBitmap = &fSubsetBitmap; fCurrRC = &fSubsetRC; return !fCurrRC->isEmpty(); } @@ -102,8 +107,8 @@ bool SkDeviceLooper::next() { case kSimple_State: // first time for simple - if (NULL == fCurrDst) { - fCurrDst = &fBaseDst; + if (NULL == fCurrBitmap) { + fCurrBitmap = &fBaseBitmap; fCurrRC = &fBaseRC; fCurrOffset.set(0, 0); return true; |