Repository navigation
Get image layer working with cppwinrt. - #354
Conversation
Has some issues if the images are not found, but it works otherwise. Includes some untested cleaning up of the CX code.
In some non-release cases, cppwinrt does not allow classes to be final because it subclasses them..
|
Would it be useful/helpful to have a checked-in reference file? Then you can look at the actual code being generated and have context to reason about what the codegen tool is doing #Resolved |
| priv.WriteLine("bool m_isAnimatedVisualSourceDynamic{};"); | ||
| priv.WriteLine("bool m_isImageLoadingCompleted{};"); | ||
| priv.WriteLine("bool m_isTryCreateAnimatedVisualCalled{};"); | ||
| priv.WriteLine("bool m_isImageLoadingStarted{};"); |
There was a problem hiding this comment.
There seems to be an amount of redundant state stored on this object which is simply derived from the completion count relative to the total count. Was it an explicit choice to have progress/started/completed be state that needs to be updated and kept in sync, vs simply computed when requested? #Resolved
There was a problem hiding this comment.
Do you mean the isImageLoadingCompleted being the same as loadCompleteEventCount == number_of_images? Or are there others?
I don't remember all the decisions that went into the design - it was the result of people asking for features for handling various loading states, but I think they changed their minds and never used them. And I think we changed the policy a bit at one point and the code probably could have been simplified then.
In reply to: 493105017 [](ancestors = 493105017)
There was a problem hiding this comment.
Well, I was originally talking also about m_imageSuccessfulLoadingProgress, but looking at the generated code for that, it actually appears on the surface to be buggy?
m_loadCompleteEventCount++;
if (e.Status() == LoadedImageSourceLoadStatus::Success)
{
m_imageSuccessfulLoadingProgress = (double)m_loadCompleteEventCount / c_loadedImageSurfaceCount;
m_PropertyChanged(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs(L"ImageSuccessfulLoadingProgress"));
}
If I have 5 images, and 4 of them fail to load, but the 5th one loads successfully, that would result in a progress of 1.0 rather than the (I think?) intended 0.2?
In reply to: 493109988 [](ancestors = 493109988,493105017)
|
Yes, but I don't have a file that I can share publicly. I've sent you an example output in mail. In reply to: 697048111 [](ancestors = 697048111) |
Has some issues if the images are not found, but it works otherwise.
Includes some untested cleaning up of the CX code.