Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp

Issue 7210023: Merge 88386 - 2011-06-08 John Bauman <jbauman@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp (revision 89272)
+++ Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp (working copy)
@@ -346,6 +346,7 @@
int left, top, right, bottom;
contentRectToTileIndices(contentRect, left, top, right, bottom);
+ IntRect layerRect = contentRectToLayerRect(contentRect);
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
Tile* tile = tileAt(i, j);
@@ -359,10 +360,15 @@
// Don't use tileContentRect here, as that contains the full
// rect with border texels which shouldn't be drawn.
IntRect tileRect = m_tilingData.tileBounds(m_tilingData.tileIndex(tile->i(), tile->j()));
+ IntRect displayRect = tileRect;
+ tileRect.intersect(layerRect);
+ // Keep track of how the top left has moved, so the texture can be
+ // offset the same amount.
+ IntSize offset = tileRect.minXMinYCorner() - displayRect.minXMinYCorner();
tileRect.move(m_layerPosition.x(), m_layerPosition.y());
tileMatrix.translate3d(tileRect.x() + tileRect.width() / 2.0, tileRect.y() + tileRect.height() / 2.0, 0);
- IntPoint texOffset = m_tilingData.textureOffset(tile->i(), tile->j());
+ IntPoint texOffset = m_tilingData.textureOffset(tile->i(), tile->j()) + offset;
float tileWidth = static_cast<float>(m_tileSize.width());
float tileHeight = static_cast<float>(m_tileSize.height());
float texTranslateX = texOffset.x() / tileWidth;
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698