diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-01-13 13:26:44 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-01-13 13:26:44 +0000 |
commit | 0becfc5b7608ba67a4c98721cd61939e89ac5653 (patch) | |
tree | 8981e70043e79fa5dcfedb0833e36f4adcb4645f /src/core/SkBitmapProcState_matrix.h | |
parent | 2e86178f2bbfc866c627eb1fee926bd7969144f7 (diff) |
add optimization for width==1 bitmaps in shader procs
odd warning fixes and cleanup
git-svn-id: http://skia.googlecode.com/svn/trunk@63 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkBitmapProcState_matrix.h')
-rw-r--r-- | src/core/SkBitmapProcState_matrix.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/SkBitmapProcState_matrix.h b/src/core/SkBitmapProcState_matrix.h index f54f8b10fc..049d6d4d98 100644 --- a/src/core/SkBitmapProcState_matrix.h +++ b/src/core/SkBitmapProcState_matrix.h @@ -26,7 +26,6 @@ static void SCALE_NOFILTER_NAME(const SkBitmapProcState& s, // we store y, x, x, x, x, x const unsigned maxX = s.fBitmap->width() - 1; - const SkFixed dx = s.fInvSx; SkFixed fx; { SkPoint pt; @@ -37,6 +36,14 @@ static void SCALE_NOFILTER_NAME(const SkBitmapProcState& s, *xy++ = TILEY_PROCF(fx, maxY); fx = SkScalarToFixed(pt.fX); } + + if (0 == maxX) { + // all of the following X values must be 0 + memset(xy, 0, count * sizeof(uint16_t)); + return; + } + + const SkFixed dx = s.fInvSx; #ifdef CHECK_FOR_DECAL // test if we don't need to apply the tile proc |