public final void invalidate() {
        if (!displaying) {
            return;
        }

        // TODO: This is sketchy. This attempts to prevent a View from invalidating until after its root has been invalidated, this cutting down on unnecessary and bug-creating
        // calls to canvas.invalidate().
        if (!invalidatedRoot) {
            if (parent == null) {
                invalidatedRoot = true;
            } else {
                View top = parent;
                while (top != null && top.parent != null) {
                    top = top.parent;
                }

                if (top.invalidatedRoot) {
                    invalidatedRoot = true;
                }
            }
        }

        View root = activity.getRootView();
        Debug.log("Invalidating %s, starting at Root %s", this, root);
        LayoutParameters parameters = root.getLayoutParameters();
        root.measure(parameters.getWidth(), parameters.getHeight());
        root.layout(0, root.getMeasuredWidth() - 1, 0, root.getMeasuredHeight() - 1);

        root.draw();

        if (invalidatedRoot) {
            activity.getCanvas().invalidate();
        }
    }