Canvas to handle null layer device.

http://codereview.appspot.com/4907045/

See also http://code.google.com/p/chromium/issues/detail?id=93000.



git-svn-id: http://skia.googlecode.com/svn/trunk@2130 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bungeman@google.com 2011-08-17 14:53:54 +00:00
parent 583a1e3850
commit e25c68402b
2 changed files with 6 additions and 2 deletions

View File

@ -711,6 +711,10 @@ int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint,
SkDevice* device = this->createLayerDevice(config, ir.width(), ir.height(), SkDevice* device = this->createLayerDevice(config, ir.width(), ir.height(),
isOpaque); isOpaque);
if (NULL == device) {
SkDebugf("Unable to create device for layer.");
return count;
}
device->setOrigin(ir.fLeft, ir.fTop); device->setOrigin(ir.fLeft, ir.fTop);
DeviceCM* layer = SkNEW_ARGS(DeviceCM, (device, ir.fLeft, ir.fTop, paint)); DeviceCM* layer = SkNEW_ARGS(DeviceCM, (device, ir.fLeft, ir.fTop, paint));

View File

@ -189,8 +189,8 @@ HRESULT STDMETHODCALLTYPE SkIStream::Seek(LARGE_INTEGER liDistanceToMove
break; break;
} }
if (NULL != lpNewFilePointer) { if (NULL != lpNewFilePointer) {
lpNewFilePointer->QuadPart = this->fLocation.QuadPart; lpNewFilePointer->QuadPart = this->fLocation.QuadPart;
} }
return hr; return hr;
} }