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
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;
p += 1;
}
c = *p; ag += (c >> 8) & 0xFF00FF; rb += c & 0xFF00FF;
-
+
*dst->getAddr32(x >> 1, y >> 1) =
((rb >> 2) & 0xFF00FF) | ((ag << 6) & 0xFF00FF00);
}
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;
p += 1;
}
c += expand16(*p);
-
+
*dst->getAddr16(x >> 1, y >> 1) = (uint16_t)pack16(c >> 2);
}
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;
p += 1;
}
c += expand4444(*p);
-
+
*dst->getAddr16(x >> 1, y >> 1) = (uint16_t)collaps4444(c >> 2);
}
default:
return NULL; // don't build mipmaps for these configs
}
-
+
SkAutoLockPixels alp(src);
if (!src.readyToDraw()) {
return NULL;
if (0 == countLevels) {
return NULL;
}
-
+
Level* levels = SkMipMap::AllocLevels(countLevels, size);
if (NULL == levels) {
return NULL;
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);
}
}
srcBM.unlockPixels();
-
+
srcBM = dstBM;
addr += height * rowBytes;
}
}
return true;
}
-
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
while (NULL != entry) {
GrAutoResourceCacheValidate atcv(this);
- if ((fEntryCount+extraCount) <= fMaxCount &&
+ if ((fEntryCount+extraCount) <= fMaxCount &&
(fEntryBytes+extraBytes) <= fMaxBytes) {
withinBudget = true;
break;
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;
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);