PluginLayerWebKitThread.cpp [plain text]
#include "config.h"
#include "PluginLayerWebKitThread.h"
#if USE(ACCELERATED_COMPOSITING)
#include "LayerCompositingThread.h"
#include "PluginView.h"
namespace WebCore {
PluginLayerWebKitThread::PluginLayerWebKitThread(PluginView* pluginView)
: LayerWebKitThread(Layer, 0)
, m_needsDisplay(false)
{
setPluginView(pluginView);
}
PluginLayerWebKitThread::~PluginLayerWebKitThread()
{
}
void PluginLayerWebKitThread::setPluginView(PluginView* pluginView)
{
m_pluginView = pluginView;
setNeedsTexture(isDrawable() && pluginView);
setLayerProgram(LayerProgramRGBA);
if (m_pluginView)
setNeedsDisplay();
else {
layerCompositingThread()->setPluginView(0);
setNeedsCommit();
}
}
void PluginLayerWebKitThread::setHolePunchRect(const IntRect& rect)
{
m_holePunchRect = rect;
setNeedsCommit();
}
void PluginLayerWebKitThread::setNeedsDisplay()
{
m_needsDisplay = true;
setNeedsCommit();
}
void PluginLayerWebKitThread::updateTextureContentsIfNeeded()
{
if (!m_needsDisplay)
return;
m_needsDisplay = false;
if (!m_pluginView)
return;
m_pluginView->updateBuffer(IntRect(IntPoint::zero(), m_pluginView->size()));
}
}
#endif // USE(ACCELERATED_COMPOSITING)