Bug 1489632 - mark Skia bitmap layer as immutable before popping it. r=rhunt

This commit is contained in:
Lee Salzman 2018-09-19 15:31:09 -04:00
Родитель 513dbaad87
Коммит db66e58ecc
3 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -119,6 +119,7 @@ protected:
sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&) override; sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&) override;
sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override; sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override;
sk_sp<SkSpecialImage> snapSpecial() override; sk_sp<SkSpecialImage> snapSpecial() override;
void setImmutable() override { fBitmap.setImmutable(); }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -1195,6 +1195,7 @@ void SkCanvas::internalRestore() {
if (layer) { if (layer) {
if (fMCRec) { if (fMCRec) {
const SkIPoint& origin = layer->fDevice->getOrigin(); const SkIPoint& origin = layer->fDevice->getOrigin();
layer->fDevice->setImmutable();
this->internalDrawDevice(layer->fDevice.get(), origin.x(), origin.y(), this->internalDrawDevice(layer->fDevice.get(), origin.x(), origin.y(),
layer->fPaint.get(), layer->fPaint.get(),
layer->fClipImage.get(), layer->fClipMatrix); layer->fClipImage.get(), layer->fClipMatrix);

Просмотреть файл

@ -271,6 +271,7 @@ protected:
virtual sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&); virtual sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&);
virtual sk_sp<SkSpecialImage> makeSpecial(const SkImage*); virtual sk_sp<SkSpecialImage> makeSpecial(const SkImage*);
virtual sk_sp<SkSpecialImage> snapSpecial(); virtual sk_sp<SkSpecialImage> snapSpecial();
virtual void setImmutable() {}
bool readPixels(const SkPixmap&, int x, int y); bool readPixels(const SkPixmap&, int x, int y);