mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-28 18:32:50 +00:00
Add SkiaSurface::swapBitmap()
This commit is contained in:
parent
46a03b1f4c
commit
6b25004b48
@ -76,7 +76,7 @@ public:
|
|||||||
SkRect dstRect = SkRect::Make(SkIRect::MakeXYWH(0, 0, result.width(), result.height()));
|
SkRect dstRect = SkRect::Make(SkIRect::MakeXYWH(0, 0, result.width(), result.height()));
|
||||||
canvas.drawBitmapRectToRect(m_bitmap, &srcRect, dstRect);
|
canvas.drawBitmapRectToRect(m_bitmap, &srcRect, dstRect);
|
||||||
|
|
||||||
m_bitmap.swap(result);
|
swapBitmap(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* nativeHandle() override {
|
void* nativeHandle() override {
|
||||||
@ -204,6 +204,10 @@ public:
|
|||||||
return m_bitmap;
|
return m_bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void swapBitmap(SkBitmap& other) {
|
||||||
|
m_bitmap.swap(other);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SkBitmap m_bitmap;
|
SkBitmap m_bitmap;
|
||||||
};
|
};
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
bm.pixelRef()->setURI(filename);
|
bm.pixelRef()->setURI(filename);
|
||||||
|
|
||||||
SkiaSurface* sur = new SkiaSurface();
|
SkiaSurface* sur = new SkiaSurface();
|
||||||
sur->bitmap().swap(bm);
|
sur->swapBitmap(bm);
|
||||||
return sur;
|
return sur;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user