SkTBlitterAllocator allocator;
SkBlitter* blitter = NULL;
if (kBlitter_CompressionMode == fCompressionMode) {
- SkASSERT(NULL != fCompressedBuffer.get());
+ SkASSERT(fCompressedBuffer.get());
blitter = SkTextureCompressor::CreateBlitterForFormat(
fBM.width(), fBM.height(), fCompressedBuffer.get(), &allocator, fCompressedFormat);
}
bool GrSWMaskHelper::init(const SkIRect& resultBounds,
const SkMatrix* matrix,
bool allowCompression) {
- if (NULL != matrix) {
+ if (matrix) {
fMatrix = *matrix;
} else {
fMatrix.setIdentity();
// allocate the pixels for a bitmap
const SkImageInfo bmImageInfo = SkImageInfo::MakeA8(cmpWidth, cmpHeight);
if (kBlitter_CompressionMode != fCompressionMode) {
- if (!fBM.allocPixels(bmImageInfo)) {
+ if (!fBM.tryAllocPixels(bmImageInfo)) {
return false;
}
}
texture->set(fContext, desc);
- return NULL != texture->texture();
+ return SkToBool(texture->texture());
}
void GrSWMaskHelper::sendTextureData(GrTexture *texture, const GrTextureDesc& desc,
SkASSERT(fmt_to_config(fCompressedFormat) == desc.fConfig);
SkAutoDataUnref cmpData(SkTextureCompressor::CompressBitmapToFormat(fBM, fCompressedFormat));
- SkASSERT(NULL != cmpData);
+ SkASSERT(cmpData);
this->sendTextureData(texture, desc, cmpData->data(), 0);
}
break;
case kBlitter_CompressionMode:
- SkASSERT(NULL != fCompressedBuffer.get());
+ SkASSERT(fCompressedBuffer.get());
this->sendTextureData(texture, desc, fCompressedBuffer.get(), 0);
break;
}
maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop));
maskMatrix.preConcat(drawState->getViewMatrix());
- drawState->addCoverageEffect(
+ drawState->addCoverageProcessor(
GrSimpleTextureEffect::Create(texture,
maskMatrix,
GrTextureParams::kNone_FilterMode,