Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@12901 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
7b6d4d6783
commit
98272d9142
@ -77,14 +77,14 @@ public:
|
||||
void* fPixels;
|
||||
SkColorTable* fColorTable;
|
||||
size_t fRowBytes;
|
||||
|
||||
|
||||
void zero() { sk_bzero(this, sizeof(*this)); }
|
||||
|
||||
bool isZero() const {
|
||||
return NULL == fPixels && NULL == fColorTable && 0 == fRowBytes;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if the lockcount > 0
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkDeviceProperties&
|
||||
void SkBitmapDevice::init(SkBitmap::Config config, int width, int height, bool isOpaque) {
|
||||
fBitmap.setConfig(config, width, height, 0, isOpaque ?
|
||||
kOpaque_SkAlphaType : kPremul_SkAlphaType);
|
||||
|
||||
|
||||
if (SkBitmap::kNo_Config != config) {
|
||||
if (!fBitmap.allocPixels()) {
|
||||
// indicate failure by zeroing our bitmap
|
||||
|
@ -174,7 +174,7 @@ SkMallocPixelRef::SkMallocPixelRef(const SkImageInfo& info, void* storage,
|
||||
fCTable = ctable;
|
||||
fRB = rowBytes;
|
||||
SkSafeRef(ctable);
|
||||
|
||||
|
||||
this->setPreLocked(fStorage, fRB, fCTable);
|
||||
}
|
||||
|
||||
|
@ -167,10 +167,10 @@ void SkPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const {
|
||||
|
||||
bool SkPixelRef::lockPixels(LockRec* rec) {
|
||||
SkASSERT(!fPreLocked || SKPIXELREF_PRELOCKED_LOCKCOUNT == fLockCount);
|
||||
|
||||
|
||||
if (!fPreLocked) {
|
||||
SkAutoMutexAcquire ac(*fMutex);
|
||||
|
||||
|
||||
if (1 == ++fLockCount) {
|
||||
SkASSERT(fRec.isZero());
|
||||
|
||||
|
@ -44,7 +44,7 @@ bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) {
|
||||
if (fErrorInDecoding) {
|
||||
return false; // don't try again.
|
||||
}
|
||||
|
||||
|
||||
const SkImageInfo& info = this->info();
|
||||
SkBitmap bitmap;
|
||||
SkASSERT(NULL == fScaledCacheId);
|
||||
@ -75,7 +75,7 @@ bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) {
|
||||
SkAutoLockPixels autoLockPixels(bitmap);
|
||||
void* pixels = bitmap.getPixels();
|
||||
SkASSERT(pixels != NULL);
|
||||
|
||||
|
||||
// At this point, the autoLockPixels will unlockPixels()
|
||||
// to remove bitmap's lock on the pixels. We will then
|
||||
// destroy bitmap. The *only* guarantee that this pointer
|
||||
|
@ -47,7 +47,7 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
|
||||
SkDELETE(fDiscardableMemory);
|
||||
fDiscardableMemory = NULL;
|
||||
}
|
||||
|
||||
|
||||
const size_t size = this->info().getSafeSize(fRowBytes);
|
||||
|
||||
if (fDMFactory != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user