Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@14862 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
ba7aedd6ea
commit
7693dbf46e
@ -86,7 +86,7 @@ static SkShader* Make2Radial(const SkPoint pts[2], const GradData& data, SkShade
|
||||
}
|
||||
|
||||
typedef SkShader* (*GradMaker)(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm);
|
||||
|
||||
|
||||
static const GradMaker gGradMakers[] = {
|
||||
MakeLinear, MakeRadial, MakeSweep, Make2Radial
|
||||
};
|
||||
|
@ -143,7 +143,7 @@ public:
|
||||
flags, localMatrix);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Returns a shader that generates a conical gradient given two circles, or
|
||||
* returns NULL if the inputs are invalid. The gradient interprets the
|
||||
@ -174,7 +174,7 @@ public:
|
||||
flags, localMatrix);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/** Returns a shader that generates a sweep gradient given a center.
|
||||
<p />
|
||||
CreateSweep returns a shader with a reference count of 1.
|
||||
@ -207,7 +207,7 @@ public:
|
||||
return CreateSweep(cx, cy, colors, pos, count, flags, localMatrix);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
|
||||
};
|
||||
|
||||
|
@ -283,5 +283,3 @@ void SkValidatingReadBuffer::skipFlattenable() {
|
||||
uint32_t sizeRecorded = this->readUInt();
|
||||
this->skip(sizeRecorded);
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
|
||||
}
|
||||
|
||||
unsigned char* buf = (unsigned char*)autoMal.get();
|
||||
|
||||
|
||||
// Make sure original PKM header is there...
|
||||
SkASSERT(etc1_pkm_is_valid(buf));
|
||||
|
||||
@ -49,27 +49,27 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
|
||||
if (!this->chooseFromOneChoice(SkBitmap::kARGB_8888_Config, width, height)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bm->setConfig(SkBitmap::kARGB_8888_Config, width, height, 0, kOpaque_SkAlphaType);
|
||||
if (SkImageDecoder::kDecodeBounds_Mode == mode) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (!this->allocPixelRef(bm, NULL)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Lock the pixels, since we're about to write to them...
|
||||
SkAutoLockPixels alp(*bm);
|
||||
|
||||
|
||||
// Advance buffer past the header
|
||||
buf += ETC_PKM_HEADER_SIZE;
|
||||
|
||||
|
||||
// ETC1 Data is encoded as RGB pixels, so we should extract it as such
|
||||
int nPixels = width * height;
|
||||
SkAutoMalloc outRGBData(nPixels * 3);
|
||||
etc1_byte *outRGBDataPtr = reinterpret_cast<etc1_byte *>(outRGBData.get());
|
||||
|
||||
|
||||
// Decode ETC1
|
||||
if (etc1_decode_image(buf, outRGBDataPtr, width, height, 3, width*3)) {
|
||||
return false;
|
||||
@ -85,7 +85,7 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
|
||||
*dst++ = 0xFF; // Opaque alpha...
|
||||
src += 3;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user