summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
index 867ff56..c865a54 100644
--- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
+++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
@@ -498,7 +498,7 @@ PlatformGraphicsContextRecording::PlatformGraphicsContextRecording(Recording* re
, mPicture(0)
, mRecording(recording)
, mOperationState(0)
- , m_hasText(false)
+ , m_maxZoomScale(1)
, m_isEmpty(true)
, m_canvasProxy(this)
{
@@ -524,7 +524,7 @@ bool PlatformGraphicsContextRecording::isPaintingDisabled()
SkCanvas* PlatformGraphicsContextRecording::recordingCanvas()
{
- m_hasText = true;
+ m_maxZoomScale = 1e6f;
return &m_canvasProxy;
}
@@ -779,6 +779,9 @@ void PlatformGraphicsContextRecording::drawBitmapRect(const SkBitmap& bitmap,
const SkIRect* src, const SkRect& dst,
CompositeOperator op)
{
+ float widthScale = dst.width() == 0 ? 1 : bitmap.width() / dst.width();
+ float heightScale = dst.height() == 0 ? 1 : bitmap.height() / dst.height();
+ m_maxZoomScale = std::max(m_maxZoomScale, std::max(widthScale, heightScale));
appendDrawingOperation(NEW_OP(DrawBitmapRect)(bitmap, *src, dst, op), dst);
}