Commit 5a9aa333 authored by Alberto Garcia's avatar Alberto Garcia
Browse files

New upstream version 2.14.0

parent 87d312db
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">WebKit2GTK+ Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKit2GTK+ 2.13.92</p></div>
<div><p class="releaseinfo">for WebKit2GTK+ 2.14.0</p></div>
</div>
<hr>
</div>
......
......@@ -168,7 +168,7 @@ against at application run time.</p>
<hr>
<div class="refsect2">
<a name="WEBKIT-MINOR-VERSION:CAPS"></a><h3>WEBKIT_MINOR_VERSION</h3>
<pre class="programlisting">#define WEBKIT_MINOR_VERSION (13)
<pre class="programlisting">#define WEBKIT_MINOR_VERSION (14)
</pre>
<p>Like <a class="link" href="webkit2gtk-4.0-WebKitVersion.html#webkit-get-minor-version" title="webkit_get_minor_version ()"><code class="function">webkit_get_minor_version()</code></a>, but from the headers used at
application compile time, rather than from the library linked
......@@ -177,7 +177,7 @@ against at application run time.</p>
<hr>
<div class="refsect2">
<a name="WEBKIT-MICRO-VERSION:CAPS"></a><h3>WEBKIT_MICRO_VERSION</h3>
<pre class="programlisting">#define WEBKIT_MICRO_VERSION (92)
<pre class="programlisting">#define WEBKIT_MICRO_VERSION (0)
</pre>
<p>Like <a class="link" href="webkit2gtk-4.0-WebKitVersion.html#webkit-get-micro-version" title="webkit_get_micro_version ()"><code class="function">webkit_get_micro_version()</code></a>, but from the headers used at
application compile time, rather than from the library linked
......
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">WebKitDOMGTK+ Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKitDOMGTK+ 2.13.92</p></div>
<div><p class="releaseinfo">for WebKitDOMGTK+ 2.14.0</p></div>
</div>
<hr>
</div>
......
==================
WebKitGTK+ 2.14.0
==================
What's new in WebKitGTK+ 2.14.0?
- Use gdk_cairo_draw_from_gl() when possible in Wayland to render directly using the GPU in the UI process.
- Ensure we don't send an empty referrer header after session restore.
- Fix a web process crash in pages using filter animations.
- Fix main frame scrolling jumps when scrolling acclerated subframes.
- Fix the size of the cairo surface created in the UI process on Wayland.
- Fix memory leak in JavaScriptCore.
- Fix the build when '.' is not in @INC by default in perl.
- Translation updates: Ukrainian.
==================
WebKitGTK+ 2.13.92
==================
......
......@@ -203,6 +203,8 @@ MarkedSpace::~MarkedSpace()
[&] (MarkedBlock::Handle* block) {
freeBlock(block);
});
for (LargeAllocation* allocation : m_largeAllocations)
allocation->destroy();
ASSERT(!m_blocks.set().size());
}
......
......@@ -560,6 +560,19 @@ bool GraphicsLayerTextureMapper::shouldHaveBackingStore() const
return drawsContent() && contentsAreVisible() && !m_size.isEmpty();
}
bool GraphicsLayerTextureMapper::filtersCanBeComposited(const FilterOperations& filters) const
{
if (!filters.size())
return false;
for (const auto& filterOperation : filters.operations()) {
if (filterOperation->type() == FilterOperation::REFERENCE)
return false;
}
return true;
}
bool GraphicsLayerTextureMapper::addAnimation(const KeyframeValueList& valueList, const FloatSize& boxSize, const Animation* anim, const String& keyframesName, double timeOffset)
{
ASSERT(!keyframesName.isEmpty());
......@@ -567,6 +580,16 @@ bool GraphicsLayerTextureMapper::addAnimation(const KeyframeValueList& valueList
if (!anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2 || (valueList.property() != AnimatedPropertyTransform && valueList.property() != AnimatedPropertyOpacity))
return false;
if (valueList.property() == AnimatedPropertyFilter) {
int listIndex = validateFilterOperations(valueList);
if (listIndex < 0)
return false;
const auto& filters = static_cast<const FilterAnimationValue&>(valueList.at(listIndex)).value();
if (!filtersCanBeComposited(filters))
return false;
}
bool listsMatch = false;
bool hasBigRotation;
......@@ -604,11 +627,23 @@ void GraphicsLayerTextureMapper::removeAnimation(const String& animationName)
bool GraphicsLayerTextureMapper::setFilters(const FilterOperations& filters)
{
TextureMapper* textureMapper = m_layer.textureMapper();
if (!textureMapper)
if (!m_layer.textureMapper())
return false;
notifyChange(FilterChange);
return GraphicsLayer::setFilters(filters);
bool canCompositeFilters = filtersCanBeComposited(filters);
if (GraphicsLayer::filters() == filters)
return canCompositeFilters;
if (canCompositeFilters) {
if (!GraphicsLayer::setFilters(filters))
return false;
notifyChange(FilterChange);
} else if (GraphicsLayer::filters().size()) {
clearFilters();
notifyChange(FilterChange);
}
return canCompositeFilters;
}
void GraphicsLayerTextureMapper::setFixedToViewport(bool fixed)
......
......@@ -117,6 +117,8 @@ private:
void prepareBackingStoreIfNeeded();
bool shouldHaveBackingStore() const;
bool filtersCanBeComposited(const FilterOperations&) const;
// This set of flags help us defer which properties of the layer have been
// modified by the compositor, so we can know what to look for in the next flush.
enum ChangeMask {
......
......@@ -426,18 +426,37 @@ void CoordinatedGraphicsLayer::setContentsToPlatformLayer(PlatformLayer* platfor
#endif
}
bool CoordinatedGraphicsLayer::setFilters(const FilterOperations& newFilters)
bool CoordinatedGraphicsLayer::filtersCanBeComposited(const FilterOperations& filters) const
{
if (filters() == newFilters)
return true;
if (!GraphicsLayer::setFilters(newFilters))
if (!filters.size())
return false;
didChangeFilters();
for (const auto& filterOperation : filters.operations()) {
if (filterOperation->type() == FilterOperation::REFERENCE)
return false;
}
return true;
}
bool CoordinatedGraphicsLayer::setFilters(const FilterOperations& newFilters)
{
bool canCompositeFilters = filtersCanBeComposited(newFilters);
if (filters() == newFilters)
return canCompositeFilters;
if (canCompositeFilters) {
if (!GraphicsLayer::setFilters(newFilters))
return false;
didChangeFilters();
} else if (filters().size()) {
clearFilters();
didChangeFilters();
}
return canCompositeFilters;
}
void CoordinatedGraphicsLayer::setContentsToSolidColor(const Color& color)
{
if (m_layerState.solidColor == color)
......@@ -1163,6 +1182,16 @@ bool CoordinatedGraphicsLayer::addAnimation(const KeyframeValueList& valueList,
if (!anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2 || (valueList.property() != AnimatedPropertyTransform && valueList.property() != AnimatedPropertyOpacity && valueList.property() != AnimatedPropertyFilter))
return false;
if (valueList.property() == AnimatedPropertyFilter) {
int listIndex = validateFilterOperations(valueList);
if (listIndex < 0)
return false;
const auto& filters = static_cast<const FilterAnimationValue&>(valueList.at(listIndex)).value();
if (!filtersCanBeComposited(filters))
return false;
}
bool listsMatch = false;
bool ignoredHasBigRotation;
......
......@@ -207,6 +207,8 @@ private:
void animationStartedTimerFired();
bool filtersCanBeComposited(const FilterOperations&) const;
CoordinatedLayerID m_id;
CoordinatedGraphicsLayerState m_layerState;
GraphicsLayerTransform m_layerTransform;
......
This diff is collapsed.
......@@ -42,15 +42,16 @@ using namespace WebCore;
namespace WebKit {
Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, uint64_t nativeSurfaceHandle, ShouldDoFrameSync doFrameSync)
Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, uint64_t nativeSurfaceHandle, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
{
return adoptRef(*new ThreadedCompositor(client, nativeSurfaceHandle, doFrameSync));
return adoptRef(*new ThreadedCompositor(client, nativeSurfaceHandle, doFrameSync, paintFlags));
}
ThreadedCompositor::ThreadedCompositor(Client& client, uint64_t nativeSurfaceHandle, ShouldDoFrameSync doFrameSync)
ThreadedCompositor::ThreadedCompositor(Client& client, uint64_t nativeSurfaceHandle, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
: m_client(client)
, m_nativeSurfaceHandle(nativeSurfaceHandle)
, m_doFrameSync(doFrameSync)
, m_paintFlags(paintFlags)
, m_compositingRunLoop(std::make_unique<CompositingRunLoop>([this] { renderLayerTree(); }))
{
m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] {
......@@ -196,7 +197,8 @@ void ThreadedCompositor::renderLayerTree()
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
}
m_scene->paintToCurrentGLContext(viewportTransform, 1, clipRect, Color::transparent, !m_drawsBackground, m_scrollPosition);
m_scene->paintToCurrentGLContext(viewportTransform, 1, clipRect, Color::transparent, !m_drawsBackground, m_scrollPosition, m_paintFlags);
m_context->swapBuffers();
}
......
......@@ -32,6 +32,7 @@
#include "CoordinatedGraphicsScene.h"
#include <WebCore/GLContext.h>
#include <WebCore/IntSize.h>
#include <WebCore/TextureMapper.h>
#include <wtf/FastMalloc.h>
#include <wtf/Noncopyable.h>
#include <wtf/ThreadSafeRefCounted.h>
......@@ -57,7 +58,7 @@ public:
enum class ShouldDoFrameSync { No, Yes };
static Ref<ThreadedCompositor> create(Client&, uint64_t nativeSurfaceHandle = 0, ShouldDoFrameSync = ShouldDoFrameSync::Yes);
static Ref<ThreadedCompositor> create(Client&, uint64_t nativeSurfaceHandle = 0, ShouldDoFrameSync = ShouldDoFrameSync::Yes, WebCore::TextureMapper::PaintFlags = 0);
virtual ~ThreadedCompositor();
void setNativeSurfaceHandleForCompositing(uint64_t);
......@@ -73,7 +74,7 @@ public:
void forceRepaint();
private:
ThreadedCompositor(Client&, uint64_t nativeSurfaceHandle, ShouldDoFrameSync);
ThreadedCompositor(Client&, uint64_t nativeSurfaceHandle, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags);
// CoordinatedGraphicsSceneClient
void renderNextFrame() override;
......@@ -95,6 +96,7 @@ private:
bool m_drawsBackground { true };
uint64_t m_nativeSurfaceHandle;
ShouldDoFrameSync m_doFrameSync;
WebCore::TextureMapper::PaintFlags m_paintFlags { 0 };
bool m_needsResize { false };
std::unique_ptr<CompositingRunLoop> m_compositingRunLoop;
......
......@@ -204,10 +204,19 @@ static gboolean webkitAuthenticationDialogDraw(GtkWidget* widget, cairo_t* cr)
{
WebKitAuthenticationDialogPrivate* priv = WEBKIT_AUTHENTICATION_DIALOG(widget)->priv;
gtk_style_context_save(priv->styleContext.get());
gtk_style_context_add_class(priv->styleContext.get(), GTK_STYLE_CLASS_BACKGROUND);
gtk_render_background(priv->styleContext.get(), cr, 0, 0, gtk_widget_get_allocated_width(widget), gtk_widget_get_allocated_height(widget));
gtk_style_context_restore(priv->styleContext.get());
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
cairo_set_source_rgba(cr, 0, 0, 0, 0.5);
cairo_paint(cr);
if (GtkWidget* child = gtk_bin_get_child(GTK_BIN(widget))) {
GtkAllocation allocation;
gtk_widget_get_allocation(child, &allocation);
gtk_style_context_save(priv->styleContext.get());
gtk_style_context_add_class(priv->styleContext.get(), GTK_STYLE_CLASS_BACKGROUND);
gtk_render_background(priv->styleContext.get(), cr, allocation.x, allocation.y, allocation.width, allocation.height);
gtk_style_context_restore(priv->styleContext.get());
}
GTK_WIDGET_CLASS(webkit_authentication_dialog_parent_class)->draw(widget, cr);
......@@ -222,6 +231,27 @@ static void webkitAuthenticationDialogMap(GtkWidget* widget)
GTK_WIDGET_CLASS(webkit_authentication_dialog_parent_class)->map(widget);
}
static void webkitAuthenticationDialogSizeAllocate(GtkWidget* widget, GtkAllocation* allocation)
{
GTK_WIDGET_CLASS(webkit_authentication_dialog_parent_class)->size_allocate(widget, allocation);
GtkWidget* child = gtk_bin_get_child(GTK_BIN(widget));
if (!child)
return;
GtkRequisition naturalSize;
gtk_widget_get_preferred_size(child, 0, &naturalSize);
GtkAllocation childAllocation;
gtk_widget_get_allocation(child, &childAllocation);
childAllocation.x += (allocation->width - naturalSize.width) / 2;
childAllocation.y += (allocation->height - naturalSize.height) / 2;
childAllocation.width = naturalSize.width;
childAllocation.height = naturalSize.height;
gtk_widget_size_allocate(child, &childAllocation);
}
static void webkitAuthenticationDialogConstructed(GObject* object)
{
G_OBJECT_CLASS(webkit_authentication_dialog_parent_class)->constructed(object);
......@@ -254,6 +284,7 @@ static void webkit_authentication_dialog_class_init(WebKitAuthenticationDialogCl
GtkWidgetClass* widgetClass = GTK_WIDGET_CLASS(klass);
widgetClass->draw = webkitAuthenticationDialogDraw;
widgetClass->map = webkitAuthenticationDialogMap;
widgetClass->size_allocate = webkitAuthenticationDialogSizeAllocate;
}
GtkWidget* webkitAuthenticationDialogNew(WebKitAuthenticationRequest* request, CredentialStorageMode mode)
......
......@@ -542,12 +542,6 @@ static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr)
drawingArea->paint(cr, clipRect, unpaintedRegion);
}
if (webViewBase->priv->authenticationDialog) {
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
cairo_set_source_rgba(cr, 0, 0, 0, 0.5);
cairo_paint(cr);
}
GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->draw(widget, cr);
return FALSE;
......@@ -602,15 +596,10 @@ static void webkitWebViewBaseSizeAllocate(GtkWidget* widget, GtkAllocation* allo
// never overlaps the web inspector. Thus, we need to calculate the allocation here
// after calculating the inspector allocation.
if (priv->authenticationDialog) {
GtkRequisition naturalSize;
gtk_widget_get_preferred_size(priv->authenticationDialog, 0, &naturalSize);
GtkAllocation childAllocation = {
(viewRect.width() - naturalSize.width) / 2,
(viewRect.height() - naturalSize.height) / 2,
naturalSize.width,
naturalSize.height
};
GtkRequisition minimumSize;
gtk_widget_get_preferred_size(priv->authenticationDialog, &minimumSize, nullptr);
GtkAllocation childAllocation = { 0, 0, std::max(minimumSize.width, viewRect.width()), std::max(minimumSize.height, viewRect.height()) };
gtk_widget_size_allocate(priv->authenticationDialog, &childAllocation);
}
......
......@@ -293,7 +293,10 @@ static inline void decodeFrameState(GVariant* frameStateVariant, FrameState& fra
&scrollPositionX, &scrollPositionY, &pageScaleFactor, &httpBodyVariant, &childrenIter.outPtr());
frameState.urlString = String::fromUTF8(urlString);
frameState.originalURLString = String::fromUTF8(originalURLString);
frameState.referrer = String::fromUTF8(referrer);
// frameState.referrer must not be an empty string since we never want to
// send an empty Referer header. Bug #159606.
if (strlen(referrer))
frameState.referrer = String::fromUTF8(referrer);
frameState.target = String::fromUTF8(target);
if (gsize documentStateLength = g_variant_iter_n_children(documentStateIter.get())) {
frameState.documentState.reserveInitialCapacity(documentStateLength);
......
......@@ -71,17 +71,13 @@ bool AcceleratedBackingStoreWayland::paint(cairo_t* cr, const IntRect& clipRect)
cairo_save(cr);
AcceleratedBackingStore::paint(cr, clipRect);
#if 0
// FIXME: Use this when GTK+ >= 3.16. GTK+ expects the Y axis to be inverted to what we get, so we need to flip it somehow.
gdk_cairo_draw_from_gl(cr, gtk_widget_get_window(m_webPage.viewWidget()), texture, GL_TEXTURE, 1, clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height());
#if GTK_CHECK_VERSION(3, 16, 0)
gdk_cairo_draw_from_gl(cr, gtk_widget_get_window(m_webPage.viewWidget()), texture, GL_TEXTURE, m_webPage.deviceScaleFactor(), 0, 0, textureSize.width(), textureSize.height());
#else
IntSize size = textureSize;
float deviceScaleFactor = m_webPage.deviceScaleFactor();
size.scale(deviceScaleFactor);
if (!m_surface || cairo_image_surface_get_width(m_surface.get()) != textureSize.width() || cairo_image_surface_get_height(m_surface.get()) != textureSize.height())
m_surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, textureSize.width(), textureSize.height()));
if (!m_surface || cairo_image_surface_get_width(m_surface.get()) != size.width() || cairo_image_surface_get_height(m_surface.get()) != size.height())
m_surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.width(), size.height()));
cairoSurfaceSetDeviceScale(m_surface.get(), deviceScaleFactor, deviceScaleFactor);
cairoSurfaceSetDeviceScale(m_surface.get(), m_webPage.deviceScaleFactor(), m_webPage.deviceScaleFactor());
GLuint fb;
glGenFramebuffers(1, &fb);
......@@ -103,7 +99,7 @@ bool AcceleratedBackingStoreWayland::paint(cairo_t* cr, const IntRect& clipRect)
}
// Convert to BGRA.
int totalBytes = size.width() * size.height() * 4;
int totalBytes = textureSize.width() * textureSize.height() * 4;
for (int i = 0; i < totalBytes; i += 4)
std::swap(data[i], data[i + 2]);
#else
......@@ -118,6 +114,12 @@ bool AcceleratedBackingStoreWayland::paint(cairo_t* cr, const IntRect& clipRect)
// The surface can be modified by the web process at any time, so we mark it
// as dirty to ensure we always render the updated contents as soon as possible.
cairo_surface_mark_dirty(m_surface.get());
// The compositor renders the texture flipped for gdk_cairo_draw_from_gl, fix that here.
cairo_matrix_t transform;
cairo_matrix_init(&transform, 1, 0, 0, -1, 0, textureSize.height() / deviceScaleFactor);
cairo_transform(cr, &transform);
cairo_rectangle(cr, clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height());
cairo_set_source_surface(cr, m_surface.get(), 0, 0);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
......
......@@ -55,10 +55,15 @@ ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost(WebPage& webP
, m_surface(AcceleratedSurface::create(webPage))
{
if (m_surface) {
TextureMapper::PaintFlags paintFlags = 0;
if (m_surface->shouldPaintMirrored())
paintFlags |= TextureMapper::PaintingMirrored;
// Do not do frame sync when rendering offscreen in the web process to ensure that SwapBuffers never blocks.
// Rendering to the actual screen will happen later anyway since the UI process schedules a redraw for every update,
// the compositor will take care of syncing to vblank.
m_compositor = ThreadedCompositor::create(m_compositorClient, m_surface->window(), ThreadedCompositor::ShouldDoFrameSync::No);
m_compositor = ThreadedCompositor::create(m_compositorClient, m_surface->window(), ThreadedCompositor::ShouldDoFrameSync::No, paintFlags);
m_layerTreeContext.contextID = m_surface->surfaceID();
} else
m_compositor = ThreadedCompositor::create(m_compositorClient);
......@@ -79,6 +84,10 @@ void ThreadedCoordinatedLayerTreeHost::forceRepaint()
void ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents(const IntRect& rect)
{
FrameView* frameView = m_webPage.mainFrameView();
if (!frameView || !frameView->delegatesScrolling())
return;
m_viewportController.didScroll(rect.location());
didChangeViewport();
}
......
......@@ -41,6 +41,7 @@ public:
virtual uint64_t window() const { ASSERT_NOT_REACHED(); return 0; }
virtual uint64_t surfaceID() const { ASSERT_NOT_REACHED(); return 0; };
virtual bool resize(const WebCore::IntSize&);
virtual bool shouldPaintMirrored() const { return false; }
protected:
AcceleratedSurface(WebPage&);
......
......@@ -43,6 +43,7 @@ public:
uint64_t window() const override { return reinterpret_cast<uint64_t>(m_window); }
uint64_t surfaceID() const override { return m_webPage.pageID(); }
bool resize(const WebCore::IntSize&) override;
bool shouldPaintMirrored() const override { return true; }
private:
AcceleratedSurfaceWayland(WebPage&);
......
......@@ -47,6 +47,7 @@ public:
uint64_t window() const override { return m_window.get(); }
uint64_t surfaceID() const override { return m_pixmap.get(); }
bool resize(const WebCore::IntSize&) override;
bool shouldPaintMirrored() const override { return false; }
private:
AcceleratedSurfaceX11(WebPage&);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment