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

Unified Diff: src/core/SkDeviceLooper.cpp

Issue 1164373003: Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 840a0504364e2b76fd1850016291d233b7e4c3fb..a8350cc0272c9f2a278ab3ff50fea96ebeca2f50 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() {}
+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::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 @@
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 @@
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;
« 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