fix s52gtk2 build, refactor pattern tilling in GLES2 code