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

Unified Diff: src/core/SkBitmapProcState_sample.h

Issue 1158273007: switch bitmapshader internals over to pixmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix neon/mips to use pixmpas 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/SkBitmapProcState_procs.h ('k') | src/core/SkBitmapProcState_shaderproc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState_sample.h
diff --git a/src/core/SkBitmapProcState_sample.h b/src/core/SkBitmapProcState_sample.h
index 70305163cbe5d08bfec2dd5462d0c3ca0efda3bb..5322a3605c3d3eddc75446b7c2bae9ea1ccbc9ca 100644
--- a/src/core/SkBitmapProcState_sample.h
+++ b/src/core/SkBitmapProcState_sample.h
@@ -48,29 +48,29 @@ void MAKENAME(_nofilter_DXDY)(const SkBitmapProcState& s,
#ifdef PREAMBLE
PREAMBLE(s);
#endif
- const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels();
- size_t rb = s.fBitmap->rowBytes();
+ const char* SK_RESTRICT srcAddr = (const char*)s.fPixmap.addr();
+ size_t rb = s.fPixmap.rowBytes();
uint32_t XY;
SRCTYPE src;
for (int i = (count >> 1); i > 0; --i) {
XY = *xy++;
- SkASSERT((XY >> 16) < (unsigned)s.fBitmap->height() &&
- (XY & 0xFFFF) < (unsigned)s.fBitmap->width());
+ SkASSERT((XY >> 16) < (unsigned)s.fPixmap.height() &&
+ (XY & 0xFFFF) < (unsigned)s.fPixmap.width());
src = ((const SRCTYPE*)(srcAddr + (XY >> 16) * rb))[XY & 0xFFFF];
*colors++ = RETURNDST(src);
XY = *xy++;
- SkASSERT((XY >> 16) < (unsigned)s.fBitmap->height() &&
- (XY & 0xFFFF) < (unsigned)s.fBitmap->width());
+ SkASSERT((XY >> 16) < (unsigned)s.fPixmap.height() &&
+ (XY & 0xFFFF) < (unsigned)s.fPixmap.width());
src = ((const SRCTYPE*)(srcAddr + (XY >> 16) * rb))[XY & 0xFFFF];
*colors++ = RETURNDST(src);
}
if (count & 1) {
XY = *xy++;
- SkASSERT((XY >> 16) < (unsigned)s.fBitmap->height() &&
- (XY & 0xFFFF) < (unsigned)s.fBitmap->width());
+ SkASSERT((XY >> 16) < (unsigned)s.fPixmap.height() &&
+ (XY & 0xFFFF) < (unsigned)s.fPixmap.width());
src = ((const SRCTYPE*)(srcAddr + (XY >> 16) * rb))[XY & 0xFFFF];
*colors++ = RETURNDST(src);
}
@@ -91,18 +91,18 @@ void MAKENAME(_nofilter_DX)(const SkBitmapProcState& s,
#ifdef PREAMBLE
PREAMBLE(s);
#endif
- const SRCTYPE* SK_RESTRICT srcAddr = (const SRCTYPE*)s.fBitmap->getPixels();
+ const SRCTYPE* SK_RESTRICT srcAddr = (const SRCTYPE*)s.fPixmap.addr();
// buffer is y32, x16, x16, x16, x16, x16
// bump srcAddr to the proper row, since we're told Y never changes
- SkASSERT((unsigned)xy[0] < (unsigned)s.fBitmap->height());
+ SkASSERT((unsigned)xy[0] < (unsigned)s.fPixmap.height());
srcAddr = (const SRCTYPE*)((const char*)srcAddr +
- xy[0] * s.fBitmap->rowBytes());
+ xy[0] * s.fPixmap.rowBytes());
xy += 1;
SRCTYPE src;
- if (1 == s.fBitmap->width()) {
+ if (1 == s.fPixmap.width()) {
src = srcAddr[0];
DSTTYPE dstValue = RETURNDST(src);
BITMAPPROC_MEMSET(colors, dstValue, count);
@@ -123,7 +123,7 @@ void MAKENAME(_nofilter_DX)(const SkBitmapProcState& s,
}
const uint16_t* SK_RESTRICT xx = (const uint16_t*)(xy);
for (i = (count & 3); i > 0; --i) {
- SkASSERT(*xx < (unsigned)s.fBitmap->width());
+ SkASSERT(*xx < (unsigned)s.fPixmap.width());
src = srcAddr[*xx++]; *colors++ = RETURNDST(src);
}
}
@@ -145,8 +145,8 @@ void MAKENAME(_filter_DX)(const SkBitmapProcState& s,
#ifdef PREAMBLE
PREAMBLE(s);
#endif
- const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels();
- size_t rb = s.fBitmap->rowBytes();
+ const char* SK_RESTRICT srcAddr = (const char*)s.fPixmap.addr();
+ size_t rb = s.fPixmap.rowBytes();
unsigned subY;
const SRCTYPE* SK_RESTRICT row0;
const SRCTYPE* SK_RESTRICT row1;
@@ -191,8 +191,8 @@ void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s,
#ifdef PREAMBLE
PREAMBLE(s);
#endif
- const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels();
- size_t rb = s.fBitmap->rowBytes();
+ const char* SK_RESTRICT srcAddr = (const char*)s.fPixmap.addr();
+ size_t rb = s.fPixmap.rowBytes();
do {
uint32_t data = *xy++;
« no previous file with comments | « src/core/SkBitmapProcState_procs.h ('k') | src/core/SkBitmapProcState_shaderproc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698