summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering')
-rw-r--r--Source/WebCore/rendering/PaintPhase.h4
-rw-r--r--Source/WebCore/rendering/RenderBlock.cpp6
-rw-r--r--Source/WebCore/rendering/RenderBox.cpp5
-rw-r--r--Source/WebCore/rendering/RenderBoxModelObject.h4
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.cpp12
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp3
6 files changed, 33 insertions, 1 deletions
diff --git a/Source/WebCore/rendering/PaintPhase.h b/Source/WebCore/rendering/PaintPhase.h
index 396131f..7dc205d 100644
--- a/Source/WebCore/rendering/PaintPhase.h
+++ b/Source/WebCore/rendering/PaintPhase.h
@@ -39,6 +39,10 @@ namespace WebCore {
enum PaintPhase {
PaintPhaseBlockBackground,
+#if PLATFORM(ANDROID)
+ // Used for fixed background support in layers
+ PaintPhaseBlockBackgroundDecorations,
+#endif
PaintPhaseChildBlockBackground,
PaintPhaseChildBlockBackgrounds,
PaintPhaseFloat,
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index a3bd41a..49dd169 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -2499,7 +2499,11 @@ void RenderBlock::paintObject(PaintInfo& paintInfo, int tx, int ty)
PaintPhase paintPhase = paintInfo.phase;
// 1. paint background, borders etc
- if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style()->visibility() == VISIBLE) {
+ if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground
+#if PLATFORM(ANDROID)
+ || paintPhase == PaintPhaseBlockBackgroundDecorations
+#endif
+ ) && style()->visibility() == VISIBLE) {
if (hasBoxDecorations())
paintBoxDecorations(paintInfo, tx, ty);
if (hasColumns())
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index 9c40d5b..bc7d03a 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -843,6 +843,11 @@ void RenderBox::paintBoxDecorationsWithSize(PaintInfo& paintInfo, int tx, int ty
else if (!isBody() || document()->documentElement()->renderer()->hasBackground()) {
// The <body> only paints its background if the root element has defined a background
// independent of the body.
+#if PLATFORM(ANDROID)
+ // If we only want to draw the decorations, don't draw
+ // the background
+ if (paintInfo.phase != PaintPhaseBlockBackgroundDecorations)
+#endif
paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), tx, ty, width, height);
}
if (style()->hasAppearance())
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.h b/Source/WebCore/rendering/RenderBoxModelObject.h
index d2f5972..ac4152f 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.h
+++ b/Source/WebCore/rendering/RenderBoxModelObject.h
@@ -62,7 +62,11 @@ public:
bool hasSelfPaintingLayer() const;
RenderLayer* layer() const { return m_layer; }
+#if PLATFORM(ANDROID)
+ virtual bool requiresLayer() const { return isRoot() || isPositioned() || isRelPositioned() || isTransparent() || hasOverflowClip() || hasTransform() || hasMask() || hasReflection() || style()->specifiesColumns() || style()->hasFixedBackgroundImage(); }
+#else
virtual bool requiresLayer() const { return isRoot() || isPositioned() || isRelPositioned() || isTransparent() || hasOverflowClip() || hasTransform() || hasMask() || hasReflection() || style()->specifiesColumns(); }
+#endif
// This will work on inlines to return the bounding box of all of the lines' border boxes.
virtual IntRect borderBoundingBox() const = 0;
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 6f56eca..c0c562a 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -1114,12 +1114,24 @@ void RenderLayerBacking::paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*
bool shouldPaint = (m_owningLayer->hasVisibleContent() || m_owningLayer->hasVisibleDescendant()) && m_owningLayer->isSelfPaintingLayer();
+#if PLATFORM(ANDROID)
+ if (shouldPaint && ((paintingPhase & GraphicsLayerPaintBackground)
+ || (paintingPhase & GraphicsLayerPaintBackgroundDecorations))) {
+#else
if (shouldPaint && (paintingPhase & GraphicsLayerPaintBackground)) {
+#endif
// Paint our background first, before painting any child layers.
// Establish the clip used to paint our background.
setClip(context, paintDirtyRect, damageRect);
+#if PLATFORM(ANDROID)
+ PaintPhase phase = PaintPhaseBlockBackground;
+ if (paintingPhase & GraphicsLayerPaintBackgroundDecorations)
+ phase = PaintPhaseBlockBackgroundDecorations;
+ PaintInfo info(context, damageRect, phase, false, paintingRootForRenderer, 0);
+#else
PaintInfo info(context, damageRect, PaintPhaseBlockBackground, false, paintingRootForRenderer, 0);
+#endif
renderer()->paint(info, tx, ty);
// Our scrollbar widgets paint exactly when we tell them to, so that they work properly with
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 1871b57..6b669e8 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -1432,6 +1432,9 @@ bool RenderLayerCompositor::requiresCompositingForAndroidLayers(const RenderLaye
if (layer->renderer()->isCanvas())
return true;
+ if (layer->renderer()->style()->hasFixedBackgroundImage())
+ return true;
+
return false;
}
#endif