adding class RenderState

RenderState class,can verify change in the render and restoring last qimage generated when nothing changed.