Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Unified Diff: src/core/SkDeviceLooper.cpp

Issue 1148793007: change SkDraw and all Blitters to use pixmap instead of bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkDeviceLooper.h ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDeviceLooper.cpp
diff --git a/src/core/SkDeviceLooper.cpp b/src/core/SkDeviceLooper.cpp
index a8350cc0272c9f2a278ab3ff50fea96ebeca2f50..840a0504364e2b76fd1850016291d233b7e4c3fb 100644
--- a/src/core/SkDeviceLooper.cpp
+++ b/src/core/SkDeviceLooper.cpp
@@ -7,17 +7,16 @@
#include "SkDeviceLooper.h"
-SkDeviceLooper::SkDeviceLooper(const SkBitmap& base,
- const SkRasterClip& rc,
- const SkIRect& bounds, bool aa)
- : fBaseBitmap(base)
+SkDeviceLooper::SkDeviceLooper(const SkPixmap& base, const SkRasterClip& rc, const SkIRect& bounds,
+ bool aa)
+ : fBaseDst(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.
- fCurrBitmap = NULL;
+ fCurrDst = NULL;
fCurrRC = NULL;
if (!rc.isEmpty()) {
@@ -38,12 +37,11 @@ SkDeviceLooper::SkDeviceLooper(const SkBitmap& base,
}
}
-SkDeviceLooper::~SkDeviceLooper() {
-}
+SkDeviceLooper::~SkDeviceLooper() {}
void SkDeviceLooper::mapRect(SkRect* dst, const SkRect& src) const {
SkASSERT(kDone_State != fState);
- SkASSERT(fCurrBitmap);
+ SkASSERT(fCurrDst);
SkASSERT(fCurrRC);
*dst = src;
@@ -53,12 +51,11 @@ void SkDeviceLooper::mapRect(SkRect* dst, const SkRect& src) const {
void SkDeviceLooper::mapMatrix(SkMatrix* dst, const SkMatrix& src) const {
SkASSERT(kDone_State != fState);
- SkASSERT(fCurrBitmap);
+ SkASSERT(fCurrDst);
SkASSERT(fCurrRC);
*dst = src;
- dst->postTranslate(SkIntToScalar(-fCurrOffset.fX),
- SkIntToScalar(-fCurrOffset.fY));
+ dst->postTranslate(SkIntToScalar(-fCurrOffset.fX), SkIntToScalar(-fCurrOffset.fY));
}
bool SkDeviceLooper::computeCurrBitmapAndClip() {
@@ -66,16 +63,14 @@ bool SkDeviceLooper::computeCurrBitmapAndClip() {
SkIRect r = SkIRect::MakeXYWH(fCurrOffset.x(), fCurrOffset.y(),
fDelta, fDelta);
- if (!fBaseBitmap.extractSubset(&fSubsetBitmap, r)) {
+ if (!fBaseDst.extractSubset(&fSubsetDst, 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);
}
- fCurrBitmap = &fSubsetBitmap;
+ fCurrDst = &fSubsetDst;
fCurrRC = &fSubsetRC;
return !fCurrRC->isEmpty();
}
@@ -107,8 +102,8 @@ bool SkDeviceLooper::next() {
case kSimple_State:
// first time for simple
- if (NULL == fCurrBitmap) {
- fCurrBitmap = &fBaseBitmap;
+ if (NULL == fCurrDst) {
+ fCurrDst = &fBaseDst;
fCurrRC = &fBaseRC;
fCurrOffset.set(0, 0);
return true;
« no previous file with comments | « src/core/SkDeviceLooper.h ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698