-
-
Notifications
You must be signed in to change notification settings - Fork 691
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
Enlarging an image fails on Android Huawei ALE-L02 #1044
Labels
Milestone
Comments
The fundamental fix is: diff --git a/mipmap.go b/mipmap.go
index aa8fe158..452dbbb8 100644
--- a/mipmap.go
+++ b/mipmap.go
@@ -111,8 +111,9 @@ func (m *mipmap) drawImage(src *mipmap, bounds image.Rectangle, geom *GeoM, colo
if level > 6 {
level = 6
}
- if level < -6 {
- level = -6
+ // If tooBigScale is 4, level -10 means that the maximum scale is 4 * 2^10 = 4096. This should be enough.
+ if level < -10 {
+ level = -10
}
cr, cg, cb, ca := float32(1), float32(1), float32(1), float32(1)
@@ -303,7 +304,10 @@ func (m *mipmap) mipmapLevel(geom *GeoM, width, height int, filter driver.Filter
// Use 'negative' mipmap to render edges correctly (#611, #907).
// It looks like 128 is the enlargement factor that causes edge missings to pass the test TestImageStretch.
- const tooBigScale = 128
+ var tooBigScale float32 = 128
+ if !uiDriver().Graphics().HasHighPrecisionFloat() {
+ tooBigScale = 4
+ }
if sx, sy := geomScaleSize(geom); sx >= tooBigScale || sy >= tooBigScale {
// If the filter is not nearest, the target needs to be rendered with graduation. Don't use mipmaps.
if filter != driver.FilterNearest { The problem is that |
Let's move the mipmap part so that |
hajimehoshi
added a commit
that referenced
this issue
Jan 7, 2020
hajimehoshi
added a commit
that referenced
this issue
Jan 7, 2020
Mipmap calculation must be executed after the main loop starts because the graphics driver's HasHighPrecisionFloat is needed. Then, operations on mipmap images must be called from images in buffered package. Updates #1044
I changed the milestone because
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reported by @wasedaigo . This is different from #879. I have not confirmed yet.
The text was updated successfully, but these errors were encountered: