class GraphicsContext;
class GraphicsLayer;
+#if PLATFORM(ANDROID)
+class RenderLayer;
+#endif
class IntPoint;
class IntRect;
class FloatPoint;
public:
virtual ~GraphicsLayerClient() {}
+#if PLATFORM(ANDROID)
+ virtual RenderLayer* owningLayer() const { return 0; }
+#endif
+
// Callback for when hardware-accelerated animation started.
virtual void notifyAnimationStarted(const GraphicsLayer*, double time) = 0;
static RenderLayer* renderLayerFromClient(GraphicsLayerClient* client)
{
- if (client)
- return static_cast<RenderLayerBacking*>(client)->owningLayer();
- return 0;
+ return client ? client->owningLayer() : 0;
}
GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) :
void GraphicsLayerAndroid::updateFixedPosition()
{
- if (!m_client)
- return;
-
RenderLayer* renderLayer = renderLayerFromClient(m_client);
+ if (!renderLayer)
+ return;
RenderView* view = static_cast<RenderView*>(renderLayer->renderer());
if (!view)
// If it is a media layer the size may have changed as a result of the media
// element (e.g. plugin) gaining focus. Therefore, we must sync the size of
// the focus' outline so that our UI thread can draw accordingly.
- if (m_contentLayer->isMedia() && m_client) {
- RenderLayer* layer = renderLayerFromClient(m_client);
+ RenderLayer* layer = renderLayerFromClient(m_client);
+ if (layer && m_contentLayer->isMedia()) {
RenderBox* box = layer->renderBox();
int outline = box->view()->maximalOutlineSize();
static_cast<MediaLayer*>(m_contentLayer)->setOutlineSize(outline);
IntRect layerBounds(0, 0, m_size.width(), m_size.height());
RenderLayer* layer = renderLayerFromClient(m_client);
+ if (!layer)
+ return false;
if (m_foregroundLayer) {
PaintingPhase phase(this);
// Paint the background into a separate context.
bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const
{
-#if PLATFORM(ANDROID)
- // Recently, RenderLayerCompositor is changed to be a subclass of
- // GraphicsLayerClient, and it is used for iframe.
- // http://trac.webkit.org/changeset/75262
- // We have our own support for iframe, before we embrace this new approach,
- // we will disable it.
- // TODO: Investigate how to utilize this way to support iframe.
- return false;
-#endif
// We need to handle our own scrolling if we're:
return !m_renderView->frameView()->platformWidget() // viewless (i.e. non-Mac, or Mac in WebKit2)
|| attachment == RootLayerAttachedViaEnclosingFrame; // a composited frame on Mac