Home | History | Annotate | Download | only in gpu
      1 
      2 /*
      3  * Copyright 2011 Google Inc.
      4  *
      5  * Use of this source code is governed by a BSD-style license that can be
      6  * found in the LICENSE file.
      7  */
      8 #include "gl/SkGLCanvas.h"
      9 #include "SkBitmap.h"
     10 #include "SkPaint.h"
     11 #include "gl/SkGpuGLShaders.h"
     12 
     13 extern "C" {
     14     void gr_hello_world();
     15 }
     16 
     17 void gr_hello_world() {
     18     static GrGpu* gGpu;
     19     if (NULL == gGpu) {
     20         gGpu = new SkGpuGLShaders;
     21     }
     22 
     23     SkGLCanvas canvas(gGpu);
     24     SkBitmap bm;
     25 
     26     bm.setConfig(SkBitmap::kARGB_8888_Config, WIDTH, HEIGHT);
     27     canvas.setBitmapDevice(bm);
     28 
     29     canvas.drawColor(SK_ColorWHITE);
     30 
     31     SkPaint paint;
     32     paint.setAntiAlias(true);
     33     paint.setTextSize(30);
     34     canvas.drawText("Hello Kno", 9, 40, 40, paint);
     35 }
     36 
     37 
     38