| Index: src/core/SkCanvas.cpp
|
| diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
|
| index 2fb5c951249d54c1905107e0a1c6161e1461281a..059e321654555e4ccdab3b44387a704bd0188939 100644
|
| --- a/src/core/SkCanvas.cpp
|
| +++ b/src/core/SkCanvas.cpp
|
| @@ -875,12 +875,6 @@ int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint,
|
| return this->internalSaveLayer(bounds, paint, flags, false, strategy);
|
| }
|
|
|
| -static SkBaseDevice* create_compatible_device(SkCanvas* canvas,
|
| - const SkImageInfo& info) {
|
| - SkBaseDevice* device = canvas->getDevice();
|
| - return device ? device->createCompatibleDevice(info) : NULL;
|
| -}
|
| -
|
| int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags,
|
| bool justForImageFilter, SaveLayerStrategy strategy) {
|
| #ifndef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
|
| @@ -924,7 +918,10 @@ int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, Save
|
|
|
| SkBaseDevice* device;
|
| if (paint && paint->getImageFilter()) {
|
| - device = create_compatible_device(this, info);
|
| + device = this->getDevice();
|
| + if (device) {
|
| + device = device->createCompatibleDevice(info);
|
| + }
|
| } else {
|
| device = this->createLayerDevice(info);
|
| }
|
| @@ -1402,13 +1399,8 @@ static void clip_path_helper(const SkCanvas* canvas, SkRasterClip* currClip,
|
| currClip->op(clip, op);
|
| }
|
| } else {
|
| - const SkBaseDevice* device = canvas->getDevice();
|
| - if (!device) {
|
| - currClip->setEmpty();
|
| - return;
|
| - }
|
| -
|
| - base.setRect(0, 0, device->width(), device->height());
|
| + const SkISize size = canvas->getBaseLayerSize();
|
| + base.setRect(0, 0, size.width(), size.height());
|
|
|
| if (SkRegion::kReplace_Op == op) {
|
| currClip->setPath(devPath, base, doAA);
|
|
|