Exemplo n.º 1
0
void
Compositor::Destroy()
{
  ReadUnlockTextures();
  FlushPendingNotifyNotUsed();
  mIsDestroyed = true;
}
Exemplo n.º 2
0
bool
TextureSourceProvider::NotifyNotUsedAfterComposition(TextureHost* aTextureHost)
{
  mNotifyNotUsedAfterComposition.AppendElement(aTextureHost);

  // If Compositor holds many TextureHosts without compositing,
  // the TextureHosts should be flushed to reduce memory consumption.
  const int thresholdCount = 5;
  const double thresholdSec = 2.0f;
  if (mNotifyNotUsedAfterComposition.Length() > thresholdCount) {
    TimeStamp lastCompositionEndTime = GetLastCompositionEndTime();
    TimeDuration duration = lastCompositionEndTime ? TimeStamp::Now() - lastCompositionEndTime : TimeDuration();
    // Check if we could flush
    if (duration.ToSeconds() > thresholdSec) {
      FlushPendingNotifyNotUsed();
    }
  }
  return true;
}
Exemplo n.º 3
0
void
Compositor::NotifyNotUsedAfterComposition(TextureHost* aTextureHost)
{
  MOZ_ASSERT(!mIsDestroyed);

  mNotifyNotUsedAfterComposition.AppendElement(aTextureHost);

  // If Compositor holds many TextureHosts without compositing,
  // the TextureHosts should be flushed to reduce memory consumption.
  const int thresholdCount = 5;
  const double thresholdSec = 2.0f;
  if (mNotifyNotUsedAfterComposition.Length() > thresholdCount) {
    TimeDuration duration = TimeStamp::Now() - mLastCompositionEndTime;
    // Check if we could flush
    if (duration.ToSeconds() > thresholdSec) {
      FlushPendingNotifyNotUsed();
    }
  }
}
Exemplo n.º 4
0
void
TextureSourceProvider::Destroy()
{
  ReadUnlockTextures();
  FlushPendingNotifyNotUsed();
}