Sanitizing source files in Housekeeper-Nightly

git-svn-id: http://skia.googlecode.com/svn/trunk@10175 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
skia.committer@gmail.com 2013-07-19 07:00:57 +00:00
parent 7ac13b7198
commit a79919883e
6 changed files with 25 additions and 26 deletions

View File

@ -114,7 +114,7 @@ public:
kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter
kVerticalText_Flag = 0x1000,
kGenA8FromLCD_Flag = 0x2000, // hack for GDI -- do not use if you can help it
// DEPRECATED -- use setFilterLevel instead
kHighQualityFilterBitmap_Flag = 0x4000, // temporary flag
// DEPRECATED -- use setFilterLevel instead

View File

@ -16,13 +16,13 @@ static void downsampleby2_proc32(SkBitmap* dst, int x, int y,
const SkPMColor* p = src.getAddr32(x, y);
const SkPMColor* baseP = p;
SkPMColor c, ag, rb;
c = *p; ag = (c >> 8) & 0xFF00FF; rb = c & 0xFF00FF;
if (x < src.width() - 1) {
p += 1;
}
c = *p; ag += (c >> 8) & 0xFF00FF; rb += c & 0xFF00FF;
p = baseP;
if (y < src.height() - 1) {
p += src.rowBytes() >> 2;
@ -32,7 +32,7 @@ static void downsampleby2_proc32(SkBitmap* dst, int x, int y,
p += 1;
}
c = *p; ag += (c >> 8) & 0xFF00FF; rb += c & 0xFF00FF;
*dst->getAddr32(x >> 1, y >> 1) =
((rb >> 2) & 0xFF00FF) | ((ag << 6) & 0xFF00FF00);
}
@ -54,13 +54,13 @@ static void downsampleby2_proc16(SkBitmap* dst, int x, int y,
const uint16_t* p = src.getAddr16(x, y);
const uint16_t* baseP = p;
SkPMColor c;
c = expand16(*p);
if (x < src.width() - 1) {
p += 1;
}
c += expand16(*p);
p = baseP;
if (y < src.height() - 1) {
p += src.rowBytes() >> 1;
@ -70,7 +70,7 @@ static void downsampleby2_proc16(SkBitmap* dst, int x, int y,
p += 1;
}
c += expand16(*p);
*dst->getAddr16(x >> 1, y >> 1) = (uint16_t)pack16(c >> 2);
}
@ -89,13 +89,13 @@ static void downsampleby2_proc4444(SkBitmap* dst, int x, int y,
const uint16_t* p = src.getAddr16(x, y);
const uint16_t* baseP = p;
uint32_t c;
c = expand4444(*p);
if (x < src.width() - 1) {
p += 1;
}
c += expand4444(*p);
p = baseP;
if (y < src.height() - 1) {
p += src.rowBytes() >> 1;
@ -105,7 +105,7 @@ static void downsampleby2_proc4444(SkBitmap* dst, int x, int y,
p += 1;
}
c += expand4444(*p);
*dst->getAddr16(x >> 1, y >> 1) = (uint16_t)collaps4444(c >> 2);
}
@ -145,7 +145,7 @@ SkMipMap* SkMipMap::Build(const SkBitmap& src) {
default:
return NULL; // don't build mipmaps for these configs
}
SkAutoLockPixels alp(src);
if (!src.readyToDraw()) {
return NULL;
@ -170,7 +170,7 @@ SkMipMap* SkMipMap::Build(const SkBitmap& src) {
if (0 == countLevels) {
return NULL;
}
Level* levels = SkMipMap::AllocLevels(countLevels, size);
if (NULL == levels) {
return NULL;
@ -182,17 +182,17 @@ SkMipMap* SkMipMap::Build(const SkBitmap& src) {
int height = src.height();
uint32_t rowBytes;
SkBitmap srcBM(src);
for (int i = 0; i < countLevels; ++i) {
width >>= 1;
height >>= 1;
rowBytes = SkToU32(SkBitmap::ComputeRowBytes(config, width));
levels[i].fPixels = addr;
levels[i].fWidth = width;
levels[i].fHeight = height;
levels[i].fRowBytes = rowBytes;
SkBitmap dstBM;
dstBM.setConfig(config, width, height, rowBytes);
dstBM.setPixels(addr);
@ -204,7 +204,7 @@ SkMipMap* SkMipMap::Build(const SkBitmap& src) {
}
}
srcBM.unlockPixels();
srcBM = dstBM;
addr += height * rowBytes;
}
@ -243,4 +243,3 @@ bool SkMipMap::extractLevel(SkScalar scale, Level* levelPtr) const {
}
return true;
}

View File

@ -22,7 +22,7 @@ public:
uint32_t fRowBytes;
uint32_t fWidth, fHeight;
};
bool extractLevel(SkScalar scale, Level*) const;
private:

View File

@ -289,7 +289,7 @@ void GrResourceCache::purgeAsNeeded(int extraCount, size_t extraBytes) {
fPurging = true;
this->internalPurge(extraCount, extraBytes);
if (((fEntryCount+extraCount) > fMaxCount ||
if (((fEntryCount+extraCount) > fMaxCount ||
(fEntryBytes+extraBytes) > fMaxBytes) &&
NULL != fOverbudgetCB) {
// Despite the purge we're still over budget. See if Ganesh can
@ -324,7 +324,7 @@ void GrResourceCache::internalPurge(int extraCount, size_t extraBytes) {
while (NULL != entry) {
GrAutoResourceCacheValidate atcv(this);
if ((fEntryCount+extraCount) <= fMaxCount &&
if ((fEntryCount+extraCount) <= fMaxCount &&
(fEntryBytes+extraBytes) <= fMaxBytes) {
withinBudget = true;
break;

View File

@ -109,9 +109,9 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenBuffers(GrGLsizei n, GrGLuint* ids) {
}
}
GrGLvoid GR_GL_FUNCTION_TYPE nullGLBufferData(GrGLenum target,
GrGLsizeiptr size,
const GrGLvoid* data,
GrGLvoid GR_GL_FUNCTION_TYPE nullGLBufferData(GrGLenum target,
GrGLsizeiptr size,
const GrGLvoid* data,
GrGLenum usage) {
GrGLuint id = 0;

View File

@ -27,10 +27,10 @@ static void TestMipMap(skiatest::Reporter* reporter) {
for (int i = 0; i < 500; ++i) {
make_bitmap(&bm, rand);
SkAutoTUnref<SkMipMap> mm(SkMipMap::Build(bm));
REPORTER_ASSERT(reporter, !mm->extractLevel(SK_Scalar1, NULL));
REPORTER_ASSERT(reporter, !mm->extractLevel(SK_Scalar1 * 2, NULL));
SkMipMap::Level prevLevel = { 0, 0, 0, 0 };
SkScalar scale = SK_Scalar1;
@ -43,7 +43,7 @@ static void TestMipMap(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, level.fWidth > 0);
REPORTER_ASSERT(reporter, level.fHeight > 0);
REPORTER_ASSERT(reporter, level.fRowBytes >= level.fWidth * 4);
if (prevLevel.fPixels) {
REPORTER_ASSERT(reporter, level.fWidth <= prevLevel.fWidth);
REPORTER_ASSERT(reporter, level.fHeight <= prevLevel.fHeight);