diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebKit/chromium/src/WebPluginContainerImpl.cpp | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebKit/chromium/src/WebPluginContainerImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebPluginContainerImpl.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index bb1b083..40f8625 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -164,6 +164,7 @@ void WebPluginContainerImpl::handleEvent(Event* event) if (!m_webPlugin->acceptsInputEvents()) return; + RefPtr<WebPluginContainerImpl> protector(this); // The events we pass are defined at: // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/structures5.html#1000000 // Don't take the documentation as truth, however. There are many cases @@ -307,6 +308,22 @@ void WebPluginContainerImpl::reportGeometry() m_webPlugin->updateGeometry(windowRect, clipRect, cutOutRects, isVisible()); } +void WebPluginContainerImpl::setBackingTextureId(unsigned id) +{ +#if USE(ACCELERATED_COMPOSITING) + unsigned currId = m_platformLayer->textureId(); + if (currId == id) + return; + + m_platformLayer->setTextureId(id); + // If anyone of the IDs is zero we need to switch between hardware + // and software compositing. This is done by triggering a style recalc + // on the container element. + if (!(currId * id)) + m_element->setNeedsStyleRecalc(WebCore::SyntheticStyleChange); +#endif +} + void WebPluginContainerImpl::commitBackingTexture() { #if USE(ACCELERATED_COMPOSITING) @@ -427,15 +444,7 @@ void WebPluginContainerImpl::willDestroyPluginLoadObserver(WebPluginLoadObserver #if USE(ACCELERATED_COMPOSITING) WebCore::LayerChromium* WebPluginContainerImpl::platformLayer() const { - // FIXME: In the event of a context lost, the texture needs to be recreated on the compositor's - // context and rebound to the platform layer here. - unsigned backingTextureId = m_webPlugin->getBackingTextureId(); - if (!backingTextureId) - return 0; - - m_platformLayer->setTextureId(backingTextureId); - - return m_platformLayer.get(); + return m_platformLayer->textureId() ? m_platformLayer.get() : 0; } #endif |