| 676 | } |
| 677 | |
| 678 | static EfTimeInterval |
| 679 | _ComputeInvalidInterval( |
| 680 | const std::optional<TsSpline> &oldSpline, |
| 681 | const std::optional<TsSpline> &newSpline) |
| 682 | { |
| 683 | // If either the new- or old value (or both) resolve to anything but a |
| 684 | // spline (fallback, default, or time samples) we invalidate the full |
| 685 | // interval: Both fallback and default values apply over all time, and time |
| 686 | // samples typically encode such dense data that we do not want to incur |
| 687 | // the cost of detailed analysis of that data. |
| 688 | const bool hasOldSpline = oldSpline.has_value(); |
| 689 | const bool hasNewSpline = newSpline.has_value(); |
| 690 | if (!hasOldSpline || !hasNewSpline) { |
| 691 | return EfTimeInterval::GetFullInterval(); |
| 692 | } |
| 693 | |
| 694 | TRACE_FUNCTION(); |
| 695 | |
| 696 | // If we are going from an empty spline to a non-empty spline or vice-versa, |
| 697 | // invalidate the full interval. |
| 698 | if (oldSpline->IsEmpty() != newSpline->IsEmpty()) { |
| 699 | return EfTimeInterval::GetFullInterval(); |
| 700 | } |
| 701 | |
| 702 | // If loop parameters changed, we invalidate the full interval. |
| 703 | if (oldSpline->HasLoops() != newSpline->HasLoops()) { |
| 704 | return EfTimeInterval::GetFullInterval(); |
| 705 | } |
| 706 | |
| 707 | // If both splines are empty, nothing is invalid. |
| 708 | if (oldSpline->IsEmpty() && newSpline->IsEmpty()) { |
| 709 | return EfTimeInterval(); |
| 710 | } |
| 711 | |
| 712 | // TODO: Compute the change interval between oldSpline and newSpline. For |
| 713 | // the time-being, let's over-invalidate the time range. |
| 714 | return EfTimeInterval::GetFullInterval(); |
| 715 | } |
| 716 | |
| 717 | static TfBits |
| 718 | _FilterTimeDependentOutputs( |
no test coverage detected