diff options
author | Zeno Albisser <zeno.albisser@digia.com> | 2013-05-16 14:01:16 +0200 |
---|---|---|
committer | Zeno Albisser <zeno@webkit.org> | 2013-05-22 18:50:29 +0200 |
commit | 8c1e505db7743ca47f1f1b27bfd8a7d11aa1c303 (patch) | |
tree | b7e1624d8aa23defc9825e2cb6c36657904dcc81 /lib/backing_store_qt.cpp | |
parent | 6b8edd2b07cd9304be74cfa2d00a4a219c02d31d (diff) |
Introduce RasterWindowContainer to allow reusing the container with different child views.
Pass the view to BackingStoreQt::displayBuffer instead of creating it implicitly.
Rename RenderWidgetHostView to RenderWidgetHostViewQt and move it into namespace content.
Copy in web_contents_view from gtk to allow for modifications outside of the chromium tree.
Remove the ViewHostFactory, as it is meant to be used for testing only.
Diffstat (limited to 'lib/backing_store_qt.cpp')
-rw-r--r-- | lib/backing_store_qt.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/backing_store_qt.cpp b/lib/backing_store_qt.cpp index 402e4e4f1..bad42501f 100644 --- a/lib/backing_store_qt.cpp +++ b/lib/backing_store_qt.cpp @@ -8,26 +8,20 @@ #include <QPainter> -BackingStoreQt::BackingStoreQt(content::RenderWidgetHost *host, const gfx::Size &size, RasterWindow* surface) - : QBackingStore(surface) +BackingStoreQt::BackingStoreQt(content::RenderWidgetHost *host, const gfx::Size &size, QWindow* parent) + : QBackingStore(parent) , m_host(content::RenderWidgetHostImpl::From(host)) , content::BackingStore(host, size) - , m_surface(surface) , m_isValid(false) { int width = size.width(); int height = size.height(); - m_surface->resize(width,height); resize(QSize(width, height)); setStaticContents(QRect(0,0,size.width(), size.height())); - m_surface->setBackingStore(this); - m_surface->create(); } BackingStoreQt::~BackingStoreQt() { - if (m_surface) - m_surface->setBackingStore(0); } void BackingStoreQt::resize(const QSize& size) @@ -40,15 +34,15 @@ void BackingStoreQt::resize(const QSize& size) m_host->WasResized(); } -void BackingStoreQt::displayBuffer() +void BackingStoreQt::displayBuffer(RasterWindow* surface) { - if (!m_surface->isExposed() || !m_isValid) + if (!surface->isExposed() || !m_isValid) return; - int width = m_surface->width(); - int height = m_surface->height(); + int width = surface->width(); + int height = surface->height(); QRect rect(0, 0, width, height); - flush(rect); + flush(rect, surface); } void BackingStoreQt::PaintToBackingStore(content::RenderProcessHost *process, |