bool SkCanvas::readPixels(const SkIRect& srcRect, SkBitmap* bitmap) {
SkDevice* device = this->getDevice();
+ if (!device) {
+ return false;
+ }
SkIRect bounds;
bounds.set(0, 0, device->width(), device->height());
}
} else {
const SkDevice* device = canvas->getDevice();
+ if (!device) {
+ return currClip->setEmpty();
+ }
+
base.setRect(0, 0, device->width(), device->height());
if (SkRegion::kReplace_Op == op) {
void SkCanvas::validateClip() const {
// construct clipRgn from the clipstack
const SkDevice* device = this->getDevice();
+ if (!device) {
+ SkASSERT(this->getTotalClip().isEmpty());
+ return;
+ }
+
SkIRect ir;
ir.set(0, 0, device->width(), device->height());
SkRasterClip tmpClip(ir);