aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-15 18:45:19 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-15 18:45:19 +0000
commit31d1c64bd54dd2b216846a30da4cc2e96765ec5f (patch)
treeb78d021c3a5329d4c07c789178ce7a5568b13cd3
parent9a74d313452f30629e2615eb8cbfe902433582c0 (diff)
ws fixes
git-svn-id: http://skia.googlecode.com/svn/trunk@217 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/images/SkImageDecoder.h14
-rw-r--r--src/core/SkBlitter_RGB16.cpp16
-rw-r--r--src/core/SkCoreBlitters.h5
3 files changed, 15 insertions, 20 deletions
diff --git a/include/images/SkImageDecoder.h b/include/images/SkImageDecoder.h
index d293cec774..de63345922 100644
--- a/include/images/SkImageDecoder.h
+++ b/include/images/SkImageDecoder.h
@@ -160,13 +160,13 @@ public:
there is a conflict (e.g. the image has per-pixel alpha and the bitmap's
config does not support that), in which case the decoder will choose a
closest match configuration.
-
+
@param format On success, if format is non-null, it is set to the format
of the decoded file. On failure it is ignored.
*/
static bool DecodeFile(const char file[], SkBitmap* bitmap,
SkBitmap::Config prefConfig, Mode,
- Format* format);
+ Format* format = NULL);
static bool DecodeFile(const char file[], SkBitmap* bitmap) {
return DecodeFile(file, bitmap, SkBitmap::kNo_Config,
kDecodePixels_Mode, NULL);
@@ -180,13 +180,13 @@ public:
there is a conflict (e.g. the image has per-pixel alpha and the bitmap's
config does not support that), in which case the decoder will choose a
closest match configuration.
-
- @param format On success, if format is non-null, it is set to the format
+
+ @param format On success, if format is non-null, it is set to the format
of the decoded buffer. On failure it is ignored.
*/
static bool DecodeMemory(const void* buffer, size_t size, SkBitmap* bitmap,
SkBitmap::Config prefConfig, Mode,
- Format* format);
+ Format* format = NULL);
static bool DecodeMemory(const void* buffer, size_t size, SkBitmap* bitmap){
return DecodeMemory(buffer, size, bitmap, SkBitmap::kNo_Config,
kDecodePixels_Mode, NULL);
@@ -200,13 +200,13 @@ public:
format, unless there is a conflict (e.g. the image has per-pixel alpha
and the bitmap's config does not support that), in which case the
decoder will choose a closest match configuration.
-
+
@param format On success, if format is non-null, it is set to the format
of the decoded stream. On failure it is ignored.
*/
static bool DecodeStream(SkStream* stream, SkBitmap* bitmap,
SkBitmap::Config prefConfig, Mode,
- Format* format);
+ Format* format = NULL);
static bool DecodeStream(SkStream* stream, SkBitmap* bitmap) {
return DecodeStream(stream, bitmap, SkBitmap::kNo_Config,
kDecodePixels_Mode, NULL);
diff --git a/src/core/SkBlitter_RGB16.cpp b/src/core/SkBlitter_RGB16.cpp
index 41f20c99e6..955f4c1913 100644
--- a/src/core/SkBlitter_RGB16.cpp
+++ b/src/core/SkBlitter_RGB16.cpp
@@ -166,7 +166,7 @@ void SkRGB16_Opaque_Blitter::blitH(int x, int y, int width) SK_RESTRICT {
SkASSERT(x + width <= fDevice.width());
uint16_t* SK_RESTRICT device = fDevice.getAddr16(x, y);
uint16_t srcColor = fColor16;
-
+
SkASSERT(fRawColor16 == srcColor);
if (fDoDither) {
uint16_t ditherColor = fRawDither16;
@@ -189,9 +189,7 @@ void SkRGB16_Opaque_Blitter::blitAntiH(int x, int y,
const int16_t* SK_RESTRICT runs) SK_RESTRICT {
uint16_t* SK_RESTRICT device = fDevice.getAddr16(x, y);
uint16_t srcColor = fRawColor16;
- unsigned scale = fScale;
int ditherInt = Bool2Int(fDoDither);
-
uint16_t ditherColor = fRawDither16;
// if we have no dithering, this will always fail
if ((x ^ y) & ditherInt) {
@@ -204,7 +202,7 @@ void SkRGB16_Opaque_Blitter::blitAntiH(int x, int y,
return;
}
runs += count;
-
+
unsigned aa = antialias[0];
antialias += count;
if (aa) {
@@ -229,7 +227,7 @@ void SkRGB16_Opaque_Blitter::blitAntiH(int x, int y,
}
}
device += count;
-
+
DONE:
// if we have no dithering, this will always fail
if (count & ditherInt) {
@@ -267,7 +265,7 @@ void SkRGB16_Opaque_Blitter::blitMask(const SkMask& SK_RESTRICT mask,
SkRGB16_BlitBW(fDevice, mask, clip, fColor16);
return;
}
-
+
uint16_t* SK_RESTRICT device = fDevice.getAddr16(clip.fLeft, clip.fTop);
const uint8_t* SK_RESTRICT alpha = mask.getAddr(clip.fLeft, clip.fTop);
int width = clip.width();
@@ -275,7 +273,7 @@ void SkRGB16_Opaque_Blitter::blitMask(const SkMask& SK_RESTRICT mask,
unsigned deviceRB = fDevice.rowBytes() - (width << 1);
unsigned maskRB = mask.fRowBytes - width;
uint32_t color32 = SkExpand_rgb_16(fRawColor16);
-
+
do {
int w = width;
do {
@@ -293,7 +291,7 @@ void SkRGB16_Opaque_Blitter::blitRect(int x, int y, int width, int height) {
uint16_t* SK_RESTRICT device = fDevice.getAddr16(x, y);
unsigned deviceRB = fDevice.rowBytes();
uint16_t color16 = fColor16;
-
+
if (fDoDither) {
uint16_t ditherColor = fRawDither16;
if ((x ^ y) & 1) {
@@ -363,7 +361,6 @@ void SkRGB16_Blitter::blitAntiH(int x, int y,
uint16_t* SK_RESTRICT device = fDevice.getAddr16(x, y);
uint16_t srcColor = fRawColor16;
unsigned scale = fScale;
- int ditherInt = Bool2Int(fDoDither);
// TODO: respect fDoDither
for (;;) {
@@ -478,7 +475,6 @@ void SkRGB16_Blitter::blitRect(int x, int y, int width, int height) {
SkASSERT(x + width <= fDevice.width() && y + height <= fDevice.height());
uint16_t* SK_RESTRICT device = fDevice.getAddr16(x, y);
unsigned deviceRB = fDevice.rowBytes();
- uint16_t color16 = fColor16;
SkPMColor src32 = fSrcColor32;
while (--height >= 0) {
diff --git a/src/core/SkCoreBlitters.h b/src/core/SkCoreBlitters.h
index c25752ec2f..d45467fb98 100644
--- a/src/core/SkCoreBlitters.h
+++ b/src/core/SkCoreBlitters.h
@@ -183,15 +183,14 @@ public:
virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]);
virtual void blitRect(int x, int y, int width, int height);
virtual void blitMask(const SkMask&, const SkIRect&);
-
-private:
+
+private:
typedef SkRGB16_Blitter INHERITED;
};
class SkRGB16_Black_Blitter : public SkRGB16_Blitter {
public:
SkRGB16_Black_Blitter(const SkBitmap& device, const SkPaint& paint);
-
virtual void blitMask(const SkMask&, const SkIRect&);
virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]);