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

Unified Diff: src/core/SkBitmapProcState_procs.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_matrix_template.h ('k') | src/core/SkBitmapProcState_sample.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState_procs.h
diff --git a/src/core/SkBitmapProcState_procs.h b/src/core/SkBitmapProcState_procs.h
index a9b87501b42e12876d95b62bfb18213eb9a03ebe..03e192719c577e5627df4b409ca301fb93f13296 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"
« no previous file with comments | « src/core/SkBitmapProcState_matrix_template.h ('k') | src/core/SkBitmapProcState_sample.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698