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

Commit 74f36500 authored by Diego Perez's avatar Diego Perez
Browse files

Fix NopCanvas initialization

Reverse the logic since the field wouldn't be initialized to true before
super is called.

Test: Layoutlib tests
Change-Id: Ic3affb608bdf3306ada25e2dd986a48f6caae202
parent be4d4fa3
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -31,18 +31,18 @@ import android.graphics.RectF;
 * Canvas implementation that does not do any rendering
 */
public class NopCanvas extends Canvas {
    private boolean mIsHardwareAccelerated = true;
    private boolean mIsInitialized = false;

    public NopCanvas() {
        super();
        // We return true the first time so there are no allocations for the software renderer in
        // the constructor
        mIsHardwareAccelerated = false;
        mIsInitialized = true;
    }

    @Override
    public boolean isHardwareAccelerated() {
        return mIsHardwareAccelerated;
        // We return true the first time so there are no allocations for the software renderer in
        // the constructor
        return !mIsInitialized;
    }

    @Override