Skip to content

Commit 4b4c134

Browse files
committed
Readded SVG/CSS3 animations/compositing/gl-contexts, increased performance with llvm lto options, beginnings of the js api. Fixed deprecated GL functions in Cairo code, this.. this scares me that WebKit uses deprecated cairo/gl code. Consider moving to skia as its quite smaller foot print and doesnt require switching RGBA ARGB, etc.
1 parent e721b3e commit 4b4c134

31 files changed

+4911
-3150
lines changed

common.gypi

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
88
'emscripten_ld':'<!(echo $EMSCRIPTEN_ROOT)/emcc',
99
# see configuration Release and Debug below for specific optimizations
1010
# by release types.
11-
'emscripten_linktojs':'-s EXPORTED_FUNCTIONS="[\'_createWebKit\',\'_setHtml\',\'_setTransparent\',\'_scrollBy\',\'_resize\']" --embed-files ../src/assets/fontconfig/fonts@/usr/share/fonts --embed-files ../src/assets/fontconfig/config/fonts.conf@/etc/fonts/fonts.conf --embed-files ../src/assets/fontconfig/cache@/usr/local/var/cache/fontconfig -s TOTAL_MEMORY=50331648 -s LINKABLE=1 -s FULL_ES2=1 -s ASM_JS=0 --post-js ../src/webkit.api.js', # --memory-init-file 1 -s OUTLINING_LIMIT=5000 -s
11+
'emscripten_linktojs':'-s EXPORTED_FUNCTIONS="[\'_createWebKit\',\'_setHtml\',\'_setTransparent\',\'_scrollBy\',\'_resize\']" --embed-files ../src/assets/fontconfig/fonts@/usr/share/fonts --embed-files ../src/assets/fontconfig/config/fonts.conf@/etc/fonts/fonts.conf --embed-files ../src/assets/fontconfig/cache@/usr/local/var/cache/fontconfig -s TOTAL_MEMORY=50331648 -s FULL_ES2=1 -s ASM_JS=0 --post-js ../src/webkit.api.js -o webkit.js',
12+
# --memory-init-file 1, for some reason this causes a llvm trap on emscripten 1.13.0
13+
# -s NO_EXIT_RUNTIME=1, for some reason this causes a llvm trap on emscripten 1.13.0
14+
# -s OUTLINING_LIMIT=5000, outlining never worked, i'm unsure why, emscripten 1.13.0
15+
# -s LINKABLE=1, adding this removes the warning:unresolved symbols to odd emscripten_gl<func> but
1216
'cflags':'-Wno-warn-absolute-paths -fshort-wchar -isysroot <(emscripten_sysroot)',
1317
'cflags_cc':'-std=c++0x',
1418
'ldflags':'',
15-
'webcore_excludes':'(SSLHandle\\.cpp$|leveldb/|skia|glx/|cg/|ca/|avfoundation/|wince/|Modules/|soup/|ios/|nix/|plugin/|plugins/|blackberry/|WinCE|Gtk|storage/|win/|linux/|glib/|cocoa/|gtk/|cf/|mac/|efl/|appcache/|ExportFileGenerator\\.cpp$|CF\\.cpp$|IOS\\.|Mac\\.|Win\\.|XMLHttpRequest|ThemeSafari|PlugInElement|PlugInImageElement|JSAbstractView|InspectorWebBackend|AllInOne|OpenTypeUtilities|HarfBuzzFaceCoreText|graphics/FontPlatformData\\.cpp$|GraphicsContext3DOpenGL\\.cpp$|platform/sql/|ICU\\.cpp$|enchant/|ExportFileGenerator\\.cpp$|SmartReplaceICU\\.cpp$|HTMLObjectElement\\.cpp$|RenderEmbeddedObject\\.cpp$|Extensions3DOpenGL\\.cpp$|DragController\\.cpp$|JSDOMPlugin\\.cpp$|WebCoreDerived/JS|posix/|debug.cpp$|ANGLE/src/common/|_win.cpp$|BlobResourceHandle\\.cpp$|BlobRegistryImpl\\.cpp$|BlobRegistry\\.cpp$|GraphicsContext3DOpenGL\\.cpp$|svg/)', #InitializeParseContext|ossource_posix.cpp$|coordinated/
19+
'webcore_excludes':'(SSLHandle\\.cpp$|leveldb/|skia|glx/|cg/|ca/|avfoundation/|wince/|Modules/|soup/|ios/|nix/|plugin/|plugins/|blackberry/|WinCE|Gtk|storage/|win/|linux/|glib/|cocoa/|gtk/|cf/|mac/|efl/|appcache/|ExportFileGenerator\\.cpp$|CF\\.cpp$|IOS\\.|Mac\\.|Win\\.|XMLHttpRequest|ThemeSafari|PlugInElement|PlugInImageElement|JSAbstractView|InspectorWebBackend|AllInOne|OpenTypeUtilities|HarfBuzzFaceCoreText|graphics/FontPlatformData\\.cpp$|GraphicsContext3DOpenGL\\.cpp$|platform/sql/|ICU\\.cpp$|enchant/|ExportFileGenerator\\.cpp$|SmartReplaceICU\\.cpp$|HTMLObjectElement\\.cpp$|RenderEmbeddedObject\\.cpp$|Extensions3DOpenGL\\.cpp$|DragController\\.cpp$|JSDOMPlugin\\.cpp$|WebCoreDerived/JS|posix/|debug.cpp$|ANGLE/src/common/|_win.cpp$|BlobResourceHandle\\.cpp$|BlobRegistryImpl\\.cpp$|BlobRegistry\\.cpp$|GraphicsContext3DOpenGL\\.cpp$)',
20+
#svg/InitializeParseContext|ossource_posix.cpp$|coordinated/
1621
},
1722
'target_defaults': {
1823
'default_configuration': 'Release',
@@ -40,7 +45,7 @@
4045
# for some bizzare reason adding -g0 onto this causes the compiler to slow to a crawl and
4146
# take up gigabytes (13+) of memory. Don't do it.
4247
# Using ASM_JS=0 is necessary at the moment since browsers limit the amount of local vars.
43-
'jsflags+':['<(emscripten_linktojs) -O3 --llvm-opts 3'], # --proxy-to-worker
48+
'jsflags+':['<(emscripten_linktojs) -O3 --llvm-opts 3 --llvm-lto 3'], # -s INLINING_LIMIT=1 --proxy-to-worker
4449
},
4550
'Debug': {
4651
'defines+': ['DEBUG','TARGET_EMSCRIPTEN'],

deps/WebKit/Source/WebCore/DerivedSources.make

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2626
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2727
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-
include ../../build/features.make
28+
include ../../tools/features.make
2929

3030
VPATH = \
3131
$(WebCore) \

deps/WebKit/Source/WebCore/page/FrameView.cpp

+23-13
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ void FrameView::updateCompositingLayersAfterLayout()
870870
RenderView* renderView = this->renderView();
871871
if (!renderView)
872872
return;
873-
#if PLATFORM(JS)
873+
#if PLATFORM(JS) && defined(DEBUG)
874874
fprintf(stderr, "WebKit: FrameView::updateCompositingLayersAfterLayout() firing updateCompositingLayers.\n");
875875
#endif
876876
// This call will make sure the cached hasAcceleratedCompositing is updated from the pref
@@ -2509,7 +2509,7 @@ const unsigned cRepaintRectUnionThreshold = 25;
25092509

25102510
void FrameView::repaintContentRectangle(const IntRect& r, bool immediate)
25112511
{
2512-
#if PLATFORM(JS)
2512+
#if PLATFORM(JS) && defined(DEBUG)
25132513
webkitTrace();
25142514
fprintf(stderr, "WebKit: FrameView::repaintContentRectangle: rect: x: %i y: %i h: %i w: %i immediate: %i\n", r.x(), r.y(), r.height(), r.width(), immediate);
25152515
#endif
@@ -2537,33 +2537,33 @@ void FrameView::repaintContentRectangle(const IntRect& r, bool immediate)
25372537
else
25382538
m_repaintRects[0].unite(paintRect);
25392539
m_repaintCount++;
2540-
#if PLATFORM(JS)
2540+
#if PLATFORM(JS) && defined(DEBUG)
25412541
fprintf(stderr, "WebKit: FrameView::repaintContentRectangle: issuing repaint in: %f m_deferingRepaints is: %i\n", delay, m_deferringRepaints);
25422542
#endif
25432543
if (!m_deferringRepaints) {
2544-
#if PLATFORM(JS)
2544+
#if PLATFORM(JS) && defined(DEBUG)
25452545
fprintf(stderr, "WebKit: FrameView::repaintContentRectangle: issuing deferred paint in: %f\n", delay);
25462546
#endif
25472547
startDeferredRepaintTimer(delay);
25482548
}
25492549

25502550
return;
25512551
} else {
2552-
#if PLATFORM(JS)
2552+
#if PLATFORM(JS) && defined(DEBUG)
25532553
fprintf(stderr, "WebKit: FrameView::repaintContentRectangle: m_deferringRepaints=true || m_deferredRepaintTimer.isActive()=true || delay > 0\n");
25542554
#endif
25552555
}
25562556

25572557
if (!shouldUpdate(immediate)) {
2558-
#if PLATFORM(JS)
2558+
#if PLATFORM(JS) && defined(DEBUG)
25592559
fprintf(stderr, "WebKit: FrameView::repaintContentRectangle: shouldUpdate(immediate) returned false.\n");
25602560
#endif
25612561
return;
25622562
}
25632563
#if USE(TILED_BACKING_STORE)
25642564
if (frame().tiledBackingStore()) {
25652565
frame().tiledBackingStore()->invalidate(r);
2566-
#if PLATFORM(JS)
2566+
#if PLATFORM(JS) && defined(DEBUG)
25672567
fprintf(stderr, "WebKit: FrameView::repaintContentRectangle: Using a tiled backing store, leaving.\n");
25682568
#endif
25692569
return;
@@ -2755,21 +2755,21 @@ void FrameView::doDeferredRepaints()
27552755
if (!shouldUpdate()) {
27562756
m_repaintRects.clear();
27572757
m_repaintCount = 0;
2758-
#if PLATFORM(JS)
2758+
#if PLATFORM(JS) && defined(DEBUG)
27592759
fprintf(stderr, "WebKit: doDeferredRepaints: shouldUpdate was false, exiting\n");
27602760
#endif
27612761
return;
27622762
}
27632763
unsigned size = m_repaintRects.size();
2764-
#if PLATFORM(JS)
2764+
#if PLATFORM(JS) && defined(DEBUG)
27652765
fprintf(stderr, "WebKit: doDeferredRepaints: amount of repaint rects: %i\n",size);
27662766
#endif
27672767
for (unsigned i = 0; i < size; i++) {
27682768
#if USE(TILED_BACKING_STORE)
27692769
if (frame().tiledBackingStore()) {
2770-
#if PLATFORM(JS)
2770+
#if PLATFORM(JS) && defined(DEBUG)
27712771
fprintf(stderr, "WebKit: doDeferredRepaints: invalidating tiledBackingStore\n");
2772-
// fprintf(stderr, "WebKit: repaintRect size (x,y,w,h): %i %i %i %i\n", m_repaintRects[i].x(),m_repaintRects[i].y(),m_repaintRects[i].width(),m_repaintRects[i].height());
2772+
fprintf(stderr, "WebKit: repaintRect size (x,y,w,h): %i %i %i %i\n", m_repaintRects[i].x(),m_repaintRects[i].y(),m_repaintRects[i].width(),m_repaintRects[i].height());
27732773
#endif
27742774
frame().tiledBackingStore()->invalidate(pixelSnappedIntRect(m_repaintRects[i]));
27752775
continue;
@@ -2791,23 +2791,33 @@ bool FrameView::shouldUseLoadTimeDeferredRepaintDelay() const
27912791

27922792
// Don't defer after the initial load of the page has been completed.
27932793
if (frame().tree().top().loader().isComplete()) {
2794-
fprintf(stderr, "WebKit: Document has finished loading, do not use deferred repaint.\n");
2795-
return false;
2794+
#if PLATFORM(JS) && defined(DEBUG)
2795+
fprintf(stderr, "WebKit: Document has finished loading, do not use deferred repaint.\n");
2796+
#endif
2797+
return false;
27962798
}
27972799
Document* document = frame().document();
27982800
if (!document) {
2801+
#if PLATFORM(JS) && defined(DEBUG)
27992802
fprintf(stderr, "WebKit: Document does not exist, do not use deferred repaint.\n");
2803+
#endif
28002804
return false;
28012805
}
28022806
if (document->parsing()) {
2807+
#if PLATFORM(JS) && defined(DEBUG)
28032808
fprintf(stderr, "WebKit: Document is parsing, use deferred repaint.\n");
2809+
#endif
28042810
return true;
28052811
}
28062812
if (document->cachedResourceLoader()->requestCount()) {
2813+
#if PLATFORM(JS) && defined(DEBUG)
28072814
fprintf(stderr, "WebKit: Request Cache Count is > 0, use deferred repaint.\n");
2815+
#endif
28082816
return true;
28092817
}
2818+
#if PLATFORM(JS) && defined(DEBUG)
28102819
fprintf(stderr, "WebKit: default: use deferred repaint.\n");
2820+
#endif
28112821
return false;
28122822
}
28132823

deps/WebKit/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,21 @@ PassRefPtr<cairo_surface_t> createCairoGLSurface(const IntSize& size, uint32_t&
7676
// from a pre-existing surface.
7777
glGenTextures(1, &texture);
7878
glBindTexture(GL_TEXTURE_2D, texture);
79-
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
80-
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
79+
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
80+
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
8181
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
8282
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
8383

8484
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
8585

86-
glTexImage2D(GL_TEXTURE_2D, 0 /* level */, GL_RGBA8, size.width(), size.height(), 0 /* border */, GL_RGBA, GL_UNSIGNED_BYTE, 0);
86+
glTexImage2D(GL_TEXTURE_2D, 0 /* level */, GL_UNSIGNED_BYTE/* GL_RGBA8 */, size.width(), size.height(), 0 /* border */, GL_RGBA, GL_UNSIGNED_BYTE, 0);
8787

8888
GLContext* context = GLContext::sharingContext();
8989
cairo_device_t* device = context->cairoDevice();
90-
90+
#if !PLATFORM(JS)
9191
// Thread-awareness is a huge performance hit on non-Intel drivers.
92-
cairo_gl_device_set_thread_aware(device, FALSE);
93-
92+
cairo_gl_device_set_thread_aware(device, false);
93+
#endif
9494
return adoptRef(cairo_gl_surface_create_for_texture(device, CAIRO_CONTENT_COLOR_ALPHA, texture, size.width(), size.height()));
9595
}
9696
#endif

features.gypi

+13-13
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,31 @@
1212
'ENABLE_ORIENTATION_EVENTS=0',
1313
'ENABLE_PRINTING=0',
1414
'ENABLE_NAVIGATOR_CONTENT_UTILS=0',
15-
'ENABLE_3D_RENDERING=0',
16-
'ENABLE_ACCELERATED_2D_CANVAS=0',
17-
'ENABLE_ACCELERATED_OVERFLOW_SCROLLING=0',
15+
'ENABLE_3D_RENDERING=1',
16+
'ENABLE_ACCELERATED_2D_CANVAS=1',
17+
'ENABLE_ACCELERATED_OVERFLOW_SCROLLING=1',
1818
'ENABLE_BLOB=0',
1919
'ENABLE_CACHE_PARTITIONING=0',
2020
'ENABLE_CANVAS_PATH=1',
2121
'ENABLE_CANVAS_PROXY=0',
2222
'ENABLE_CHANNEL_MESSAGING=1',
2323
'ENABLE_CSP_NEXT=0',
2424
'ENABLE_CSS_BOX_DECORATION_BREAK=1',
25-
'ENABLE_CSS_COMPOSITING=0',
25+
'ENABLE_CSS_COMPOSITING=1',
2626
'ENABLE_CSS_DEVICE_ADAPTATION=0',
27-
'ENABLE_CSS_EXCLUSIONS=0',
27+
'ENABLE_CSS_EXCLUSIONS=1',
2828
'ENABLE_CSS_FILTERS=1',
2929
'ENABLE_CSS_IMAGE_ORIENTATION=0',
30-
'ENABLE_CSS_IMAGE_RESOLUTION=0',
30+
'ENABLE_CSS_IMAGE_RESOLUTION=1',
3131
'ENABLE_CSS_REGIONS=1',
3232
'ENABLE_CSS_SHADERS=1',
3333
'ENABLE_CSS_SHAPES=1',
3434
'ENABLE_CSS_STICKY_POSITION=1',
3535
'ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED=1',
36-
'ENABLE_CSS3_CONDITIONAL_RULES=0',
37-
'ENABLE_CSS3_TEXT=0',
36+
'ENABLE_CSS3_CONDITIONAL_RULES=0', # Note, upstream code is not finished, does not compile.
37+
'ENABLE_CSS3_TEXT=1',
3838
'ENABLE_CSS3_TEXT_DECORATION=1',
39-
'ENABLE_CSS3_TEXT_LINE_BREAK=0',
39+
'ENABLE_CSS3_TEXT_LINE_BREAK=1',
4040
'ENABLE_CURSOR_VISIBILITY=1',
4141
'ENABLE_CUSTOM_SCHEME_HANDLER=0',
4242
'ENABLE_DASHBOARD_SUPPORT=0',
@@ -103,10 +103,10 @@
103103
'ENABLE_SHARED_WORKERS=0',
104104
'ENABLE_SPEECH_SYNTHESIS=0',
105105
'ENABLE_SQL_DATABASE=0',
106-
'ENABLE_SUBPIXEL_LAYOUT=0',
106+
'ENABLE_SUBPIXEL_LAYOUT=1',
107107
'ENABLE_SUBTLE_CRYPTO=0',
108-
'ENABLE_SVG=0', #temporary
109-
'ENABLE_SVG_FONTS=0',#temporary
108+
'ENABLE_SVG=1', #temporary
109+
'ENABLE_SVG_FONTS=1',#temporary
110110
'ENABLE_TEMPLATE_ELEMENT=1',
111111
'ENABLE_TEXT_AUTOSIZING=0',
112112
'ENABLE_THREADED_HTML_PARSER=0',
@@ -117,7 +117,7 @@
117117
'ENABLE_VIDEO_TRACK=0',
118118
'ENABLE_VIEW_MODE_CSS_MEDIA=0',
119119
'ENABLE_WEBGL=1',
120-
'ENABLE_WEB_ANIMATIONS=0',
120+
'ENABLE_WEB_ANIMATIONS=1',
121121
'ENABLE_WEB_AUDIO=0',
122122
'ENABLE_WEB_SOCKETS=0',
123123
'ENABLE_WEB_TIMING=0',

0 commit comments

Comments
 (0)