started to port to gfxdevice abstraction.