mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
app/internal/srgb: move sRGB emulation to new internal package
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
"image"
|
||||
"runtime"
|
||||
|
||||
"gioui.org/app/internal/glimpl"
|
||||
"gioui.org/app/internal/srgb"
|
||||
"gioui.org/gpu"
|
||||
"gioui.org/gpu/gl"
|
||||
"gioui.org/op"
|
||||
@@ -18,12 +20,12 @@ import (
|
||||
type Window struct {
|
||||
size image.Point
|
||||
ctx context
|
||||
fbo *gl.SRGBFBO
|
||||
fbo *srgb.SRGBFBO
|
||||
gpu *gpu.GPU
|
||||
}
|
||||
|
||||
type context interface {
|
||||
Functions() gl.Functions
|
||||
Functions() *glimpl.Functions
|
||||
MakeCurrent() error
|
||||
ReleaseCurrent()
|
||||
Release()
|
||||
@@ -41,7 +43,7 @@ func NewWindow(width, height int) (*Window, error) {
|
||||
}
|
||||
err = contextDo(ctx, func() error {
|
||||
f := ctx.Functions()
|
||||
fbo, err := gl.NewSRGBFBO(f)
|
||||
fbo, err := srgb.NewSRGBFBO(f)
|
||||
if err != nil {
|
||||
ctx.Release()
|
||||
return err
|
||||
|
||||
@@ -4,7 +4,6 @@ package headless
|
||||
|
||||
import (
|
||||
"gioui.org/app/internal/glimpl"
|
||||
"gioui.org/gpu/gl"
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -16,7 +15,7 @@ import (
|
||||
import "C"
|
||||
|
||||
type nsContext struct {
|
||||
c gl.Functions
|
||||
c *glimpl.Functions
|
||||
ctx C.CFTypeRef
|
||||
prepared bool
|
||||
}
|
||||
@@ -39,7 +38,7 @@ func (c *nsContext) ReleaseCurrent() {
|
||||
C.gio_headless_clearCurrentContext(c.ctx)
|
||||
}
|
||||
|
||||
func (c *nsContext) Functions() gl.Functions {
|
||||
func (c *nsContext) Functions() *glimpl.Functions {
|
||||
return c.c
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,11 @@ import (
|
||||
"syscall/js"
|
||||
|
||||
"gioui.org/app/internal/glimpl"
|
||||
"gioui.org/gpu/gl"
|
||||
)
|
||||
|
||||
type jsContext struct {
|
||||
ctx js.Value
|
||||
f gl.Functions
|
||||
f *glimpl.Functions
|
||||
}
|
||||
|
||||
func newContext() (*jsContext, error) {
|
||||
@@ -38,7 +37,7 @@ func newContext() (*jsContext, error) {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (c *jsContext) Functions() gl.Functions {
|
||||
func (c *jsContext) Functions() *glimpl.Functions {
|
||||
return c.f
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user