diff --git a/gfx/skia/skia/src/core/SkBitmapDevice.h b/gfx/skia/skia/src/core/SkBitmapDevice.h index b102ebe62b83..7a09b9d827f6 100644 --- a/gfx/skia/skia/src/core/SkBitmapDevice.h +++ b/gfx/skia/skia/src/core/SkBitmapDevice.h @@ -119,6 +119,7 @@ protected: sk_sp makeSpecial(const SkBitmap&) override; sk_sp makeSpecial(const SkImage*) override; sk_sp snapSpecial() override; + void setImmutable() override { fBitmap.setImmutable(); } /////////////////////////////////////////////////////////////////////////// diff --git a/gfx/skia/skia/src/core/SkCanvas.cpp b/gfx/skia/skia/src/core/SkCanvas.cpp index 5738c83dd214..82457c6a2440 100644 --- a/gfx/skia/skia/src/core/SkCanvas.cpp +++ b/gfx/skia/skia/src/core/SkCanvas.cpp @@ -1195,6 +1195,7 @@ void SkCanvas::internalRestore() { if (layer) { if (fMCRec) { const SkIPoint& origin = layer->fDevice->getOrigin(); + layer->fDevice->setImmutable(); this->internalDrawDevice(layer->fDevice.get(), origin.x(), origin.y(), layer->fPaint.get(), layer->fClipImage.get(), layer->fClipMatrix); diff --git a/gfx/skia/skia/src/core/SkDevice.h b/gfx/skia/skia/src/core/SkDevice.h index 18fd5d13a710..885750b1c865 100644 --- a/gfx/skia/skia/src/core/SkDevice.h +++ b/gfx/skia/skia/src/core/SkDevice.h @@ -271,6 +271,7 @@ protected: virtual sk_sp makeSpecial(const SkBitmap&); virtual sk_sp makeSpecial(const SkImage*); virtual sk_sp snapSpecial(); + virtual void setImmutable() {} bool readPixels(const SkPixmap&, int x, int y);