| 3555 | |
| 3556 | |
| 3557 | bool Config::AreViewsEqual(const ConstConfigRcPtr & first, |
| 3558 | const ConstConfigRcPtr & second, |
| 3559 | const char * dispName, // may be empty or nullptr for shared views |
| 3560 | const char * viewName) |
| 3561 | { |
| 3562 | // It's ok to call this even for displays/views that don't exist, it will simply return false. |
| 3563 | |
| 3564 | // Note that this will return true even if the view is display-defined in one config and a reference |
| 3565 | // to a shared view in the other config (both within the same display), as long as the contents match. |
| 3566 | |
| 3567 | // These calls return null if either the display or view doesn't exist (regardless if it's active). |
| 3568 | const char * cs1 = first->getDisplayViewColorSpaceName(dispName, viewName); |
| 3569 | const char * cs2 = second->getDisplayViewColorSpaceName(dispName, viewName); |
| 3570 | |
| 3571 | // If the color space is not null, the display and view exist. |
| 3572 | if (cs1 && *cs1 && cs2 && *cs2) |
| 3573 | { |
| 3574 | // Both configs have a display and view by this name, now check the contents. |
| 3575 | if (Platform::Strcasecmp(cs1, cs2) == 0) |
| 3576 | { |
| 3577 | // Note the remaining strings may be empty in a valid view. |
| 3578 | // Intentionally not checking the description since it is not a functional difference. |
| 3579 | if ( (Platform::Strcasecmp(first->getDisplayViewLooks(dispName, viewName), |
| 3580 | second->getDisplayViewLooks(dispName, viewName)) == 0) && |
| 3581 | (Platform::Strcasecmp(first->getDisplayViewTransformName(dispName, viewName), |
| 3582 | second->getDisplayViewTransformName(dispName, viewName)) == 0) && |
| 3583 | (Platform::Strcasecmp(first->getDisplayViewRule(dispName, viewName), |
| 3584 | second->getDisplayViewRule(dispName, viewName)) == 0) ) |
| 3585 | { |
| 3586 | return true; |
| 3587 | } |
| 3588 | } |
| 3589 | } |
| 3590 | return false; |
| 3591 | } |
| 3592 | |
| 3593 | const char * Config::getDisplayViewTransformName(const char * display, const char * view) const |
| 3594 | { |