public override void BlitFrom(DrawBoard src, float srcX, float srcY, float srcW, float srcH, float dstX, float dstY) { if (!src.IsGpuDrawBoard) { //cpu draw board BitmapBufferProvider bmpProvider = src.GetInternalBitmapProvider(); if (_tmpGLBmp == null) { _tmpGLBmp = new GLBitmap(bmpProvider); } else { _tmpGLBmp.UpdateTexture(new Rectangle((int)srcX, (int)srcY, (int)srcW, (int)srcH)); } //--------- this.DrawImage(_tmpGLBmp, new RectangleF((int)dstX, (int)dstY, (int)srcW, (int)srcH), //dst new RectangleF((int)srcX, (int)srcY, (int)srcW, (int)srcH)); //src } else { //TODO: implement this.... } }
protected override void RenderClientContent(DrawBoard d, UpdateArea updateArea) { //canvas here should be glcanvas //TODO: //1. if the content of glBmp is not changed //we should not render again //2. if we only update some part of texture //may can transfer only that part to the glBmp //------------------------------------------------------------------------- if (GlobalRootGraphic.CurrentRootGfx.HasRenderTreeInvalidateAccumRect) { //update cpu surface part*** DrawBoard board = _glesUIElem.GetDrawBoard(); if (board != null) { board.SetClipRect(updateArea.CurrentRect); board.Clear(Color.White); //clear background, clear with white solid #if DEBUG //_ui.dbugSaveAggBmp("a001.png"); #endif } if (_glesUIElem.HasCpuBlitUpdateSurfaceDel) { _glesUIElem.UpdateCpuBlitSurface(updateArea.CurrentRect); } } _glBmp.UpdateTexture(updateArea.CurrentRect); //------------------------------------------------------------------------- d.DrawImage(_glBmp, 0, 0); //test print text from our GLTextPrinter //_glPainter.FillColor = PixelFarm.Drawing.Color.Black; //_glPainter.DrawString("Hello2", 0, 400); //------------------------------------------------------------------------- }
protected override void DrawBoxContent(DrawBoard d, Rectangle updateArea) { //canvas here should be glcanvas //TODO: //1. if the content of glBmp is not changed //we should not render again //2. if we only update some part of texture //may can transfer only that part to the glBmp //------------------------------------------------------------------------- if (_rootgfx.HasRenderTreeInvalidateAccumRect) { //update cpu surface part*** DrawBoard board = _ui.GetDrawBoard(); if (board != null) { board.SetClipRect(updateArea); board.Clear(Color.White); //clear background //board.SetClipRect(new Rectangle(0, 0, 1200, 1200)); DrawDefaultLayer(board, ref updateArea); #if DEBUG //_ui.dbugSaveAggBmp("c:\\WImageTest\\a001.png"); #endif } if (_ui.HasCpuBlitUpdateSurfaceDel) { _ui.UpdateCpuBlitSurface(updateArea); } } _glBmp.UpdateTexture(updateArea); //------------------------------------------------------------------------- d.DrawImage(_glBmp, 0, 0); //_pcx.DrawImage(_glBmp, 0, 0); //test print text from our GLTextPrinter //_glPainter.FillColor = PixelFarm.Drawing.Color.Black; //_glPainter.DrawString("Hello2", 0, 400); //------------------------------------------------------------------------- }