示例#1
0
        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);
            //-------------------------------------------------------------------------
        }
示例#2
0
        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);
            //-------------------------------------------------------------------------
        }