Example #1
0
        /// <summary>
        /// add to nearest update-rect-region, if not found create a new one
        /// </summary>
        /// <param name="a"></param>
        void AddToNearestRegion(InvalidateGfxArgs a)
        {
            int j = _updateList.Count;
            GfxUpdateRectRgn found = null;

            for (int i = j - 1; i >= 0; --i)
            {
                //search from latest rgn
                GfxUpdateRectRgn existing = _updateList[i];
                if (existing.AccumRect.IntersectsWith(a.GlobalRect))
                {
                    found = existing;
                    break;
                }
            }

            if (found == null)
            {
                GfxUpdateRectRgn updateJob = _updateRectRgnPool.Borrow();
                updateJob.AddDetail(a);
                _updateList.Add(updateJob);
            }
            else
            {
                found.AddDetail(a);
            }
        }
Example #2
0
 public void ClearCurrentUpdate()
 {
     if (_currentUpdateRgn != null)
     {
         _currentUpdateRgn.Reset(_rootgfx);
         _updateRectRgnPool.ReleaseBack(_currentUpdateRgn);
         _currentUpdateRgn = null;
     }
     for (int i = _bubbleGfxTracks.Count - 1; i >= 0; --i)
     {
         RenderElement.ResetBubbleUpdateLocalStatus(_bubbleGfxTracks[i]);
     }
     _bubbleGfxTracks.Clear();
     RenderElement.WaitForStartRenderElement = false;
 }
Example #3
0
        public void SetCurrentUpdate(int index)
        {
            //reset

            AccumUpdateArea = Rectangle.Empty;
            _bubbleGfxTracks.Clear();
            _currentUpdateRgn = _updateList[index];

            int detailCount = _currentUpdateRgn.DetailCount;

            for (int i = 0; i < detailCount; ++i)
            {
                InvalidateGfxArgs args = _currentUpdateRgn.GetDetail(i);
                //ensure
                RenderElement.MarkAsGfxUpdateTip(args.StartOn);
                //TODO: review here again
                BubbleUpGraphicsUpdateTrack(args.StartOn, _bubbleGfxTracks);
            }

            AccumUpdateArea = _currentUpdateRgn.AccumRect;

            RenderElement.WaitForStartRenderElement = true;
        }
Example #4
0
 public void ResetUpdatePlan()
 {
     _currentUpdateRgn = null;
     _updateList.Clear();
     RenderElement.WaitForStartRenderElement = false;
 }