feat(后端架构): 完善GG后端,修复渐变与选区异常
build.yaml / build (push) Successful in 37s

This commit is contained in:
xiaoqidun committed 2026-09-23 18:43:53 +08:00
1 parent c15547f0d2
commit f44d0d8a60
30 files changed
+2075 -463

No files matched your search

+4 -2
View File
@@ -22,7 +22,7 @@ import (
"github.com/gogpu/gg"
)
// GGBackend 不注册全局GPU设备或回退到其他绘图库的CPU后端
// GGBackend 提供字体、页面编译和CPU绘制,不注册全局GPU设备或隐式切换后端
type GGBackend struct{}
// Name 返回后端标识
@@ -43,7 +43,9 @@ func (GGBackend) Render(page *RasterPage) (image.Image, error) {
for i, cmd := range page.Commands {
m := page.PixelTransform(cmd.Transform, h)
if cmd.Image != nil {
drawRasterImage(img, cmd.Image, m)
if err := drawRasterImageCommand(GGBackend{}, page, img, imagePixelSource(cmd.Image), cmd); err != nil {
return nil, err
}
continue
}
path := gg.NewPath()