Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TextServer] Remove excessive Dictionary checks. #79166

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions modules/text_server_adv/text_server_adv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2383,10 +2383,8 @@ void TextServerAdvanced::_font_set_variation_coordinates(const RID &p_font_rid,
ERR_FAIL_COND(!fd);

MutexLock lock(fd->mutex);
if (fd->variation_coordinates != p_variation_coordinates) {
_font_clear_cache(fd);
fd->variation_coordinates = p_variation_coordinates;
}
_font_clear_cache(fd);
fd->variation_coordinates = p_variation_coordinates;
}

Dictionary TextServerAdvanced::_font_get_variation_coordinates(const RID &p_font_rid) const {
Expand Down
6 changes: 2 additions & 4 deletions modules/text_server_fb/text_server_fb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,10 +1376,8 @@ void TextServerFallback::_font_set_variation_coordinates(const RID &p_font_rid,
ERR_FAIL_COND(!fd);

MutexLock lock(fd->mutex);
if (fd->variation_coordinates != p_variation_coordinates) {
_font_clear_cache(fd);
fd->variation_coordinates = p_variation_coordinates;
}
_font_clear_cache(fd);
fd->variation_coordinates = p_variation_coordinates;
}

Dictionary TextServerFallback::_font_get_variation_coordinates(const RID &p_font_rid) const {
Expand Down
12 changes: 4 additions & 8 deletions scene/resources/font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2833,10 +2833,8 @@ Ref<Font> FontVariation::_get_base_font_or_default() const {
}

void FontVariation::set_variation_opentype(const Dictionary &p_coords) {
if (variation.opentype != p_coords) {
variation.opentype = p_coords;
_invalidate_rids();
}
variation.opentype = p_coords;
_invalidate_rids();
}

Dictionary FontVariation::get_variation_opentype() const {
Expand Down Expand Up @@ -2877,10 +2875,8 @@ int FontVariation::get_variation_face_index() const {
}

void FontVariation::set_opentype_features(const Dictionary &p_features) {
if (opentype_features != p_features) {
opentype_features = p_features;
_invalidate_rids();
}
opentype_features = p_features;
_invalidate_rids();
}

Dictionary FontVariation::get_opentype_features() const {
Expand Down