code: public boolean needsPaint ()
      {
          // compute our average dirty regions per tick
          if (_tick++ == 99) {
              _tick = 0;
              int dirty = IntListUtil.sum(_dirty);
              Arrays.fill(_dirty, 0);
              _dirtyPerTick = (float)dirty/100;
          }
  
          // regardless of whether or not we paint, we need to let our abstract media managers know
          // that we've gotten to the point of painting because they need to remain prepared to deal
          // with media changes that happen any time between the tick() and the paint() and thus need
          // to know when paint() happens
          _animmgr.willPaint();
          _spritemgr.willPaint();
  
          // if we have dirty regions, we need painting
          return _remgr.haveDirtyRegions();
      }
docs: Our media front end should implement {@link FrameParticipant} and call this method in their
  {@link FrameParticipant#needsPaint} method.