cztomczak / cef2go

Go lang bindings for the Chromium Embedded Framework (CEF)
https://groups.google.com/d/forum/cef2go
Other
881 stars 127 forks source link

Off-screen rendering (OSR) support #2

Open cztomczak opened 10 years ago

cztomczak commented 10 years ago

Many people are asking for this, so it should become a high priority.

What should the example do? What libraries to use in the example? Some framework/game engine or just plain win32 WM_PAINT?

h12w commented 10 years ago

I suggest rendering the page on a SDL2 surface. SDL2 is portable on all major platforms including iOS and Android. (I have made a Go binding package: https://github.com/hailiang/go-sdl ).

cztomczak commented 10 years ago

Currently there is a bug in Go linker on Windows that prevents us from implementing app/client handlers, thus OSR cannot be implemented (at least on Windows). The plan was to create OSR example for Windows first (that's my main platform). See the code comments about the problem in the _InitializeGlobalCStructures() function.

There is Issue 2601 in the Go project that I think might be the cause of the problem.

cztomczak commented 10 years ago

It turns out this is some problem with GCC on Windows when calling Chromium C API, as I've prepared a C example that does same things as in Go and these exceptions also occur. Reported problem on the CEF forum:

http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=11505

cztomczak commented 10 years ago

App/Client handlers Windows issue was fixed in commit f78983456b6c8a899d27f72ffe6923019ba92504. Nothing stands in way to implement OSR now.

h12w commented 10 years ago

That's great news!

cztomczak commented 10 years ago

Off-screen rendering support was implemented in paperlesspost fork (https://github.com/paperlesspost/cef2go). See cef/render_handler.go . This fork is tested on Linux only.

For an example usage of OnPaint callback see this commit: https://github.com/paperlesspost/cef2go/blob/ada33ec9eaa634634eca89da69d1a48bccc22282/cef/cef_callbacks.go

oldtree2008 commented 9 years ago

I use cef2go to develop a gis app. I use html5 webgl draw map. when I drag data file to the map. but Map dont't refresh. But I use cef c# wrapper, It can work. Chrome also can work.why?

I guess my problem may have something to do with the WM_PAINT event.

I am not sure.

cztomczak commented 9 years ago

@oldtree2008 Please do not ask questions in the tracker. Do not talk off-topic. Use forum.