summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-12 14:11:55 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-12 14:11:55 +0100
commit4a859b901746c6ef66f9cba8ed477fca72d05172 (patch)
tree9849de18c8853673743044c7b72e9baf2663ac8b
parent750d801413bce17a58123e03dc8076f091bf0e06 (diff)
parenta1b801fc98ccda988df41e08dc70fdbd50ecb513 (diff)
downloadqtwebkit-4a859b901746c6ef66f9cba8ed477fca72d05172.tar.gz
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Iea6cf3f34fb33f2d138b72243b0e688958d9424e
-rw-r--r--Source/JavaScriptCore/offlineasm/instructions.rb4
-rw-r--r--Source/JavaScriptCore/offlineasm/mips.rb163
-rw-r--r--Source/WebCore/loader/cache/CachedResource.cpp2
-rw-r--r--Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp8
-rw-r--r--Source/WebCore/platform/graphics/qt/TransparencyLayer.h6
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp14
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h2
-rw-r--r--Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp5
-rw-r--r--Source/WebCore/rendering/RenderGeometryMap.cpp2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp4
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h1
-rw-r--r--Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp11
-rw-r--r--Source/WebKit/qt/WidgetApi/qwebpage.cpp31
-rw-r--r--Source/WebKit/qt/WidgetApi/qwebpage.h2
-rw-r--r--Source/WebKit/qt/WidgetApi/qwebpage_p.h9
-rw-r--r--Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp4
-rw-r--r--Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp4
-rw-r--r--Source/widgetsapi.pri1
-rw-r--r--Tools/qmake/mkspecs/features/default_post.prf4
19 files changed, 207 insertions, 70 deletions
diff --git a/Source/JavaScriptCore/offlineasm/instructions.rb b/Source/JavaScriptCore/offlineasm/instructions.rb
index 45fdb0ffc..a54827ef8 100644
--- a/Source/JavaScriptCore/offlineasm/instructions.rb
+++ b/Source/JavaScriptCore/offlineasm/instructions.rb
@@ -267,12 +267,12 @@ ARM_INSTRUCTIONS =
MIPS_INSTRUCTIONS =
[
+ "la",
"movz",
"movn",
"slt",
"sltu",
- "pichdr",
- "pichdrra"
+ "pichdr"
]
SH4_INSTRUCTIONS =
diff --git a/Source/JavaScriptCore/offlineasm/mips.rb b/Source/JavaScriptCore/offlineasm/mips.rb
index 3ec7022ee..c0adfd029 100644
--- a/Source/JavaScriptCore/offlineasm/mips.rb
+++ b/Source/JavaScriptCore/offlineasm/mips.rb
@@ -62,7 +62,6 @@ MIPS_TEMP_GPRS = [SpecialRegister.new("$t5"), SpecialRegister.new("$t6"), Specia
MIPS_ZERO_REG = SpecialRegister.new("$zero")
MIPS_GP_REG = SpecialRegister.new("$gp")
MIPS_GPSAVE_REG = SpecialRegister.new("$s4")
-MIPS_JUMP_REG = SpecialRegister.new("$ra")
MIPS_CALL_REG = SpecialRegister.new("$t9")
MIPS_TEMP_FPRS = [SpecialRegister.new("$f16")]
MIPS_SCRATCH_FPR = SpecialRegister.new("$f18")
@@ -158,6 +157,70 @@ class AbsoluteAddress
end
#
+# Negate condition of branches to labels.
+#
+
+class Instruction
+ def mipsNegateCondition(list)
+ /^(b(add|sub|or|mul|t)?)([ipb])/.match(opcode)
+ case $~.post_match
+ when "eq"
+ op = "neq"
+ when "neq"
+ op = "eq"
+ when "z"
+ op = "nz"
+ when "nz"
+ op = "z"
+ when "gt"
+ op = "lteq"
+ when "gteq"
+ op = "lt"
+ when "lt"
+ op = "gteq"
+ when "lteq"
+ op = "gt"
+ when "a"
+ op = "beq"
+ when "b"
+ op = "aeq"
+ when "aeq"
+ op = "b"
+ when "beq"
+ op = "a"
+ else
+ raise "Can't negate #{opcode} branch."
+ end
+ noBranch = LocalLabel.unique("nobranch")
+ noBranchRef = LocalLabelReference.new(codeOrigin, noBranch)
+ toRef = operands[-1]
+ list << Instruction.new(codeOrigin, "#{$1}#{$3}#{op}", operands[0..-2].push(noBranchRef), annotation)
+ list << Instruction.new(codeOrigin, "la", [toRef, MIPS_CALL_REG])
+ list << Instruction.new(codeOrigin, "jmp", [MIPS_CALL_REG])
+ list << noBranch
+ end
+end
+
+def mipsLowerFarBranchOps(list)
+ newList = []
+ list.each {
+ | node |
+ if node.is_a? Instruction
+ annotation = node.annotation
+ case node.opcode
+ when /^b(add|sub|or|mul|t)?([ipb])/
+ if node.operands[-1].is_a? LabelReference
+ node.mipsNegateCondition(newList)
+ next
+ end
+ end
+ end
+ newList << node
+ }
+ newList
+end
+
+#
# Lower 'and' masked branches
#
@@ -392,6 +455,30 @@ end
# Specialization of lowering of misplaced addresses.
#
+class LocalLabelReference
+ def register?
+ false
+ end
+end
+
+def mipsAsRegister(preList, postList, operand, needRestore)
+ tmp = MIPS_CALL_REG
+ if operand.address?
+ preList << Instruction.new(operand.codeOrigin, "loadp", [operand, MIPS_CALL_REG])
+ elsif operand.is_a? LabelReference
+ preList << Instruction.new(operand.codeOrigin, "la", [operand, MIPS_CALL_REG])
+ elsif operand.register? and operand != MIPS_CALL_REG
+ preList << Instruction.new(operand.codeOrigin, "move", [operand, MIPS_CALL_REG])
+ else
+ needRestore = false
+ tmp = operand
+ end
+ if needRestore
+ postList << Instruction.new(operand.codeOrigin, "move", [MIPS_GPSAVE_REG, MIPS_GP_REG])
+ end
+ tmp
+end
+
def mipsLowerMisplacedAddresses(list)
newList = []
list.each {
@@ -401,33 +488,13 @@ def mipsLowerMisplacedAddresses(list)
annotation = node.annotation
case node.opcode
when "jmp"
- if node.operands[0].address?
- newList << Instruction.new(node.operands[0].codeOrigin, "loadi", [node.operands[0], MIPS_JUMP_REG])
- newList << Instruction.new(node.codeOrigin, node.opcode, [MIPS_JUMP_REG])
- else
- newList << Instruction.new(node.codeOrigin,
- node.opcode,
- [riscAsRegister(newList, postInstructions, node.operands[0], "p", false)])
- end
+ newList << Instruction.new(node.codeOrigin,
+ node.opcode,
+ [mipsAsRegister(newList, [], node.operands[0], false)])
when "call"
- restoreGP = false;
- tmp = MIPS_CALL_REG
- if node.operands[0].address?
- newList << Instruction.new(node.operands[0].codeOrigin, "loadp", [node.operands[0], MIPS_CALL_REG])
- restoreGP = true;
- elsif node.operands[0].is_a? LabelReference
- tmp = node.operands[0]
- restoreGP = true;
- elsif node.operands[0].register?
- newList << Instruction.new(node.operands[0].codeOrigin, "move", [node.operands[0], MIPS_CALL_REG])
- restoreGP = true;
- else
- tmp = node.operands[0]
- end
- newList << Instruction.new(node.codeOrigin, node.opcode, [tmp])
- if restoreGP
- newList << Instruction.new(node.codeOrigin, "move", [MIPS_GPSAVE_REG, MIPS_GP_REG])
- end
+ newList << Instruction.new(node.codeOrigin,
+ node.opcode,
+ [mipsAsRegister(newList, postInstructions, node.operands[0], true)])
when "slt", "sltu"
newList << Instruction.new(node.codeOrigin,
node.opcode,
@@ -512,7 +579,7 @@ class Address
end
#
-# Add PIC compatible header code to prologue/entry rutins.
+# Add PIC compatible header code to all the LLInt rutins.
#
def mipsAddPICCode(list)
@@ -521,13 +588,7 @@ def mipsAddPICCode(list)
| node |
myList << node
if node.is_a? Label
- if /_prologue$/.match(node.name) || /^_llint_function_/.match(node.name)
- # Functions called from trampoline/JIT codes.
- myList << Instruction.new(node.codeOrigin, "pichdr", [])
- elsif /_llint_op_catch/.match(node.name)
- # Exception cactcher entry point function.
- myList << Instruction.new(node.codeOrigin, "pichdrra", [])
- end
+ myList << Instruction.new(node.codeOrigin, "pichdr", [])
end
}
myList
@@ -553,6 +614,7 @@ class Sequence
}
result = mipsAddPICCode(result)
+ result = mipsLowerFarBranchOps(result)
result = mipsLowerSimpleBranchOps(result)
result = riscLowerSimpleBranchOps(result)
result = riscLowerHardBranchOps(result)
@@ -660,6 +722,16 @@ def emitMIPSDoubleBranch(branchOpcode, neg, operands)
end
end
+def emitMIPSJumpOrCall(opcode, operand)
+ if operand.label?
+ raise "Direct call/jump to a not local label." unless operand.is_a? LocalLabelReference
+ $asm.puts "#{opcode} #{operand.asmLabel}"
+ else
+ raise "Invalid call/jump register." unless operand == MIPS_CALL_REG
+ $asm.puts "#{opcode}r #{MIPS_CALL_REG.mipsOperand}"
+ end
+end
+
class Instruction
def lowerMIPS
$asm.comment codeOriginString
@@ -730,6 +802,8 @@ class Instruction
$asm.puts "ldc1 #{mipsFlippedOperands(operands)}"
when "stored"
$asm.puts "sdc1 #{mipsOperands(operands)}"
+ when "la"
+ $asm.puts "la #{operands[1].mipsOperand}, #{operands[0].asmLabel}"
when "addd"
emitMIPS("add.d", operands)
when "divd"
@@ -811,17 +885,9 @@ class Instruction
when "bilteq", "bplteq", "bblteq"
$asm.puts "ble #{mipsOperands(operands[0..1])}, #{operands[2].asmLabel}"
when "jmp"
- if operands[0].label?
- $asm.puts "j #{operands[0].asmLabel}"
- else
- $asm.puts "jr #{operands[0].mipsOperand}"
- end
+ emitMIPSJumpOrCall("j", operands[0])
when "call"
- if operands[0].label?
- $asm.puts "jal #{operands[0].asmLabel}"
- else
- $asm.puts "jalr #{operands[0].mipsOperand}"
- end
+ emitMIPSJumpOrCall("jal", operands[0])
when "break"
$asm.puts "break"
when "ret"
@@ -880,11 +946,8 @@ class Instruction
when "sltu", "sltub"
$asm.puts "sltu #{operands[0].mipsOperand}, #{operands[1].mipsOperand}, #{operands[2].mipsOperand}"
when "pichdr"
- $asm.putStr("OFFLINE_ASM_CPLOAD($25)")
- $asm.puts "move $s4, $gp"
- when "pichdrra"
- $asm.putStr("OFFLINE_ASM_CPLOAD($31)")
- $asm.puts "move $s4, $gp"
+ $asm.putStr("OFFLINE_ASM_CPLOAD(#{MIPS_CALL_REG.mipsOperand})")
+ $asm.puts "move #{MIPS_GPSAVE_REG.mipsOperand}, #{MIPS_GP_REG.mipsOperand}"
else
raise "Unhandled opcode #{opcode} at #{codeOriginString}"
end
diff --git a/Source/WebCore/loader/cache/CachedResource.cpp b/Source/WebCore/loader/cache/CachedResource.cpp
index 385e325ed..5aff5f847 100644
--- a/Source/WebCore/loader/cache/CachedResource.cpp
+++ b/Source/WebCore/loader/cache/CachedResource.cpp
@@ -361,7 +361,7 @@ void CachedResource::load(CachedResourceLoader* cachedResourceLoader, const Reso
void CachedResource::checkNotify()
{
- if (isLoading())
+ if (isLoading() || stillNeedsLoad())
return;
CachedResourceClientWalker<CachedResourceClient> w(m_clients);
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 014c06385..ffd88804a 100644
--- a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -368,12 +368,14 @@ PlatformGraphicsContext* GraphicsContext::platformContext() const
return m_data->p();
}
-AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale includeScale) const
{
if (paintingDisabled())
return AffineTransform();
- const QTransform& matrix = platformContext()->combinedTransform();
+ const QTransform& matrix = (includeScale == DefinitelyIncludeDeviceScale)
+ ? platformContext()->combinedTransform()
+ : platformContext()->worldTransform();
return AffineTransform(matrix.m11(), matrix.m12(), matrix.m21(),
matrix.m22(), matrix.dx(), matrix.dy());
}
@@ -1511,7 +1513,7 @@ TransformationMatrix GraphicsContext::get3DTransform() const
if (paintingDisabled())
return TransformationMatrix();
- return platformContext()->combinedTransform();
+ return platformContext()->worldTransform();
}
void GraphicsContext::concat3DTransform(const TransformationMatrix& transform)
diff --git a/Source/WebCore/platform/graphics/qt/TransparencyLayer.h b/Source/WebCore/platform/graphics/qt/TransparencyLayer.h
index f13deb03b..0312690e0 100644
--- a/Source/WebCore/platform/graphics/qt/TransparencyLayer.h
+++ b/Source/WebCore/platform/graphics/qt/TransparencyLayer.h
@@ -46,11 +46,13 @@ struct TransparencyLayer {
WTF_MAKE_FAST_ALLOCATED;
public:
TransparencyLayer(const QPainter* p, const QRect &rect, qreal opacity, QPixmap& alphaMask)
- : pixmap(rect.width(), rect.height())
- , opacity(opacity)
+ : opacity(opacity)
, alphaMask(alphaMask)
, saveCounter(1) // see the comment for saveCounter
{
+ int devicePixelRatio = p->device()->devicePixelRatio();
+ pixmap = QPixmap(rect.width() * devicePixelRatio, rect.height() * devicePixelRatio);
+ pixmap.setDevicePixelRatio(devicePixelRatio);
offset = rect.topLeft();
pixmap.fill(Qt::transparent);
painter.begin(&pixmap);
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
index a59b33f4a..668ea95b1 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
@@ -114,6 +114,15 @@ void TextureMapperImageBuffer::beginClip(const TransformationMatrix& matrix, con
#endif
}
+void TextureMapperImageBuffer::endClip()
+{
+ GraphicsContext* context = currentContext();
+ if (!context)
+ return;
+
+ context->restore();
+}
+
void TextureMapperImageBuffer::drawTexture(const BitmapTexture& texture, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity, unsigned /* exposedEdges */)
{
GraphicsContext* context = currentContext();
@@ -163,9 +172,10 @@ void TextureMapperImageBuffer::drawNumber(int /* number */, const Color&, const
}
#if ENABLE(CSS_FILTERS)
-PassRefPtr<BitmapTexture> BitmapTextureImageBuffer::applyFilters(TextureMapper*, const FilterOperations&)
+PassRefPtr<BitmapTexture> BitmapTextureImageBuffer::applyFilters(TextureMapper*, const FilterOperations& filters)
{
- ASSERT_NOT_REACHED();
+ ASSERT_UNUSED(filters, filters.isEmpty());
+
return this;
}
#endif
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
index 060713ce5..637d9d33b 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
@@ -59,7 +59,7 @@ public:
virtual void drawSolidColor(const FloatRect&, const TransformationMatrix&, const Color&) OVERRIDE;
virtual void beginClip(const TransformationMatrix&, const FloatRect&) OVERRIDE;
virtual void bindSurface(BitmapTexture* surface) OVERRIDE { m_currentSurface = surface;}
- virtual void endClip() OVERRIDE { graphicsContext()->restore(); }
+ virtual void endClip() OVERRIDE;
virtual IntRect clipBounds() OVERRIDE { return currentContext()->clipBounds(); }
virtual IntSize maxTextureSize() const;
virtual PassRefPtr<BitmapTexture> createTexture() OVERRIDE { return BitmapTextureImageBuffer::create(); }
diff --git a/Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp b/Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp
index ac157b8f7..d202388da 100644
--- a/Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp
+++ b/Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp
@@ -111,8 +111,10 @@ bool compressRGBABigEndianToJPEG(unsigned char* rgbaBigEndianData, const IntSize
// rowBuffer must be defined here so that its destructor is always called even when "setjmp" catches an error.
Vector<JSAMPLE, 600 * 3> rowBuffer;
- if (setjmp(err.m_setjmpBuffer))
+ if (setjmp(err.m_setjmpBuffer)) {
+ jpeg_destroy_compress(&compressData);
return false;
+ }
jpeg_start_compress(&compressData, TRUE);
rowBuffer.resize(compressData.image_width * 3);
@@ -132,6 +134,7 @@ bool compressRGBABigEndianToJPEG(unsigned char* rgbaBigEndianData, const IntSize
}
jpeg_finish_compress(&compressData);
+ jpeg_destroy_compress(&compressData);
return true;
}
diff --git a/Source/WebCore/rendering/RenderGeometryMap.cpp b/Source/WebCore/rendering/RenderGeometryMap.cpp
index 4513ef6a1..949fc1cd7 100644
--- a/Source/WebCore/rendering/RenderGeometryMap.cpp
+++ b/Source/WebCore/rendering/RenderGeometryMap.cpp
@@ -105,7 +105,7 @@ FloatPoint RenderGeometryMap::mapToContainer(const FloatPoint& p, const RenderLa
FloatPoint result;
if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() && (!container || (m_mapping.size() && container == m_mapping[0].m_renderer)))
- result = p + roundedIntSize(m_accumulatedOffset);
+ result = p + m_accumulatedOffset;
else {
TransformState transformState(TransformState::ApplyTransformDirection, p);
mapToContainer(transformState, container);
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
index 96b1ac072..fb4a91232 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
@@ -1362,6 +1362,10 @@ QWebPageAdapter::ViewportAttributes QWebPageAdapter::viewportAttributesForSize(c
return result;
}
+void QWebPageAdapter::setDevicePixelRatio(float devicePixelRatio)
+{
+ page->setDeviceScaleFactor(devicePixelRatio);
+}
bool QWebPageAdapter::handleKeyEvent(QKeyEvent *ev)
{
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
index 09d569c0f..3629e906d 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
@@ -352,6 +352,7 @@ public:
};
ViewportAttributes viewportAttributesForSize(const QSize& availableSize, const QSize& deviceSize) const;
+ void setDevicePixelRatio(float devicePixelRatio);
QWebSettings *settings;
diff --git a/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp
index 4261a0be2..dff4e0eb1 100644
--- a/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp
@@ -114,7 +114,16 @@ void TextureMapperLayerClientQt::renderCompositedLayers(GraphicsContext* context
m_textureMapper->setTextDrawingMode(context->textDrawingMode());
QPainter* painter = context->platformContext();
- const QTransform transform = painter->worldTransform();
+ QTransform transform;
+ if (m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode) {
+ // TextureMapperGL needs to duplicate the entire transform QPainter would do,
+ // including the transforms QPainter would normally do behind the scenes.
+ transform = painter->deviceTransform();
+ } else {
+ // TextureMapperImageBuffer needs a transform that can be used
+ // with QPainter::setWorldTransform.
+ transform = painter->worldTransform();
+ }
const TransformationMatrix matrix(
transform.m11(), transform.m12(), 0, transform.m13(),
transform.m21(), transform.m22(), 0, transform.m23(),
diff --git a/Source/WebKit/qt/WidgetApi/qwebpage.cpp b/Source/WebKit/qt/WidgetApi/qwebpage.cpp
index 48c9bf365..05caf7134 100644
--- a/Source/WebKit/qt/WidgetApi/qwebpage.cpp
+++ b/Source/WebKit/qt/WidgetApi/qwebpage.cpp
@@ -68,6 +68,7 @@
#include <QNetworkProxy>
#include <QNetworkRequest>
#include <QPainter>
+#include <QScreen>
#include <QSslSocket>
#include <QStyle>
#include <QSysInfo>
@@ -80,6 +81,7 @@
#include <QTouchEvent>
#include <QUndoStack>
#include <QUrl>
+#include <QWindow>
#if defined(Q_WS_X11)
#include <QX11Info>
#endif
@@ -195,6 +197,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
, linkPolicy(QWebPage::DontDelegateLinks)
, m_viewportSize(QSize(0, 0))
, useFixedLayout(false)
+ , window(0)
, inspectorFrontend(0)
, inspector(0)
, inspectorIsInternalOnly(false)
@@ -435,8 +438,10 @@ QtPluginWidgetAdapter *QWebPagePrivate::adapterForWidget(QObject *object) const
{
if (QWidget *widget = qobject_cast<QWidget*>(object))
return new QWidgetPluginImpl(widget);
+#ifndef QT_NO_GRAPHICSVIEW
if (QGraphicsWidget *widget = qobject_cast<QGraphicsWidget*>(object))
return new QGraphicsWidgetPluginImpl(widget);
+#endif
return 0;
}
@@ -1941,6 +1946,8 @@ void QWebPage::setViewportSize(const QSize &size) const
{
d->m_viewportSize = size;
+ d->updateWindow();
+
QWebFrameAdapter* mainFrame = d->mainFrameAdapter();
if (!mainFrame->hasView())
return;
@@ -1948,6 +1955,30 @@ void QWebPage::setViewportSize(const QSize &size) const
mainFrame->setViewportSize(size);
}
+void QWebPagePrivate::updateWindow()
+{
+ QWindow* _window = 0;
+ if (view && view->window())
+ _window = view->window()->windowHandle();
+
+ if (window == _window)
+ return;
+
+ if (window)
+ QObject::disconnect(window, SIGNAL(screenChanged(QScreen*)), q, SLOT(_q_updateScreen(QScreen*)));
+ window = _window;
+ if (window) {
+ QObject::connect(window, SIGNAL(screenChanged(QScreen*)), q, SLOT(_q_updateScreen(QScreen*)));
+ _q_updateScreen(window->screen());
+ }
+}
+
+void QWebPagePrivate::_q_updateScreen(QScreen* screen)
+{
+ if (screen)
+ setDevicePixelRatio(screen->devicePixelRatio());
+}
+
static int getintenv(const char* variable)
{
bool ok;
diff --git a/Source/WebKit/qt/WidgetApi/qwebpage.h b/Source/WebKit/qt/WidgetApi/qwebpage.h
index 2e3f6aa50..24fe1383e 100644
--- a/Source/WebKit/qt/WidgetApi/qwebpage.h
+++ b/Source/WebKit/qt/WidgetApi/qwebpage.h
@@ -35,6 +35,7 @@ class QMenu;
class QNetworkRequest;
class QNetworkReply;
class QNetworkAccessManager;
+class QScreen;
QT_END_NAMESPACE
class QWebElement;
@@ -444,6 +445,7 @@ private:
Q_PRIVATE_SLOT(d, void _q_webActionTriggered(bool checked))
#endif
Q_PRIVATE_SLOT(d, void _q_cleanupLeakMessages())
+ Q_PRIVATE_SLOT(d, void _q_updateScreen(QScreen*))
QWebPagePrivate *d;
diff --git a/Source/WebKit/qt/WidgetApi/qwebpage_p.h b/Source/WebKit/qt/WidgetApi/qwebpage_p.h
index b35cf2e19..8ba6c4c40 100644
--- a/Source/WebKit/qt/WidgetApi/qwebpage_p.h
+++ b/Source/WebKit/qt/WidgetApi/qwebpage_p.h
@@ -48,9 +48,11 @@ class Frame;
}
QT_BEGIN_NAMESPACE
-class QUndoStack;
-class QMenu;
class QBitArray;
+class QMenu;
+class QScreen;
+class QUndoStack;
+class QWindow;
QT_END_NAMESPACE
class QtPluginWidgetAdapter;
@@ -163,6 +165,8 @@ public:
bool gestureEvent(QGestureEvent*);
+ void updateWindow();
+ void _q_updateScreen(QScreen*);
void setInspector(QWebInspector*);
QWebInspector* getOrCreateInspector();
@@ -195,6 +199,7 @@ public:
QAction *actions[QWebPage::WebActionCount];
+ QWindow* window;
QWidget* inspectorFrontend;
QWebInspector* inspector;
bool inspectorIsInternalOnly; // True if created through the Inspect context menu action
diff --git a/Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp b/Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp
index b2fbf624a..5bf90d800 100644
--- a/Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp
+++ b/Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp
@@ -58,10 +58,14 @@ void QtFallbackWebPopup::show(const QWebSelectData& data)
populate(data);
QRect rect = geometry();
+#ifdef QT_NO_GRAPHICSVIEW
+ if (false) {
+#else
if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(pageClient()->pluginParent())) {
QGraphicsProxyWidget* proxy = new QGraphicsProxyWidget(webView);
proxy->setWidget(m_combo);
proxy->setGeometry(rect);
+#endif
} else {
m_combo->setParent(qobject_cast<QWidget*>(pageClient()->ownerWidget()));
m_combo->setGeometry(QRect(rect.left(), rect.top(), rect.width(), m_combo->sizeHint().height()));
diff --git a/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp b/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp
index ccd93a97f..474b6c6fe 100644
--- a/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp
+++ b/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp
@@ -132,9 +132,9 @@ static void initializeProxy()
if (proxylist.count() == 1) {
QNetworkProxy proxy = proxylist.first();
if (proxy == QNetworkProxy::NoProxy || proxy == QNetworkProxy::DefaultProxy) {
- EnvHttpProxyFactory* proxyFactory = new EnvHttpProxyFactory();
+ OwnPtr<EnvHttpProxyFactory> proxyFactory = adoptPtr(new EnvHttpProxyFactory());
if (proxyFactory->initializeFromEnvironment()) {
- QNetworkProxyFactory::setApplicationProxyFactory(proxyFactory);
+ QNetworkProxyFactory::setApplicationProxyFactory(proxyFactory.leakPtr());
return;
}
}
diff --git a/Source/widgetsapi.pri b/Source/widgetsapi.pri
index 7bdc0e138..335e37114 100644
--- a/Source/widgetsapi.pri
+++ b/Source/widgetsapi.pri
@@ -49,6 +49,7 @@ use?(3D_GRAPHICS): WEBKIT += ANGLE
WEBKIT += javascriptcore wtf webcore
MODULE = webkitwidgets
+CONFIG += creating_module
# We want the QtWebKit API forwarding includes to live in the root build dir.
MODULE_BASE_DIR = $$_PRO_FILE_PWD_
diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf
index 6fae22fa3..548005d01 100644
--- a/Tools/qmake/mkspecs/features/default_post.prf
+++ b/Tools/qmake/mkspecs/features/default_post.prf
@@ -171,8 +171,8 @@ contains(QT, webkit)|contains(QT, webkitwidgets) {
}
defineTest(needToLink) {
- # The main dynamic library always needs to link in the intermediate libraries
- creating_module: return(true)
+ # The main module dynamic library always needs to link in the intermediate libraries
+ isEqual(MODULE, webkit): return(true)
force_static_libs_as_shared {
# So do the individual libraries if they are dynamic