Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c9bb240 authored by Mike Reed's avatar Mike Reed
Browse files

Don't use deprecated canvas methods

Allows skia to remove SK_SUPPORT_LEGACY_CANVAS_HELPERS

Test: Existing tests cover the change.

Change-Id: I764c11f7a9bd7b87fba8563968160ee7dc9a99a2
parent 9bcef123
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -476,7 +476,7 @@ void SkiaCanvas::drawLines(const float* points, int count, const SkPaint& paint)
void SkiaCanvas::drawRect(float left, float top, float right, float bottom,
        const SkPaint& paint) {
    if (CC_UNLIKELY(paint.nothingToDraw())) return;
    mCanvas->drawRectCoords(left, top, right, bottom, paint);
    mCanvas->drawRect({left, top, right, bottom}, paint);

}

+4 −4
Original line number Diff line number Diff line
@@ -220,13 +220,13 @@ void SpriteController::doUpdateSprites() {

                if (outBuffer.width > update.state.icon.bitmap.width()) {
                    paint.setColor(0); // transparent fill color
                    surfaceCanvas.drawRectCoords(update.state.icon.bitmap.width(), 0,
                            outBuffer.width, update.state.icon.bitmap.height(), paint);
                    surfaceCanvas.drawRect(SkRect::MakeLTRB(update.state.icon.bitmap.width(), 0,
                            outBuffer.width, update.state.icon.bitmap.height()), paint);
                }
                if (outBuffer.height > update.state.icon.bitmap.height()) {
                    paint.setColor(0); // transparent fill color
                    surfaceCanvas.drawRectCoords(0, update.state.icon.bitmap.height(),
                            outBuffer.width, outBuffer.height, paint);
                    surfaceCanvas.drawRect(SkRect::MakeLTRB(0, update.state.icon.bitmap.height(),
                            outBuffer.width, outBuffer.height), paint);
                }

                status = surface->unlockAndPost();