Add SkiaSurface::swapBitmap()

This commit is contained in:
David Capello 2015-04-16 15:38:44 -03:00
parent 46a03b1f4c
commit 6b25004b48
2 changed files with 6 additions and 2 deletions

View File

@ -76,7 +76,7 @@ public:
SkRect dstRect = SkRect::Make(SkIRect::MakeXYWH(0, 0, result.width(), result.height()));
canvas.drawBitmapRectToRect(m_bitmap, &srcRect, dstRect);
m_bitmap.swap(result);
swapBitmap(result);
}
void* nativeHandle() override {
@ -204,6 +204,10 @@ public:
return m_bitmap;
}
void swapBitmap(SkBitmap& other) {
m_bitmap.swap(other);
}
private:
SkBitmap m_bitmap;
};

View File

@ -72,7 +72,7 @@ public:
bm.pixelRef()->setURI(filename);
SkiaSurface* sur = new SkiaSurface();
sur->bitmap().swap(bm);
sur->swapBitmap(bm);
return sur;
}
}