OLD | NEW |
1 package main | 1 package main |
2 | 2 |
3 import ( | 3 import ( |
4 "bytes" | 4 "bytes" |
5 "crypto/md5" | 5 "crypto/md5" |
6 "database/sql" | 6 "database/sql" |
7 "encoding/base64" | 7 "encoding/base64" |
8 "encoding/binary" | 8 "encoding/binary" |
9 "encoding/json" | 9 "encoding/json" |
10 "flag" | 10 "flag" |
(...skipping 17 matching lines...) Expand all Loading... |
28 ) | 28 ) |
29 | 29 |
30 import ( | 30 import ( |
31 "github.com/fiorix/go-web/autogzip" | 31 "github.com/fiorix/go-web/autogzip" |
32 _ "github.com/go-sql-driver/mysql" | 32 _ "github.com/go-sql-driver/mysql" |
33 _ "github.com/mattn/go-sqlite3" | 33 _ "github.com/mattn/go-sqlite3" |
34 ) | 34 ) |
35 | 35 |
36 const ( | 36 const ( |
37 RESULT_COMPILE = `../../experimental/webtry/safec++ -DSK_GAMMA_SRGB -DSK
_GAMMA_APPLY_TO_A8 -DSK_SCALAR_TO_FLOAT_EXCLUDED -DSK_ALLOW_STATIC_GLOBAL_INITIA
LIZERS=1 -DSK_SUPPORT_GPU=0 -DSK_SUPPORT_OPENCL=0 -DSK_FORCE_DISTANCEFIELD_FONTS
=0 -DSK_SCALAR_IS_FLOAT -DSK_CAN_USE_FLOAT -DSK_SAMPLES_FOR_X -DSK_BUILD_FOR_UNI
X -DSK_USE_POSIX_THREADS -DSK_SYSTEM_ZLIB=1 -DSK_DEBUG -DSK_DEVELOPER=1 -I../../
src/core -I../../src/images -I../../tools/flags -I../../include/config -I../../i
nclude/core -I../../include/pathops -I../../include/pipe -I../../include/effects
-I../../include/ports -I../../src/sfnt -I../../include/utils -I../../src/utils
-I../../include/images -g -fno-exceptions -fstrict-aliasing -Wall -Wextra -Winit
-self -Wpointer-arith -Wno-unused-parameter -m64 -fno-rtti -Wnon-virtual-dtor -c
../../../cache/%s.cpp -o ../../../cache/%s.o` | 37 RESULT_COMPILE = `../../experimental/webtry/safec++ -DSK_GAMMA_SRGB -DSK
_GAMMA_APPLY_TO_A8 -DSK_SCALAR_TO_FLOAT_EXCLUDED -DSK_ALLOW_STATIC_GLOBAL_INITIA
LIZERS=1 -DSK_SUPPORT_GPU=0 -DSK_SUPPORT_OPENCL=0 -DSK_FORCE_DISTANCEFIELD_FONTS
=0 -DSK_SCALAR_IS_FLOAT -DSK_CAN_USE_FLOAT -DSK_SAMPLES_FOR_X -DSK_BUILD_FOR_UNI
X -DSK_USE_POSIX_THREADS -DSK_SYSTEM_ZLIB=1 -DSK_DEBUG -DSK_DEVELOPER=1 -I../../
src/core -I../../src/images -I../../tools/flags -I../../include/config -I../../i
nclude/core -I../../include/pathops -I../../include/pipe -I../../include/effects
-I../../include/ports -I../../src/sfnt -I../../include/utils -I../../src/utils
-I../../include/images -g -fno-exceptions -fstrict-aliasing -Wall -Wextra -Winit
-self -Wpointer-arith -Wno-unused-parameter -m64 -fno-rtti -Wnon-virtual-dtor -c
../../../cache/%s.cpp -o ../../../cache/%s.o` |
38 » LINK = `../../experimental/webtry/safec++ -m64 -lstdc++ -lm -o
../../../inout/%s -Wl,--start-group ../../../cache/%s.o obj/experimental/webtry
/webtry.main.o obj/gyp/libflags.a libskia_images.a libskia_core.a libskia_effect
s.a obj/gyp/libjpeg.a obj/gyp/libwebp_dec.a obj/gyp/libwebp_demux.a obj/gyp/libw
ebp_dsp.a obj/gyp/libwebp_enc.a obj/gyp/libwebp_utils.a libskia_utils.a libskia_
opts.a libskia_opts_ssse3.a libskia_ports.a libskia_sfnt.a -Wl,--end-group -lpng
-lz -lgif -lpthread -lfontconfig -ldl -lfreetype` | 38 » LINK = `../../experimental/webtry/safec++ -m64 -lstdc++ -lm -o
../../../inout/%s -Wl,--start-group ../../../cache/%s.o obj/experimental/webtry
/webtry.main.o obj/gyp/libflags.a libskia_images.a libskia_core.a libskia_effect
s.a obj/gyp/libjpeg.a obj/gyp/libetc1.a obj/gyp/libwebp_dec.a obj/gyp/libwebp_de
mux.a obj/gyp/libwebp_dsp.a obj/gyp/libwebp_enc.a obj/gyp/libwebp_utils.a libski
a_utils.a libskia_opts.a libskia_opts_ssse3.a libskia_ports.a libskia_sfnt.a -Wl
,--end-group -lpng -lz -lgif -lpthread -lfontconfig -ldl -lfreetype` |
| 39 |
39 DEFAULT_SAMPLE = `void draw(SkCanvas* canvas) { | 40 DEFAULT_SAMPLE = `void draw(SkCanvas* canvas) { |
40 SkPaint p; | 41 SkPaint p; |
41 p.setColor(SK_ColorRED); | 42 p.setColor(SK_ColorRED); |
42 p.setAntiAlias(true); | 43 p.setAntiAlias(true); |
43 p.setStyle(SkPaint::kStroke_Style); | 44 p.setStyle(SkPaint::kStroke_Style); |
44 p.setStrokeWidth(10); | 45 p.setStrokeWidth(10); |
45 | 46 |
46 canvas->drawLine(20, 20, 100, 100, p); | 47 canvas->drawLine(20, 20, 100, 100, p); |
47 }` | 48 }` |
48 // Don't increase above 2^16 w/o altering the db tables to accept someth
ing bigger than TEXT. | 49 // Don't increase above 2^16 w/o altering the db tables to accept someth
ing bigger than TEXT. |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 http.HandleFunc("/sources/", autogzip.HandleFunc(sourcesHandler)) | 849 http.HandleFunc("/sources/", autogzip.HandleFunc(sourcesHandler)) |
849 | 850 |
850 // Resources are served directly | 851 // Resources are served directly |
851 // TODO add support for caching/etags/gzip | 852 // TODO add support for caching/etags/gzip |
852 http.Handle("/res/", autogzip.Handle(http.FileServer(http.Dir("./")))) | 853 http.Handle("/res/", autogzip.Handle(http.FileServer(http.Dir("./")))) |
853 | 854 |
854 // TODO Break out /c/ as it's own handler. | 855 // TODO Break out /c/ as it's own handler. |
855 http.HandleFunc("/", autogzip.HandleFunc(mainHandler)) | 856 http.HandleFunc("/", autogzip.HandleFunc(mainHandler)) |
856 log.Fatal(http.ListenAndServe(*port, nil)) | 857 log.Fatal(http.ListenAndServe(*port, nil)) |
857 } | 858 } |
OLD | NEW |