-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] ensure 1x1 has mipcount of 1 #39182
Conversation
actually I think I might be misunderstanding this API, certainly asking for a mipcount of 0 is invalid - but does mipcount of 1 mean no mipping mapping? |
Yeah, 1 just means no mipmapping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits but lgtm otherwise.
impeller/geometry/size.h
Outdated
@@ -102,7 +102,9 @@ struct TSize { | |||
if (!IsPositive()) { | |||
return 1u; | |||
} | |||
return std::max(ceil(log2(width)), ceil(log2(height))); | |||
constexpr size_t minimumMip = 1u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
underscore_case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -640,6 +640,7 @@ TEST(GeometryTest, CanGenerateMipCounts) { | |||
ASSERT_EQ((Size{128, 0}.MipCount()), 1u); | |||
ASSERT_EQ((Size{128, -25}.MipCount()), 1u); | |||
ASSERT_EQ((Size{-128, 25}.MipCount()), 1u); | |||
ASSERT_EQ((Size{1, 1}.MipCount()), 1u); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mip counts should always at least be 1. Perhaps also check Size{0, 0}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…119344) * 6a92731d2 [Impeller] ensure 1x1 has mipcount of 1 (flutter/engine#39182) * 55f7a09b4 Roll Fuchsia Linux SDK from kdjOCYzDtnfY30985... to 6c2H32X3EXOGlWIgb... (flutter/engine#39193) * 621e13cc9 Roll Dart SDK from dcdd3fbb3116 to 2cd9b7ac95e8 (2 revisions) (flutter/engine#39185)
* [Impeller] ensure 1x1 has mipcount of 1 * Update geometry_unittests.cc * Update size.h
* [Impeller] ensure 1x1 has mipcount of 1 * Update geometry_unittests.cc * Update size.h Co-authored-by: Jonah Williams <[email protected]>
Fixes flutter/flutter#119245
Before mipcount of 1x1 image would be 0, resulting in invalid texture