aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/go-skia
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-11-03 10:45:50 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-03 10:45:50 -0800
commit3eeb156822d5062aaa8909d6bc53c734c94fb8f2 (patch)
treed08885687a4c07e64d6f23dc313d2d920c5f92c7 /experimental/go-skia
parent37b4d866b1446d35c989f9a97885a777ddc7d1c8 (diff)
patch from issue 697743002
working The key here was to get everything into a single library. Our shared library build is the easiest way to do that. Some light skimming online makes it look like perhaps cgo requires shared libraries, so that may be at play here too. BUG=skia: Review URL: https://codereview.chromium.org/698943002
Diffstat (limited to 'experimental/go-skia')
-rw-r--r--experimental/go-skia/skia.go46
1 files changed, 27 insertions, 19 deletions
diff --git a/experimental/go-skia/skia.go b/experimental/go-skia/skia.go
index 0758c432d1..30730578a7 100644
--- a/experimental/go-skia/skia.go
+++ b/experimental/go-skia/skia.go
@@ -1,30 +1,38 @@
-package skia
+package main
+
+// First, build Skia this way:
+// ./gyp_skia -Dskia_shared_lib=1 && ninja -C out/Debug
/*
-#cgo CFLAGS: -I../../include/c
-#cgo LDFLAGS: -L ../../out/Debug/
-#cgo LDFLAGS: -lskia_core
-#cgo LDFLAGS: -lskia_effects
-#cgo LDFLAGS: -lskia_images
-#cgo LDFLAGS: -lskia_opts
-#cgo LDFLAGS: -lskia_ports
-#cgo LDFLAGS: -lskia_sfnt
-#cgo LDFLAGS: -lskia_utils
-#cgo LDFLAGS: -lskia_opts_ssse3
-#cgo LDFLAGS: -lskia_opts_sse4
-#cgo LDFLAGS: -lm
-#cgo LDFLAGS: -lstdc++
#cgo LDFLAGS: -lGL
#cgo LDFLAGS: -lGLU
+#cgo LDFLAGS: -lX11
+#cgo LDFLAGS: -ldl
+#cgo LDFLAGS: -lfontconfig
+#cgo LDFLAGS: -lfreetype
+#cgo LDFLAGS: -lgif
+#cgo LDFLAGS: -lm
+#cgo LDFLAGS: -lpng
+#cgo LDFLAGS: -lstdc++
+#cgo LDFLAGS: -lz
+
+#cgo LDFLAGS: -L ../../out/Debug/lib
+#cgo LDFLAGS: -Wl,-rpath=../../out/Debug/lib
+#cgo LDFLAGS: -lskia
+
+#cgo CFLAGS: -I../../include/c
#include "sk_surface.h"
*/
import "C"
-func dummyFunction() {
- testPaint := C.sk_paint_new()
- defer func() {
- sk_paint_delete(testPaint)
- }()
+import (
+ "fmt"
+)
+
+func main() {
+ p := C.sk_paint_new()
+ defer C.sk_paint_delete(p)
+ fmt.Println("OK!")
}
// TODO: replace this with an idiomatic interface to Skia.