summaryrefslogtreecommitdiffstats
path: root/WebCore/platform
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2010-07-07 10:28:13 -0700
committerGrace Kloba <klobag@google.com>2010-07-07 10:28:13 -0700
commit899f518a7f2682c900252ca03d93f83095a43d52 (patch)
tree1a18b7f774571884e40e374a4a0a9ee6d0b3d54f /WebCore/platform
parentfcc4a0b80dc057862783fba22081954b6569a4b3 (diff)
downloadexternal_webkit-899f518a7f2682c900252ca03d93f83095a43d52.zip
external_webkit-899f518a7f2682c900252ca03d93f83095a43d52.tar.gz
external_webkit-899f518a7f2682c900252ca03d93f83095a43d52.tar.bz2
Enable composite layers for the sub frame.
Fix the visibleContentRect for iframe. It should be relative to its parent instead of the viewport. For fixed position, we still check for the top frame as the current logic positions the object relative to the screen which only applied to the top frame. For plugin, it depends on PluginWidget's platformLayer(). The default is 0. For video, it depends on MediaPlayer's supportsAcceleratedRendering(). The default is false. Fix the crash in the GraphicsLayerAndroid. The root layer is a container layer, there is no need to draw them. As LayerAndroid doesn't create Picture for them, we should ensure to skip draw. Fix http://b/issue?id=2733947
Diffstat (limited to 'WebCore/platform')
-rw-r--r--WebCore/platform/android/ScrollViewAndroid.cpp21
-rw-r--r--WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp6
-rw-r--r--WebCore/platform/graphics/android/LayerAndroid.h1
3 files changed, 11 insertions, 17 deletions
diff --git a/WebCore/platform/android/ScrollViewAndroid.cpp b/WebCore/platform/android/ScrollViewAndroid.cpp
index 74f9d6b..dec3183 100644
--- a/WebCore/platform/android/ScrollViewAndroid.cpp
+++ b/WebCore/platform/android/ScrollViewAndroid.cpp
@@ -54,21 +54,12 @@ namespace WebCore {
IntRect ScrollView::platformVisibleContentRect(bool includeScrollbars) const
{
- if (parent()) {
- const ScrollView* sv = this;
- int offsetX = 0;
- int offsetY = 0;
- while (sv->parent()) {
- offsetX += sv->x();
- offsetY += sv->y();
- sv = sv->parent();
- }
- IntRect rect = sv->platformWidget()->getVisibleBounds();
- rect.move(-offsetX, -offsetY);
- rect.intersect(IntRect(0, 0, width(), height()));
- return rect;
- }
- return platformWidget()->getVisibleBounds();
+ // iframe's visible content rect is relative to its parent, not the viewport.
+ // As we auto expand the iframe, the frame rect is the content rect.
+ if (parent())
+ return IntRect(0, 0, width(), height());
+ else
+ return platformWidget()->getVisibleBounds();
}
IntSize ScrollView::platformContentsSize() const
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 8403a03..1fb36ec 100644
--- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -125,7 +125,8 @@ GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) :
if (m_client) {
RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(m_client);
RenderLayer* renderLayer = backing->owningLayer();
- m_contentLayer->setIsRootLayer(renderLayer->isRootLayer());
+ m_contentLayer->setIsRootLayer(renderLayer->isRootLayer() &&
+ !(renderLayer->renderer()->frame()->ownerElement()));
}
gDebugGraphicsLayerAndroidInstances++;
}
@@ -350,7 +351,8 @@ void GraphicsLayerAndroid::setMasksToBounds(bool masksToBounds)
void GraphicsLayerAndroid::setDrawsContent(bool drawsContent)
{
GraphicsLayer::setDrawsContent(drawsContent);
-
+ if (m_contentLayer->isRootLayer())
+ return;
if (m_drawsContent) {
m_haveContents = true;
setNeedsDisplay();
diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h
index b6b6f70..b98d4dd 100644
--- a/WebCore/platform/graphics/android/LayerAndroid.h
+++ b/WebCore/platform/graphics/android/LayerAndroid.h
@@ -123,6 +123,7 @@ public:
void setMasksToBounds(bool);
void setIsRootLayer(bool isRootLayer) { m_isRootLayer = isRootLayer; }
+ bool isRootLayer() const { return m_isRootLayer; }
SkPicture* recordContext();