summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-10-20 15:55:34 -0700
committerNicolas Roard <nicolasroard@google.com>2011-10-20 16:47:41 -0700
commitf65ed48034d37597dc4b191a79781ae49d2cfc99 (patch)
tree6fac77320f6317983598e52033a59c30625e2829 /Source/WebCore/platform/graphics/android/PaintedSurface.cpp
parent8cc0fa17a42ae1dec75fe8ab00d5baa75e46499e (diff)
downloadexternal_webkit-f65ed48034d37597dc4b191a79781ae49d2cfc99.zip
external_webkit-f65ed48034d37597dc4b191a79781ae49d2cfc99.tar.gz
external_webkit-f65ed48034d37597dc4b191a79781ae49d2cfc99.tar.bz2
Implement dual textures for layers to handle zooming correctly.
We add a new class, DualTiledTexture, that encapsulate two TiledTextures and manage them according to the current scale factor. bug:5492874 Change-Id: I4ba3ff539f9242ae5102189e9623e1535e9cc28f
Diffstat (limited to 'Source/WebCore/platform/graphics/android/PaintedSurface.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/PaintedSurface.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
index c5ed38c..0957c0c 100644
--- a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
+++ b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
@@ -68,7 +68,7 @@ PaintedSurface::PaintedSurface(LayerAndroid* layer)
#ifdef DEBUG_COUNT
ClassTracker::instance()->increment("PaintedSurface");
#endif
- m_tiledTexture = new TiledTexture(this);
+ m_tiledTexture = new DualTiledTexture(this);
if (layer && layer->picture())
m_updateManager.updatePicture(layer->picture());
}
@@ -142,7 +142,6 @@ void PaintedSurface::prepare(GLWebViewState* state)
m_layer->uniqueId(), m_layer,
m_layer->getScale());
- float scale = m_layer->getScale();
int w = m_layer->getSize().width();
int h = m_layer->getSize().height();
@@ -154,13 +153,13 @@ void PaintedSurface::prepare(GLWebViewState* state)
computeVisibleArea();
- if (scale != m_scale)
- m_scale = scale;
+ m_scale = state->scale();
- XLOG("layer %d %x prepared at size (%d, %d) @ scale %.2f", m_layer->uniqueId(),
- m_layer, w, h, scale);
+ XLOGC("%x layer %d %x prepared at size (%d, %d) @ scale %.2f", this, m_layer->uniqueId(),
+ m_layer, w, h, m_scale);
- m_tiledTexture->prepare(state, m_pictureUsed != m_layer->pictureUsed(), startFastSwap);
+ m_tiledTexture->prepare(state, m_scale, m_pictureUsed != m_layer->pictureUsed(),
+ startFastSwap, m_visibleArea);
}
bool PaintedSurface::draw()