diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-23 15:37:57 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-23 15:37:57 +0100 |
commit | b8ff3917810332ac60de1294331dfe28d2d872e2 (patch) | |
tree | 29057cdf312874cdcc5ddcdaafe866bf77b7d5a8 | |
parent | dd7fd6f8760f14081648860715fb320cbc3bb7dd (diff) | |
parent | a038352dc05a880eec6b94b5ba4e01673b1565ca (diff) | |
download | qtwebkit-b8ff3917810332ac60de1294331dfe28d2d872e2.tar.gz |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I31a326945d624b10d5c87703d0e2b8ac723a05ab
-rw-r--r-- | Source/JavaScriptCore/LLIntOffsetsExtractor.pro | 1 | ||||
-rw-r--r-- | Source/WTF/wtf/Platform.h | 5 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp | 65 | ||||
-rw-r--r-- | Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp | 12 | ||||
-rw-r--r-- | Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp | 6 | ||||
-rw-r--r-- | Source/WebKit/qt/WidgetApi/qwebview.cpp | 6 | ||||
-rw-r--r-- | Tools/qmake/mkspecs/features/configure.prf | 3 |
7 files changed, 66 insertions, 32 deletions
diff --git a/Source/JavaScriptCore/LLIntOffsetsExtractor.pro b/Source/JavaScriptCore/LLIntOffsetsExtractor.pro index 37d6f1962..5a66d1ff3 100644 --- a/Source/JavaScriptCore/LLIntOffsetsExtractor.pro +++ b/Source/JavaScriptCore/LLIntOffsetsExtractor.pro @@ -18,7 +18,6 @@ debug_and_release { INCLUDEPATH += $$QT.core.includes CONFIG += console CONFIG -= qt -LIBS = defineTest(addIncludePaths) { # Just needed for include paths diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index 3a9b509f2..cddc21076 100644 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -771,6 +771,11 @@ #define ENABLE_LLINT 0 #endif +/* LLINT on ARM depends on an FPU */ +#if !defined(ENABLE_LLINT) && CPU(ARM) && !CPU(ARM_HARDFP) +#define ENABLE_LLINT 0 +#endif + /* On some of the platforms where we have a JIT, we want to also have the low-level interpreter. */ #if !defined(ENABLE_LLINT) \ diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp index 3f64c4b8a..f4b9a7e98 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp @@ -127,6 +127,7 @@ static const char* vertexTemplate = uniform mat4 u_textureSpaceMatrix; varying vec2 v_texCoord; + varying vec2 v_transformedTexCoord; varying float v_antialias; void noop(inout vec2 dummyParameter) { } @@ -172,9 +173,9 @@ static const char* vertexTemplate = vec2 position = a_vertex.xy; applyAntialiasingIfNeeded(position); - // The texture position needs to be clamped to 0..1 before the texture matrix is applied. + v_texCoord = position; vec4 clampedPosition = clamp(vec4(position, 0., 1.), 0., 1.); - v_texCoord = (u_textureSpaceMatrix * clampedPosition).xy; + v_transformedTexCoord = (u_textureSpaceMatrix * clampedPosition).xy; gl_Position = u_projectionMatrix * u_modelViewMatrix * vec4(position, 0., 1.); } ); @@ -188,6 +189,13 @@ static const char* vertexTemplate = GLSL_DIRECTIVE(define SamplerFunction texture2D) \ GLSL_DIRECTIVE(endif) +#define ANTIALIASING_TEX_COORD_DIRECTIVE \ + GLSL_DIRECTIVE(if defined(ENABLE_Antialiasing) && defined(ENABLE_Texture)) \ + GLSL_DIRECTIVE(define transformTexCoord fragmentTransformTexCoord) \ + GLSL_DIRECTIVE(else) \ + GLSL_DIRECTIVE(define transformTexCoord vertexTransformTexCoord) \ + GLSL_DIRECTIVE(endif) + #define ENABLE_APPLIER(Name) "#define ENABLE_"#Name"\n#define apply"#Name"IfNeeded apply"#Name"\n" #define DISABLE_APPLIER(Name) "#define apply"#Name"IfNeeded noop\n" #define BLUR_CONSTANTS \ @@ -197,6 +205,7 @@ static const char* vertexTemplate = static const char* fragmentTemplate = RECT_TEXTURE_DIRECTIVE + ANTIALIASING_TEX_COORD_DIRECTIVE BLUR_CONSTANTS STRINGIFY( precision mediump float; @@ -205,17 +214,28 @@ static const char* fragmentTemplate = uniform float u_opacity; varying float v_antialias; varying vec2 v_texCoord; + varying vec2 v_transformedTexCoord; uniform float u_filterAmount; uniform vec2 u_blurRadius; uniform vec2 u_shadowOffset; uniform vec4 u_color; uniform float u_gaussianKernel[GAUSSIAN_KERNEL_HALF_WIDTH]; + uniform mat4 u_textureSpaceMatrix; void noop(inout vec4 dummyParameter) { } + void noop(inout vec4 dummyParameter, vec2 texCoord) { } + + float antialias() { return smoothstep(0., 1., v_antialias); } + + vec2 fragmentTransformTexCoord() + { + vec4 clampedPosition = clamp(vec4(v_texCoord, 0., 1.), 0., 1.); + return (u_textureSpaceMatrix * clampedPosition).xy; + } - float antialias() { return smoothstep(v_antialias, 0., 1.); } + vec2 vertexTransformTexCoord() { return v_transformedTexCoord; } - void applyTexture(inout vec4 color) { color = SamplerFunction(s_sampler, v_texCoord); } + void applyTexture(inout vec4 color, vec2 texCoord) { color = SamplerFunction(s_sampler, texCoord); } void applyOpacity(inout vec4 color) { color *= u_opacity; } void applyAntialiasing(inout vec4 color) { color *= antialias(); } @@ -278,35 +298,35 @@ static const char* fragmentTemplate = color = vec4(color.r, color.g, color.b, color.a * u_filterAmount); } - vec4 sampleColorAtRadius(float radius) + vec4 sampleColorAtRadius(float radius, vec2 texCoord) { - vec2 coord = v_texCoord + radius * u_blurRadius; + vec2 coord = texCoord + radius * u_blurRadius; return SamplerFunction(s_sampler, coord) * float(coord.x > 0. && coord.y > 0. && coord.x < 1. && coord.y < 1.); } - float sampleAlphaAtRadius(float radius) + float sampleAlphaAtRadius(float radius, vec2 texCoord) { - vec2 coord = v_texCoord - u_shadowOffset + radius * u_blurRadius; + vec2 coord = texCoord - u_shadowOffset + radius * u_blurRadius; return SamplerFunction(s_sampler, coord).a * float(coord.x > 0. && coord.y > 0. && coord.x < 1. && coord.y < 1.); } - void applyBlurFilter(inout vec4 color) + void applyBlurFilter(inout vec4 color, vec2 texCoord) { - vec4 total = sampleColorAtRadius(0.) * u_gaussianKernel[0]; + vec4 total = sampleColorAtRadius(0., texCoord) * u_gaussianKernel[0]; for (int i = 1; i < GAUSSIAN_KERNEL_HALF_WIDTH; i++) { - total += sampleColorAtRadius(float(i) * GAUSSIAN_KERNEL_STEP) * u_gaussianKernel[i]; - total += sampleColorAtRadius(float(-1 * i) * GAUSSIAN_KERNEL_STEP) * u_gaussianKernel[i]; + total += sampleColorAtRadius(float(i) * GAUSSIAN_KERNEL_STEP, texCoord) * u_gaussianKernel[i]; + total += sampleColorAtRadius(float(-1 * i) * GAUSSIAN_KERNEL_STEP, texCoord) * u_gaussianKernel[i]; } color = total; } - void applyAlphaBlur(inout vec4 color) + void applyAlphaBlur(inout vec4 color, vec2 texCoord) { - float total = sampleAlphaAtRadius(0.) * u_gaussianKernel[0]; + float total = sampleAlphaAtRadius(0., texCoord) * u_gaussianKernel[0]; for (int i = 1; i < GAUSSIAN_KERNEL_HALF_WIDTH; i++) { - total += sampleAlphaAtRadius(float(i) * GAUSSIAN_KERNEL_STEP) * u_gaussianKernel[i]; - total += sampleAlphaAtRadius(float(-1 * i) * GAUSSIAN_KERNEL_STEP) * u_gaussianKernel[i]; + total += sampleAlphaAtRadius(float(i) * GAUSSIAN_KERNEL_STEP, texCoord) * u_gaussianKernel[i]; + total += sampleAlphaAtRadius(float(-1 * i) * GAUSSIAN_KERNEL_STEP, texCoord) * u_gaussianKernel[i]; } color *= total; @@ -314,9 +334,9 @@ static const char* fragmentTemplate = vec4 sourceOver(vec4 src, vec4 dst) { return src + dst * (1. - dst.a); } - void applyContentTexture(inout vec4 color) + void applyContentTexture(inout vec4 color, vec2 texCoord) { - vec4 contentColor = texture2D(s_contentTexture, v_texCoord); + vec4 contentColor = texture2D(s_contentTexture, texCoord); color = sourceOver(contentColor, color); } @@ -325,7 +345,8 @@ static const char* fragmentTemplate = void main(void) { vec4 color = vec4(1., 1., 1., 1.); - applyTextureIfNeeded(color); + vec2 texCoord = transformTexCoord(); + applyTextureIfNeeded(color, texCoord); applySolidColorIfNeeded(color); applyAntialiasingIfNeeded(color); applyOpacityIfNeeded(color); @@ -337,9 +358,9 @@ static const char* fragmentTemplate = applyBrightnessFilterIfNeeded(color); applyContrastFilterIfNeeded(color); applyOpacityFilterIfNeeded(color); - applyBlurFilterIfNeeded(color); - applyAlphaBlurIfNeeded(color); - applyContentTextureIfNeeded(color); + applyBlurFilterIfNeeded(color, texCoord); + applyAlphaBlurIfNeeded(color, texCoord); + applyContentTextureIfNeeded(color, texCoord); gl_FragColor = color; } ); diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp index 6f9cebce1..039c23218 100644 --- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp +++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp @@ -453,6 +453,11 @@ void QWebPageAdapter::adjustPointForClicking(QMouseEvent* ev) if (!topPadding && !rightPadding && !bottomPadding && !leftPadding) return; + FrameView* view = page->mainFrame()->view(); + ASSERT(view); + if (view->scrollbarAtPoint(ev->pos())) + return; + EventHandler* eventHandler = page->mainFrame()->eventHandler(); ASSERT(eventHandler); @@ -1468,7 +1473,12 @@ bool QWebPageAdapter::touchEvent(QTouchEvent* event) { #if ENABLE(TOUCH_EVENTS) Frame* frame = mainFrameAdapter()->frame; - if (!frame->view()) + if (!frame->view() || !frame->document()) + return false; + + // If the document doesn't have touch-event handles, we just ignore it + // and let QGuiApplication convert it to a mouse event. + if (!frame->document()->hasTouchEventHandlers()) return false; // Always accept the QTouchEvent so that we'll receive also TouchUpdate and TouchEnd events diff --git a/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp b/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp index 69138d73f..4aa6a5f8d 100644 --- a/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp +++ b/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp @@ -291,10 +291,8 @@ bool QGraphicsWebView::sceneEvent(QEvent* event) || event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchUpdate || event->type() == QEvent::TouchCancel)) { - d->page->event(event); - - // Always return true so that we'll receive also TouchUpdate and TouchEnd events - return true; + if (d->page->event(event)) + return true; } return QGraphicsWidget::sceneEvent(event); diff --git a/Source/WebKit/qt/WidgetApi/qwebview.cpp b/Source/WebKit/qt/WidgetApi/qwebview.cpp index 9ba962178..bcbf3dcc2 100644 --- a/Source/WebKit/qt/WidgetApi/qwebview.cpp +++ b/Source/WebKit/qt/WidgetApi/qwebview.cpp @@ -722,10 +722,8 @@ bool QWebView::event(QEvent *e) || e->type() == QEvent::TouchEnd || e->type() == QEvent::TouchUpdate || e->type() == QEvent::TouchCancel) { - d->page->event(e); - - // Always return true so that we'll receive also TouchUpdate and TouchEnd events - return true; + if (d->page->event(e)) + return true; } else if (e->type() == QEvent::Leave) d->page->event(e); } diff --git a/Tools/qmake/mkspecs/features/configure.prf b/Tools/qmake/mkspecs/features/configure.prf index 6b1a1d015..f0ceba512 100644 --- a/Tools/qmake/mkspecs/features/configure.prf +++ b/Tools/qmake/mkspecs/features/configure.prf @@ -116,6 +116,9 @@ defineTest(finalizeConfigure) { production_build:blackberry|qnx { addReasonForSkippingBuild("Build not supported on BB10/QNX yet.") } + !gnu_thin_archives:contains(QT_CONFIG, static) { + addReasonForSkippingBuild("QtWebKit cannot be built as a static library on this platform. Check your configuration in qtbase/config.summary.") + } requiredPrograms = gperf python perl bison ruby flex for(program, requiredPrograms): \ !programExistsInPath($$program): \ |