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

internal/driver/mobile: tidy unused code #2437

Merged
merged 5 commits into from
Sep 22, 2021
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
7 changes: 3 additions & 4 deletions internal/driver/mobile/app/android.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ import (
"time"
"unsafe"

"fyne.io/fyne/v2/internal/driver/mobile/app/internal/callfn"
"fyne.io/fyne/v2/internal/driver/mobile/app/callfn"
"fyne.io/fyne/v2/internal/driver/mobile/event/key"
"fyne.io/fyne/v2/internal/driver/mobile/event/lifecycle"
"fyne.io/fyne/v2/internal/driver/mobile/event/paint"
"fyne.io/fyne/v2/internal/driver/mobile/event/size"
"fyne.io/fyne/v2/internal/driver/mobile/event/touch"
"fyne.io/fyne/v2/internal/driver/mobile/geom"
"fyne.io/fyne/v2/internal/driver/mobile/mobileinit"
)

Expand Down Expand Up @@ -448,8 +447,8 @@ func mainUI(vm, jniEnv, ctx uintptr) error {
theApp.eventsIn <- size.Event{
WidthPx: widthPx,
HeightPx: heightPx,
WidthPt: geom.Pt(float32(widthPx) / pixelsPerPt),
HeightPt: geom.Pt(float32(heightPx) / pixelsPerPt),
WidthPt: float32(widthPx) / pixelsPerPt,
HeightPt: float32(heightPx) / pixelsPerPt,
InsetTopPx: screenInsetTop,
InsetBottomPx: screenInsetBottom,
InsetLeftPx: screenInsetLeft,
Expand Down
5 changes: 2 additions & 3 deletions internal/driver/mobile/app/darwin_desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"fyne.io/fyne/v2/internal/driver/mobile/event/paint"
"fyne.io/fyne/v2/internal/driver/mobile/event/size"
"fyne.io/fyne/v2/internal/driver/mobile/event/touch"
"fyne.io/fyne/v2/internal/driver/mobile/geom"
)

var initThreadID uint64
Expand Down Expand Up @@ -134,8 +133,8 @@ func setGeom(pixelsPerPt float32, widthPx, heightPx int) {
theApp.eventsIn <- size.Event{
WidthPx: widthPx,
HeightPx: heightPx,
WidthPt: geom.Pt(float32(widthPx) / pixelsPerPt),
HeightPt: geom.Pt(float32(heightPx) / pixelsPerPt),
WidthPt: float32(widthPx) / pixelsPerPt,
HeightPt: float32(heightPx) / pixelsPerPt,
PixelsPerPt: pixelsPerPt,
Orientation: screenOrientation(widthPx, heightPx),
}
Expand Down
5 changes: 2 additions & 3 deletions internal/driver/mobile/app/darwin_ios.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import (
"fyne.io/fyne/v2/internal/driver/mobile/event/paint"
"fyne.io/fyne/v2/internal/driver/mobile/event/size"
"fyne.io/fyne/v2/internal/driver/mobile/event/touch"
"fyne.io/fyne/v2/internal/driver/mobile/geom"
)

var initThreadID uint64
Expand Down Expand Up @@ -136,8 +135,8 @@ func updateConfig(width, height, orientation int32) {
theApp.eventsIn <- size.Event{
WidthPx: int(width),
HeightPx: int(height),
WidthPt: geom.Pt(float32(width) / pixelsPerPt),
HeightPt: geom.Pt(float32(height) / pixelsPerPt),
WidthPt: float32(width) / pixelsPerPt,
HeightPt: float32(height) / pixelsPerPt,
InsetTopPx: int(float32(insets.top) * float32(screenScale)),
InsetBottomPx: int(float32(insets.bottom) * float32(screenScale)),
InsetLeftPx: int(float32(insets.left) * float32(screenScale)),
Expand Down
5 changes: 2 additions & 3 deletions internal/driver/mobile/app/x11.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"fyne.io/fyne/v2/internal/driver/mobile/event/paint"
"fyne.io/fyne/v2/internal/driver/mobile/event/size"
"fyne.io/fyne/v2/internal/driver/mobile/event/touch"
"fyne.io/fyne/v2/internal/driver/mobile/geom"
)

func init() {
Expand Down Expand Up @@ -87,8 +86,8 @@ func onResize(w, h int) {
theApp.eventsIn <- size.Event{
WidthPx: w,
HeightPx: h,
WidthPt: geom.Pt(w),
HeightPt: geom.Pt(h),
WidthPt: float32(w),
HeightPt: float32(h),
PixelsPerPt: pixelsPerPt,
Orientation: screenOrientation(w, h),
}
Expand Down
8 changes: 3 additions & 5 deletions internal/driver/mobile/event/size/size.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ package size // import "fyne.io/fyne/v2/internal/driver/mobile/event/size"

import (
"image"

"fyne.io/fyne/v2/internal/driver/mobile/geom"
)

// Event holds the dimensions, physical resolution and orientation of the app's
Expand All @@ -25,14 +23,14 @@ type Event struct {
//
// The values are based on PixelsPerPt and are therefore approximate, as
// per the comment on PixelsPerPt.
WidthPt, HeightPt geom.Pt
WidthPt, HeightPt float32

// PixelsPerPt is the window's physical resolution. It is the number of
// pixels in a single geom.Pt, from the golang.org/x/mobile/geom package.
// pixels in a single float32.
//
// There are a wide variety of pixel densities in existing phones and
// tablets, so apps should be written to expect various non-integer
// PixelsPerPt values. In general, work in geom.Pt.
// PixelsPerPt values.
//
// The value is approximate, in that the OS, drivers or hardware may report
// approximate or quantized values. An N x N pixel square should be roughly
Expand Down
102 changes: 0 additions & 102 deletions internal/driver/mobile/geom/geom.go

This file was deleted.

22 changes: 0 additions & 22 deletions internal/driver/mobile/gl/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,6 @@ https://www.khronos.org/opengles/sdk/docs/man/

One notable departure from the C API is the introduction of types
to represent common uses of GLint: Texture, Surface, Buffer, etc.

Debug Logging

A tracing version of the OpenGL bindings is behind the `gldebug` build
tag. It acts as a simplified version of apitrace. Build your Go binary
with

-tags gldebug

and each call to a GL function will log its input, output, and any
error messages. For example,

I/Fyne (27668): gl.GenBuffers(1) [Buffer(70001)]
I/Fyne (27668): gl.BindBuffer(ARRAY_BUFFER, Buffer(70001))
I/Fyne (27668): gl.BufferData(ARRAY_BUFFER, 36, len(36), STATIC_DRAW)
I/Fyne (27668): gl.BindBuffer(ARRAY_BUFFER, Buffer(70001))
I/Fyne (27668): gl.VertexAttribPointer(Attrib(0), 6, FLOAT, false, 0, 0) error: [INVALID_VALUE]

The gldebug tracing has very high overhead, so make sure to remove
the build tag before deploying any binaries.
*/
package gl // import "fyne.io/fyne/v2/internal/driver/mobile/gl"

Expand All @@ -62,5 +42,3 @@ For the purpose of analyzing this code for race conditions, picture two
separate goroutines: one blocked on gl.Start, and another making calls to
the gl package exported functions.
*/

//go:generate go run gendebug.go -o gldebug.go
Loading