2
* Copyright (C) 2010, 2011, 2012 Research In Motion Limited. All rights reserved.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
#include "PluginLayerWebKitThread.h"
22
#if USE(ACCELERATED_COMPOSITING)
24
#include "LayerCompositingThread.h"
25
#include "PluginView.h"
29
PluginLayerWebKitThread::PluginLayerWebKitThread(PluginView* pluginView)
30
: LayerWebKitThread(Layer, 0)
31
, m_needsDisplay(false)
33
setPluginView(pluginView);
36
PluginLayerWebKitThread::~PluginLayerWebKitThread()
40
void PluginLayerWebKitThread::setPluginView(PluginView* pluginView)
42
m_pluginView = pluginView;
43
setNeedsTexture(isDrawable() && pluginView);
44
setLayerProgramShader(LayerProgramShaderRGBA);
49
// We can't afford to wait until the next commit
50
// to set the m_pluginView to 0 in the impl, because it is
51
// about to be destroyed.
52
layerCompositingThread()->setPluginView(0);
57
void PluginLayerWebKitThread::setHolePunchRect(const IntRect& rect)
59
m_holePunchRect = rect;
63
void PluginLayerWebKitThread::setNeedsDisplay()
65
m_needsDisplay = true;
69
void PluginLayerWebKitThread::updateTextureContentsIfNeeded()
74
m_needsDisplay = false;
79
m_pluginView->updateBuffer(IntRect(IntPoint::zero(), m_pluginView->size()));
82
} // namespace WebCore
84
#endif // USE(ACCELERATED_COMPOSITING)