summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android
diff options
context:
space:
mode:
authorShimeng (Simon) Wang <swang@google.com>2011-07-14 15:13:53 -0700
committerShimeng (Simon) Wang <swang@google.com>2011-07-14 16:05:01 -0700
commit7e6e4dd41950ef98c67ee99be2d67daf563009ca (patch)
treedfcb3b4553a47b1c830aeb722d14b4aaad4449b9 /Source/WebCore/platform/graphics/android
parent5dcd286d3e3e60f6a090f775a1fdceb40f578b75 (diff)
downloadexternal_webkit-7e6e4dd41950ef98c67ee99be2d67daf563009ca.zip
external_webkit-7e6e4dd41950ef98c67ee99be2d67daf563009ca.tar.gz
external_webkit-7e6e4dd41950ef98c67ee99be2d67daf563009ca.tar.bz2
Add android specific virtual function to GraphicsLayerClient.
This lets the GraphicsLayerClient instance decides whether it has owning RenderLayer, instead of using static_cast. This makes overflow'ed iframe scrollable again. This change also reverts Tenghui's CL: https://android-git.corp.google.com/g/#change,115508 Tested on scrollable iframe and inline video. issue: 4902019 Change-Id: I252f5432b0750c5cac0a4404663e1730ef006cfc
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index fc9d85f..fb41ccb 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -107,9 +107,7 @@ SkLength convertLength(Length len)
static RenderLayer* renderLayerFromClient(GraphicsLayerClient* client)
{
- if (client)
- return static_cast<RenderLayerBacking*>(client)->owningLayer();
- return 0;
+ return client ? client->owningLayer() : 0;
}
GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) :
@@ -220,10 +218,9 @@ void GraphicsLayerAndroid::removeFromParent()
void GraphicsLayerAndroid::updateFixedPosition()
{
- if (!m_client)
- return;
-
RenderLayer* renderLayer = renderLayerFromClient(m_client);
+ if (!renderLayer)
+ return;
RenderView* view = static_cast<RenderView*>(renderLayer->renderer());
if (!view)
@@ -316,8 +313,8 @@ void GraphicsLayerAndroid::setSize(const FloatSize& size)
// 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);
@@ -554,6 +551,8 @@ bool GraphicsLayerAndroid::repaint()
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.