graphics: Bug fix: Stop using texel adjustment on iOS (#442)

This commit is contained in:
Hajime Hoshi 2017-10-07 15:01:33 +09:00
parent b51f4d5312
commit c62c195db3
3 changed files with 50 additions and 8 deletions

View File

@ -17,7 +17,6 @@ package ebiten
import (
"github.com/hajimehoshi/ebiten/internal/affine"
"github.com/hajimehoshi/ebiten/internal/restorable"
"github.com/hajimehoshi/ebiten/internal/web"
)
// texelAdjustment represents a number to be used to adjust texel.
@ -26,13 +25,6 @@ import (
// See #317.
var texelAdjustment float32 = 256
func init() {
if web.IsIOSSafari() {
// Texel adjustment causes glitches on iOS Safari.
texelAdjustment = 0
}
}
var (
quadFloat32Num = restorable.QuadVertexSizeInBytes() / 4
theVerticesBackend = &verticesBackend{}

22
vertices_ios.go Normal file
View File

@ -0,0 +1,22 @@
// Copyright 2017 The Ebiten Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build ios
package ebiten
func init() {
// Texel adjustment causes glitches on iOS.
texelAdjustment = 0
}

28
vertices_notios.go Normal file
View File

@ -0,0 +1,28 @@
// Copyright 2017 The Ebiten Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build !ios
package ebiten
import (
"github.com/hajimehoshi/ebiten/internal/web"
)
func init() {
if web.IsIOSSafari() {
// Texel adjustment causes glitches on iOS.
texelAdjustment = 0
}
}