| 3763 | } |
| 3764 | |
| 3765 | bool |
| 3766 | EffectInstance::isIdentity_public(bool useIdentityCache, // only set to true when calling for the whole image (not for a subrect) |
| 3767 | U64 hash, |
| 3768 | double time, |
| 3769 | const RenderScale & scale, |
| 3770 | const RectI & renderWindow, |
| 3771 | ViewIdx view, |
| 3772 | double* inputTime, |
| 3773 | ViewIdx* inputView, |
| 3774 | int* inputNb) |
| 3775 | { |
| 3776 | //assert( !( (supportsRenderScaleMaybe() == eSupportsNo) && !(scale.x == 1. && scale.y == 1.) ) ); |
| 3777 | |
| 3778 | if (useIdentityCache) { |
| 3779 | double timeF = 0.; |
| 3780 | bool foundInCache = _imp->actionsCache->getIdentityResult(hash, time, view, inputNb, inputView, &timeF); |
| 3781 | if (foundInCache) { |
| 3782 | *inputTime = timeF; |
| 3783 | |
| 3784 | return *inputNb >= 0 || *inputNb == -2; |
| 3785 | } |
| 3786 | } |
| 3787 | |
| 3788 | |
| 3789 | ///EDIT: We now allow isIdentity to be called recursively. |
| 3790 | RECURSIVE_ACTION(); |
| 3791 | |
| 3792 | |
| 3793 | bool ret = false; |
| 3794 | RotoDrawableItemPtr rotoItem = getNode()->getAttachedRotoItem(); |
| 3795 | if ( ( rotoItem && !rotoItem->isActivated(time) ) || getNode()->isNodeDisabled() || !getNode()->hasAtLeastOneChannelToProcess() ) { |
| 3796 | ret = true; |
| 3797 | *inputNb = getNode()->getPreferredInput(); |
| 3798 | *inputTime = time; |
| 3799 | *inputView = view; |
| 3800 | } else if ( appPTR->isBackground() && (dynamic_cast<DiskCacheNode*>(this) != NULL) ) { |
| 3801 | ret = true; |
| 3802 | *inputNb = 0; |
| 3803 | *inputTime = time; |
| 3804 | *inputView = view; |
| 3805 | } else { |
| 3806 | /// Don't call isIdentity if plugin is sequential only. |
| 3807 | if (getSequentialPreference() != eSequentialPreferenceOnlySequential) { |
| 3808 | try { |
| 3809 | *inputView = view; |
| 3810 | ret = isIdentity(time, scale, renderWindow, view, inputTime, inputView, inputNb); |
| 3811 | } catch (...) { |
| 3812 | throw; |
| 3813 | } |
| 3814 | } |
| 3815 | } |
| 3816 | if (!ret) { |
| 3817 | *inputNb = -1; |
| 3818 | *inputTime = time; |
| 3819 | *inputView = view; |
| 3820 | } |
| 3821 | |
| 3822 | if (useIdentityCache) { |
no test coverage detected