static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, SkPaint* p) { x += draw_bm(c, bm, x, 0, p); p->setFilterBitmap(true); x += draw_bm(c, bm, x, 0, p); p->setDither(true); return x + draw_bm(c, bm, x, 0, p); }
static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, SkPaint* p) { //正常的 x += draw_bm(c, bm, x, 0, p); //开启滤镜 : 见百度百科 p->setFilterBitmap(true); x += draw_bm(c, bm, x, 0, p); //开启抗抖动 :见百度百科 p->setDither(true);//抖动 return x + draw_bm(c, bm, x, 0, p); }
static void do_render(void) { clear_canvas(impl.cvs, 0x0); clear_canvas(impl.pnl, 0x0); draw_bm(impl.cvs, impl.bm, 0, 0, BOX_SZ, 0x7f7f7f7f, 0xff); draw_sb(impl.cvs, impl.sb, 0, 0, BOX_SZ, 0xff7f7f7f, 0xe0); draw_grid(impl.cvs, impl.bm, 0, 0, BOX_SZ, 0x10ffffff); draw_box(impl.pnl, 0, 0, 100, 100, 0x0, 0xff111111); draw_shape_center(impl.pnl, 0, 20, 50, 50, 12, impl.queue->queue[0], 0x3f<<24, 0xf0); draw_shape_center(impl.pnl, 55, 20, 40, 40, 10, impl.queue->queue[1], 0x2f<<24, 0xc0); draw_shape_center(impl.pnl, 55, 60, 40, 40, 10, impl.queue->queue[2], 0x1f<<24, 0x80); draw_shape_center(impl.pnl, 55, 100, 40, 40, 10, impl.queue->queue[3], 0x0f<<24, 0x50); blit_ui(impl.cvs, 0, 0); blit_ui(impl.pnl, BOX_SZ*XRES, 0); }
BitmapShaderGM() { this->setBGColor(SK_ColorGRAY); draw_bm(&fBitmap); draw_mask(&fMask); }