mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-20 00:39:53 +00:00
Implement SkiaSurface::applyScale()
This commit is contained in:
parent
e0c78e0f94
commit
7129873cd1
@ -67,6 +67,16 @@ public:
|
||||
}
|
||||
|
||||
void applyScale(int scaleFactor) override {
|
||||
SkBitmap result;
|
||||
result.tryAllocPixels(
|
||||
SkImageInfo::MakeN32Premul(width()*scaleFactor, height()*scaleFactor));
|
||||
|
||||
SkCanvas canvas(result);
|
||||
SkRect srcRect = SkRect::Make(SkIRect::MakeXYWH(0, 0, m_bitmap.width(), m_bitmap.height()));
|
||||
SkRect dstRect = SkRect::Make(SkIRect::MakeXYWH(0, 0, result.width(), result.height()));
|
||||
canvas.drawBitmapRectToRect(m_bitmap, &srcRect, dstRect);
|
||||
|
||||
m_bitmap.swap(result);
|
||||
}
|
||||
|
||||
void* nativeHandle() override {
|
||||
|
Loading…
x
Reference in New Issue
Block a user