detached 94546f0

chore(deps): pin cef2gtk dmabuf churn

commit
94546f0ee3810084d5588fabd7481b1aabb9136a
author
brice · · 2026-07-14 16:10 UTC
parent
c5ad8c0
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
6 files · +165 -127
M go.mod +1 -1
@@ -7,7 +7,7 @@ require (
77 github.com/andybalholm/brotli v1.2.2
88 github.com/bnema/purego v0.11.0-bnema.4
99 github.com/bnema/purego-cef v0.13.4-0.20260714140305-f0b7414af67e
10- github.com/bnema/purego-cef2gtk v0.8.4
10+ github.com/bnema/purego-cef2gtk v0.8.4-0.20260714160309-bbd397409ebe
1111 github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a
1212 github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c
1313 github.com/bnema/puregotk v0.7.0
@@ -7,7 +7,7 @@ require (
7 github.com/andybalholm/brotli v1.2.27 github.com/andybalholm/brotli v1.2.2
8 github.com/bnema/purego v0.11.0-bnema.48 github.com/bnema/purego v0.11.0-bnema.4
9 github.com/bnema/purego-cef v0.13.4-0.20260714140305-f0b7414af67e9 github.com/bnema/purego-cef v0.13.4-0.20260714140305-f0b7414af67e
10- github.com/bnema/purego-cef2gtk v0.8.410+ github.com/bnema/purego-cef2gtk v0.8.4-0.20260714160309-bbd397409ebe
11 github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a11 github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a
12 github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c12 github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c
13 github.com/bnema/puregotk v0.7.013 github.com/bnema/puregotk v0.7.0
M go.sum +2 -0 generated file: collapsed
M vendor/github.com/bnema/purego-cef2gtk/internal/cefadapter/accelerated_paint.go +34 -37
@@ -16,57 +16,54 @@ var (
1616 )
1717
1818 // BorrowedFrameFromAcceleratedPaint converts CEF accelerated paint metadata to a
19-// callback-scoped borrowed DMABUF frame description.
19+// callback-scoped borrowed DMABUF frame description. New single-plane consumers
20+// should use SinglePlaneFrameFromAcceleratedPaint to avoid allocating this slice.
2021 func BorrowedFrameFromAcceleratedPaint(info *cef.AcceleratedPaintInfo) (dmabuf.BorrowedFrame, error) {
22+ frame, err := SinglePlaneFrameFromAcceleratedPaint(info)
23+ if err != nil {
24+ return dmabuf.BorrowedFrame{}, err
25+ }
26+ return dmabuf.BorrowedFrame{
27+ CodedSize: frame.CodedSize,
28+ VisibleRect: frame.VisibleRect,
29+ ContentRect: frame.ContentRect,
30+ SourceSize: frame.SourceSize,
31+ Format: frame.Format,
32+ Modifier: frame.Modifier,
33+ Planes: []dmabuf.Plane{frame.Plane},
34+ }, nil
35+}
36+
37+// SinglePlaneFrameFromAcceleratedPaint converts the supported one-plane CEF
38+// metadata without allocating a plane slice. The returned FD is callback-scoped
39+// and remains owned by CEF.
40+func SinglePlaneFrameFromAcceleratedPaint(info *cef.AcceleratedPaintInfo) (dmabuf.SinglePlaneFrame, error) {
2141 if info == nil {
22- return dmabuf.BorrowedFrame{}, ErrNilAcceleratedPaintInfo
42+ return dmabuf.SinglePlaneFrame{}, ErrNilAcceleratedPaintInfo
2343 }
2444 if info.PlaneCount != 1 {
25- return dmabuf.BorrowedFrame{}, fmt.Errorf("%w: got %d, want 1", dmabuf.ErrUnsupportedPlanes, info.PlaneCount)
45+ return dmabuf.SinglePlaneFrame{}, fmt.Errorf("%w: got %d, want 1", dmabuf.ErrUnsupportedPlanes, info.PlaneCount)
2646 }
27-
28- planeCount := int(info.PlaneCount)
29- planes := make([]dmabuf.Plane, planeCount)
30- for i := 0; i < planeCount; i++ {
31- plane := info.Planes[i]
32- planes[i] = dmabuf.Plane{
47+ plane := info.Planes[0]
48+ frame := dmabuf.SinglePlaneFrame{
49+ CodedSize: dmabuf.Size{Width: info.Extra.CodedSize.Width, Height: info.Extra.CodedSize.Height},
50+ VisibleRect: dmabuf.Rect{X: info.Extra.VisibleRect.X, Y: info.Extra.VisibleRect.Y, Width: info.Extra.VisibleRect.Width, Height: info.Extra.VisibleRect.Height},
51+ ContentRect: dmabuf.Rect{X: info.Extra.ContentRect.X, Y: info.Extra.ContentRect.Y, Width: info.Extra.ContentRect.Width, Height: info.Extra.ContentRect.Height},
52+ SourceSize: dmabuf.Size{Width: info.Extra.SourceSize.Width, Height: info.Extra.SourceSize.Height},
53+ Format: dmabufFormatFromCEFColorType(cef.ColorType(info.Format)),
54+ Modifier: info.Modifier,
55+ Plane: dmabuf.Plane{
3356 FD: int(plane.Fd),
3457 Stride: plane.Stride,
3558 Offset: plane.Offset,
3659 Size: plane.Size,
37- }
38- }
39-
40- frame := dmabuf.BorrowedFrame{
41- CodedSize: dmabuf.Size{
42- Width: info.Extra.CodedSize.Width,
43- Height: info.Extra.CodedSize.Height,
44- },
45- VisibleRect: dmabuf.Rect{
46- X: info.Extra.VisibleRect.X,
47- Y: info.Extra.VisibleRect.Y,
48- Width: info.Extra.VisibleRect.Width,
49- Height: info.Extra.VisibleRect.Height,
50- },
51- ContentRect: dmabuf.Rect{
52- X: info.Extra.ContentRect.X,
53- Y: info.Extra.ContentRect.Y,
54- Width: info.Extra.ContentRect.Width,
55- Height: info.Extra.ContentRect.Height,
5660 },
57- SourceSize: dmabuf.Size{
58- Width: info.Extra.SourceSize.Width,
59- Height: info.Extra.SourceSize.Height,
60- },
61- Format: dmabufFormatFromCEFColorType(cef.ColorType(info.Format)),
62- Modifier: info.Modifier,
63- Planes: planes,
6461 }
6562 if frame.Format == 0 {
66- return dmabuf.BorrowedFrame{}, fmt.Errorf("%w: %d", ErrUnsupportedColorType, info.Format)
63+ return dmabuf.SinglePlaneFrame{}, fmt.Errorf("%w: %d", ErrUnsupportedColorType, info.Format)
6764 }
6865 if err := frame.Validate(); err != nil {
69- return dmabuf.BorrowedFrame{}, err
66+ return dmabuf.SinglePlaneFrame{}, err
7067 }
7168 return frame, nil
7269 }
@@ -16,57 +16,54 @@ var (
16 )16 )
17 17
18 // BorrowedFrameFromAcceleratedPaint converts CEF accelerated paint metadata to a18 // BorrowedFrameFromAcceleratedPaint converts CEF accelerated paint metadata to a
19-// callback-scoped borrowed DMABUF frame description.19+// callback-scoped borrowed DMABUF frame description. New single-plane consumers
20+// should use SinglePlaneFrameFromAcceleratedPaint to avoid allocating this slice.
20 func BorrowedFrameFromAcceleratedPaint(info *cef.AcceleratedPaintInfo) (dmabuf.BorrowedFrame, error) {21 func BorrowedFrameFromAcceleratedPaint(info *cef.AcceleratedPaintInfo) (dmabuf.BorrowedFrame, error) {
22+ frame, err := SinglePlaneFrameFromAcceleratedPaint(info)
23+ if err != nil {
24+ return dmabuf.BorrowedFrame{}, err
25+ }
26+ return dmabuf.BorrowedFrame{
27+ CodedSize: frame.CodedSize,
28+ VisibleRect: frame.VisibleRect,
29+ ContentRect: frame.ContentRect,
30+ SourceSize: frame.SourceSize,
31+ Format: frame.Format,
32+ Modifier: frame.Modifier,
33+ Planes: []dmabuf.Plane{frame.Plane},
34+ }, nil
35+}
36+
37+// SinglePlaneFrameFromAcceleratedPaint converts the supported one-plane CEF
38+// metadata without allocating a plane slice. The returned FD is callback-scoped
39+// and remains owned by CEF.
40+func SinglePlaneFrameFromAcceleratedPaint(info *cef.AcceleratedPaintInfo) (dmabuf.SinglePlaneFrame, error) {
21 if info == nil {41 if info == nil {
22- return dmabuf.BorrowedFrame{}, ErrNilAcceleratedPaintInfo42+ return dmabuf.SinglePlaneFrame{}, ErrNilAcceleratedPaintInfo
23 }43 }
24 if info.PlaneCount != 1 {44 if info.PlaneCount != 1 {
25- return dmabuf.BorrowedFrame{}, fmt.Errorf("%w: got %d, want 1", dmabuf.ErrUnsupportedPlanes, info.PlaneCount)45+ return dmabuf.SinglePlaneFrame{}, fmt.Errorf("%w: got %d, want 1", dmabuf.ErrUnsupportedPlanes, info.PlaneCount)
26 }46 }
27-47+ plane := info.Planes[0]
28- planeCount := int(info.PlaneCount)48+ frame := dmabuf.SinglePlaneFrame{
29- planes := make([]dmabuf.Plane, planeCount)49+ CodedSize: dmabuf.Size{Width: info.Extra.CodedSize.Width, Height: info.Extra.CodedSize.Height},
30- for i := 0; i < planeCount; i++ {50+ VisibleRect: dmabuf.Rect{X: info.Extra.VisibleRect.X, Y: info.Extra.VisibleRect.Y, Width: info.Extra.VisibleRect.Width, Height: info.Extra.VisibleRect.Height},
31- plane := info.Planes[i]51+ ContentRect: dmabuf.Rect{X: info.Extra.ContentRect.X, Y: info.Extra.ContentRect.Y, Width: info.Extra.ContentRect.Width, Height: info.Extra.ContentRect.Height},
32- planes[i] = dmabuf.Plane{52+ SourceSize: dmabuf.Size{Width: info.Extra.SourceSize.Width, Height: info.Extra.SourceSize.Height},
53+ Format: dmabufFormatFromCEFColorType(cef.ColorType(info.Format)),
54+ Modifier: info.Modifier,
55+ Plane: dmabuf.Plane{
33 FD: int(plane.Fd),56 FD: int(plane.Fd),
34 Stride: plane.Stride,57 Stride: plane.Stride,
35 Offset: plane.Offset,58 Offset: plane.Offset,
36 Size: plane.Size,59 Size: plane.Size,
37- }
38- }
39-
40- frame := dmabuf.BorrowedFrame{
41- CodedSize: dmabuf.Size{
42- Width: info.Extra.CodedSize.Width,
43- Height: info.Extra.CodedSize.Height,
44- },
45- VisibleRect: dmabuf.Rect{
46- X: info.Extra.VisibleRect.X,
47- Y: info.Extra.VisibleRect.Y,
48- Width: info.Extra.VisibleRect.Width,
49- Height: info.Extra.VisibleRect.Height,
50- },
51- ContentRect: dmabuf.Rect{
52- X: info.Extra.ContentRect.X,
53- Y: info.Extra.ContentRect.Y,
54- Width: info.Extra.ContentRect.Width,
55- Height: info.Extra.ContentRect.Height,
56 },60 },
57- SourceSize: dmabuf.Size{
58- Width: info.Extra.SourceSize.Width,
59- Height: info.Extra.SourceSize.Height,
60- },
61- Format: dmabufFormatFromCEFColorType(cef.ColorType(info.Format)),
62- Modifier: info.Modifier,
63- Planes: planes,
64 }61 }
65 if frame.Format == 0 {62 if frame.Format == 0 {
66- return dmabuf.BorrowedFrame{}, fmt.Errorf("%w: %d", ErrUnsupportedColorType, info.Format)63+ return dmabuf.SinglePlaneFrame{}, fmt.Errorf("%w: %d", ErrUnsupportedColorType, info.Format)
67 }64 }
68 if err := frame.Validate(); err != nil {65 if err := frame.Validate(); err != nil {
69- return dmabuf.BorrowedFrame{}, err66+ return dmabuf.SinglePlaneFrame{}, err
70 }67 }
71 return frame, nil68 return frame, nil
72 }69 }
M vendor/github.com/bnema/purego-cef2gtk/internal/dmabuf/frame.go +38 -19 generated file: collapsed
M vendor/github.com/bnema/purego-cef2gtk/internal/gtkgdk/renderer.go +89 -69 generated file: collapsed
M vendor/modules.txt +1 -1 generated file: collapsed

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close