summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-05-24 16:20:42 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-05-31 10:55:53 +0200
commit51cc60565334ee09d7d9c1f10c709c9accf230d8 (patch)
tree868afb7e68fd9cd4a6dee8df69d79fdbbbb7902d /lib
parent2b8371ef007cfa2c580921ccfb896cb1e594814e (diff)
Make sure that newly created BackingStores respect the size of the view.
Diffstat (limited to 'lib')
-rw-r--r--lib/backing_store_qt.cpp7
-rw-r--r--lib/raster_window.cpp2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/backing_store_qt.cpp b/lib/backing_store_qt.cpp
index b22f25671..e5cc72016 100644
--- a/lib/backing_store_qt.cpp
+++ b/lib/backing_store_qt.cpp
@@ -26,9 +26,10 @@ BackingStoreQt::~BackingStoreQt()
void BackingStoreQt::resize(const QSize& size)
{
m_isValid = false;
- if (size != m_pixelBuffer.size())
- m_pixelBuffer = QPixmap(size);
- m_host->WasResized();
+ if (size != m_pixelBuffer.size()) {
+ m_pixelBuffer = QPixmap(size);
+ m_host->WasResized();
+ }
}
void BackingStoreQt::paintToTarget(QPainter* painter, const QRect& rect)
diff --git a/lib/raster_window.cpp b/lib/raster_window.cpp
index 0f3070e5d..cd5d038b0 100644
--- a/lib/raster_window.cpp
+++ b/lib/raster_window.cpp
@@ -18,6 +18,8 @@ RasterWindow::RasterWindow(content::RenderWidgetHostViewQt* view, QWidget *paren
void RasterWindow::setBackingStore(BackingStoreQt* backingStore)
{
m_backingStore = backingStore;
+ if (m_backingStore)
+ m_backingStore->resize(size());
}
void RasterWindow::paintEvent(QPaintEvent * event)