Changes to support owndraw example.