aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapProcState_procs.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-06-04 14:12:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-04 14:12:25 -0700
commitad7ae6c821c530dd6cb54b0e8931ba8b10e8d87d (patch)
tree8ef2a833209c3e2c1c445232869c76a320ec1b4c /src/core/SkBitmapProcState_procs.h
parenta84f569f0dbf07da55d168bc56538078dd1d2c08 (diff)
switch bitmapshader internals over to pixmap
BUG=skia: NOTRY=True Review URL: https://codereview.chromium.org/1158273007
Diffstat (limited to 'src/core/SkBitmapProcState_procs.h')
-rw-r--r--src/core/SkBitmapProcState_procs.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/core/SkBitmapProcState_procs.h b/src/core/SkBitmapProcState_procs.h
index a9b87501b4..03e192719c 100644
--- a/src/core/SkBitmapProcState_procs.h
+++ b/src/core/SkBitmapProcState_procs.h
@@ -90,7 +90,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(S32_opaque_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE SkPMColor
-#define CHECKSTATE(state) SkASSERT(4 == state.fBitmap->bytesPerPixel()); \
+#define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel()); \
SkASSERT(state.fAlphaScale == 256)
#define RETURNDST(src) src
#define SRC_TO_FILTER(src) src
@@ -102,7 +102,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(S32_alpha_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE SkPMColor
-#define CHECKSTATE(state) SkASSERT(4 == state.fBitmap->bytesPerPixel()); \
+#define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel()); \
SkASSERT(state.fAlphaScale < 256)
#define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale
#define RETURNDST(src) SkAlphaMulQ(src, alphaScale)
@@ -121,7 +121,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(S16_opaque_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE uint16_t
-#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fBitmap->colorType()); \
+#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.colorType()); \
SkASSERT(state.fAlphaScale == 256)
#define RETURNDST(src) SkPixel16ToPixel32(src)
#define SRC_TO_FILTER(src) src
@@ -137,7 +137,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(S16_alpha_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE uint16_t
-#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fBitmap->colorType()); \
+#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.colorType()); \
SkASSERT(state.fAlphaScale < 256)
#define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale
#define RETURNDST(src) SkAlphaMulQ(SkPixel16ToPixel32(src), alphaScale)
@@ -152,9 +152,9 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(SI8_opaque_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE uint8_t
-#define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fBitmap->colorType()); \
+#define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.colorType()); \
SkASSERT(state.fAlphaScale == 256)
-#define PREAMBLE(state) const SkPMColor* SK_RESTRICT table = state.fBitmap->getColorTable()->readColors()
+#define PREAMBLE(state) const SkPMColor* SK_RESTRICT table = state.fPixmap.ctable()->readColors()
#define RETURNDST(src) table[src]
#define SRC_TO_FILTER(src) table[src]
#define POSTAMBLE(state)
@@ -166,10 +166,10 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(SI8_alpha_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE uint8_t
-#define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fBitmap->colorType()); \
+#define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.colorType()); \
SkASSERT(state.fAlphaScale < 256)
#define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale; \
- const SkPMColor* SK_RESTRICT table = state.fBitmap->getColorTable()->readColors()
+ const SkPMColor* SK_RESTRICT table = state.fPixmap.ctable()->readColors()
#define RETURNDST(src) SkAlphaMulQ(table[src], alphaScale)
#define SRC_TO_FILTER(src) table[src]
#define POSTAMBLE(state)
@@ -183,7 +183,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(S4444_opaque_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE SkPMColor16
-#define CHECKSTATE(state) SkASSERT(kARGB_4444_SkColorType == state.fBitmap->colorType()); \
+#define CHECKSTATE(state) SkASSERT(kARGB_4444_SkColorType == state.fPixmap.colorType()); \
SkASSERT(state.fAlphaScale == 256)
#define RETURNDST(src) SkPixel4444ToPixel32(src)
#define SRC_TO_FILTER(src) src
@@ -199,7 +199,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(S4444_alpha_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE SkPMColor16
-#define CHECKSTATE(state) SkASSERT(kARGB_4444_SkColorType == state.fBitmap->colorType()); \
+#define CHECKSTATE(state) SkASSERT(kARGB_4444_SkColorType == state.fPixmap.colorType()); \
SkASSERT(state.fAlphaScale < 256)
#define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale
#define RETURNDST(src) SkAlphaMulQ(SkPixel4444ToPixel32(src), alphaScale)
@@ -218,7 +218,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(SA8_alpha_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE uint8_t
-#define CHECKSTATE(state) SkASSERT(kAlpha_8_SkColorType == state.fBitmap->colorType());
+#define CHECKSTATE(state) SkASSERT(kAlpha_8_SkColorType == state.fPixmap.colorType());
#define PREAMBLE(state) const SkPMColor pmColor = state.fPaintPMColor;
#define RETURNDST(src) SkAlphaMulQ(pmColor, SkAlpha255To256(src))
#define SRC_TO_FILTER(src) src
@@ -237,7 +237,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(SG8_alpha_D32 ## suffix)
#define DSTSIZE 32
#define SRCTYPE uint8_t
-#define CHECKSTATE(state) SkASSERT(kGray_8_SkColorType == state.fBitmap->colorType());
+#define CHECKSTATE(state) SkASSERT(kGray_8_SkColorType == state.fPixmap.colorType());
#define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale
#define RETURNDST(src) SkAlphaMulQ(SkPackARGB32(0xFF, src, src, src), alphaScale)
#define SRC_TO_FILTER(src) src
@@ -262,8 +262,8 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(S32_D16 ## suffix)
#define DSTSIZE 16
#define SRCTYPE SkPMColor
-#define CHECKSTATE(state) SkASSERT(4 == state.fBitmap->bytesPerPixel()); \
- SkASSERT(state.fBitmap->isOpaque())
+#define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel()); \
+ SkASSERT(state.fPixmap.isOpaque())
#define RETURNDST(src) SkPixel32ToPixel16(src)
#define SRC_TO_FILTER(src) src
#include "SkBitmapProcState_sample.h"
@@ -280,7 +280,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(S16_D16 ## suffix)
#define DSTSIZE 16
#define SRCTYPE uint16_t
-#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fBitmap->colorType())
+#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.colorType())
#define RETURNDST(src) src
#define SRC_TO_FILTER(src) src
#include "SkBitmapProcState_sample.h"
@@ -297,9 +297,9 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(SI8_D16 ## suffix)
#define DSTSIZE 16
#define SRCTYPE uint8_t
-#define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fBitmap->colorType()); \
- SkASSERT(state.fBitmap->isOpaque())
-#define PREAMBLE(state) const uint16_t* SK_RESTRICT table = state.fBitmap->getColorTable()->read16BitCache()
+#define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.colorType()); \
+ SkASSERT(state.fPixmap.isOpaque())
+#define PREAMBLE(state) const uint16_t* SK_RESTRICT table = state.fPixmap.ctable()->read16BitCache()
#define RETURNDST(src) table[src]
#define SRC_TO_FILTER(src) table[src]
#define POSTAMBLE(state)
@@ -325,7 +325,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(Clamp_S16_D16 ## suffix)
#define SRCTYPE uint16_t
#define DSTTYPE uint16_t
-#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fBitmap->colorType())
+#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.colorType())
#define SRC_TO_FILTER(src) src
#include "SkBitmapProcState_shaderproc.h"
@@ -338,7 +338,7 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(Repeat_S16_D16 ## suffix)
#define SRCTYPE uint16_t
#define DSTTYPE uint16_t
-#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fBitmap->colorType())
+#define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.colorType())
#define SRC_TO_FILTER(src) src
#include "SkBitmapProcState_shaderproc.h"
@@ -353,8 +353,8 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define MAKENAME(suffix) NAME_WRAP(Clamp_SI8_opaque_D32 ## suffix)
#define SRCTYPE uint8_t
#define DSTTYPE uint32_t
-#define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fBitmap->colorType())
-#define PREAMBLE(state) const SkPMColor* SK_RESTRICT table = state.fBitmap->getColorTable()->readColors()
+#define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.colorType())
+#define PREAMBLE(state) const SkPMColor* SK_RESTRICT table = state.fPixmap.ctable()->readColors()
#define SRC_TO_FILTER(src) table[src]
#define POSTAMBLE(state)
#include "SkBitmapProcState_shaderproc.h"