diff options
author | Chris Craik <ccraik@google.com> | 2012-09-28 15:11:12 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2012-10-01 11:03:13 -0700 |
commit | 42326004062d6b846c3050ad03a1e80fa9db425c (patch) | |
tree | 5be919630a5838cdef4adcc03975edda49fa1832 /Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp | |
parent | 224e946b3cabeaa9c360bdd6865485b5acb34cdc (diff) | |
download | external_webkit-42326004062d6b846c3050ad03a1e80fa9db425c.zip external_webkit-42326004062d6b846c3050ad03a1e80fa9db425c.tar.gz external_webkit-42326004062d6b846c3050ad03a1e80fa9db425c.tar.bz2 |
Determine maxZoomScale from bitmap/text drawing
bug:7247750
Change-Id: I8238acc2c20942ab2f42936d16a03226909aebcd
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp index 5b11df6..d7b904f 100644 --- a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp @@ -46,7 +46,7 @@ SurfaceBacking::SurfaceBacking(bool isBaseSurface) , m_scale(-1) , m_futureScale(-1) , m_zooming(false) - , m_hasAllowedZoom(false) + , m_maxZoomScale(1) { #ifdef DEBUG_COUNT @@ -64,7 +64,7 @@ SurfaceBacking::~SurfaceBacking() #endif } -void SurfaceBacking::prepareGL(GLWebViewState* state, bool allowZoom, +void SurfaceBacking::prepareGL(GLWebViewState* state, float maxZoomScale, const IntRect& prepareArea, const IntRect& fullContentArea, TilePainter* painter, bool aggressiveRendering, bool updateWithBlit) @@ -72,11 +72,11 @@ void SurfaceBacking::prepareGL(GLWebViewState* state, bool allowZoom, // If the surface backing has ever zoomed beyond 1.0 scale, it's always // allowed to (so repaints aren't necessary when allowZoom toggles). If not, // and allowZoom is false, don't allow scale greater than 1.0 - m_hasAllowedZoom |= allowZoom; + m_maxZoomScale = std::max(m_maxZoomScale, maxZoomScale); float scale = state->scale(); bool scaleOverridden = false; - if (scale > 1 && !m_hasAllowedZoom) { - scale = 1; + if (scale > m_maxZoomScale) { + scale = m_maxZoomScale; scaleOverridden = true; } |