1 #include "SkGLCanvas.h" 2 #include "SkBitmap.h" 3 #include "SkPaint.h" 4 #include "SkGpuGLShaders.h" 5 6 extern "C" { 7 void gr_hello_world(); 8 } 9 10 void gr_hello_world() { 11 static GrGpu* gGpu; 12 if (NULL == gGpu) { 13 gGpu = new SkGpuGLShaders; 14 } 15 16 SkGLCanvas canvas(gGpu); 17 SkBitmap bm; 18 19 bm.setConfig(SkBitmap::kARGB_8888_Config, WIDTH, HEIGHT); 20 canvas.setBitmapDevice(bm); 21 22 canvas.drawColor(SK_ColorWHITE); 23 24 SkPaint paint; 25 paint.setAntiAlias(true); 26 paint.setTextSize(30); 27 canvas.drawText("Hello Kno", 9, 40, 40, paint); 28 } 29 30 31