summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering')
-rw-r--r--Source/WebCore/rendering/RenderHTMLCanvas.cpp6
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp2
-rw-r--r--Source/WebCore/rendering/svg/SVGInlineTextBox.cpp20
3 files changed, 27 insertions, 1 deletions
diff --git a/Source/WebCore/rendering/RenderHTMLCanvas.cpp b/Source/WebCore/rendering/RenderHTMLCanvas.cpp
index de2a2c1..ada79e9 100644
--- a/Source/WebCore/rendering/RenderHTMLCanvas.cpp
+++ b/Source/WebCore/rendering/RenderHTMLCanvas.cpp
@@ -47,9 +47,13 @@ RenderHTMLCanvas::RenderHTMLCanvas(HTMLCanvasElement* element)
bool RenderHTMLCanvas::requiresLayer() const
{
+#if PLATFORM(ANDROID)
+ return true;
+#endif
+
if (RenderReplaced::requiresLayer())
return true;
-
+
HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(node());
return canvas && canvas->renderingContext() && canvas->renderingContext()->isAccelerated();
}
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 5827636..85c57a6 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -1384,6 +1384,8 @@ bool RenderLayerCompositor::requiresCompositingForAndroidLayers(const RenderLaye
if (layer->isFixed())
return true;
#endif
+ if (layer->renderer()->isCanvas())
+ return true;
return false;
}
#endif
diff --git a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
index bc550a6..bb34652 100644
--- a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
+++ b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
@@ -573,11 +573,18 @@ void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, ETextD
width *= scalingFactor;
decorationOrigin.scale(scalingFactor, scalingFactor);
+#if PLATFORM(ANDROID)
+ // Android does not support GraphicsContext::setCTM().
+ AffineTransform scaleTransform;
+ scaleTransform.scale(1 / scalingFactor);
+ context->concatCTM(scaleTransform);
+#else
AffineTransform newTransform = context->getCTM();
newTransform.scale(1 / scalingFactor);
normalizeTransform(newTransform);
context->setCTM(newTransform);
+#endif
}
decorationOrigin.move(0, -scaledFontMetrics.floatAscent() + positionOffsetForDecoration(decoration, scaledFontMetrics, thickness));
@@ -622,6 +629,13 @@ void SVGInlineTextBox::paintTextWithShadows(GraphicsContext* context, RenderStyl
AffineTransform originalTransform;
if (scalingFactor != 1) {
+#if PLATFORM(ANDROID)
+ // Android does not support GraphicsContext::setCTM().
+ context->save();
+ AffineTransform scaleTransform;
+ scaleTransform.scale(1 / scalingFactor);
+ context->concatCTM(scaleTransform);
+#else
originalTransform = context->getCTM();
AffineTransform newTransform = originalTransform;
@@ -629,12 +643,18 @@ void SVGInlineTextBox::paintTextWithShadows(GraphicsContext* context, RenderStyl
normalizeTransform(newTransform);
context->setCTM(newTransform);
+#endif
}
scaledFont.drawText(context, textRun, textOrigin + extraOffset, startPosition, endPosition);
if (scalingFactor != 1)
+#if PLATFORM(ANDROID)
+ // Android does not support GraphicsContext::setCTM().
+ context->restore();
+#else
context->setCTM(originalTransform);
+#endif
restoreGraphicsContextAfterTextPainting(context, textRun);