зеркало из https://github.com/mozilla/moz-skia.git
ws fixes
git-svn-id: http://skia.googlecode.com/svn/trunk@217 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
9a74d31345
Коммит
31d1c64bd5
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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[]);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче