summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/GLWebViewState.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-04-04 18:40:11 -0700
committerNicolas Roard <nicolasroard@google.com>2011-04-07 17:19:47 -0700
commitbe61abb47b98988ca94bd839a1e17c3267365dc9 (patch)
tree882e56d46a248c276fe2d8a672738696f68f3279 /WebCore/platform/graphics/android/GLWebViewState.cpp
parente4cbbfc01b360475415d07bc3a4276fc46e828b9 (diff)
downloadexternal_webkit-be61abb47b98988ca94bd839a1e17c3267365dc9.zip
external_webkit-be61abb47b98988ca94bd839a1e17c3267365dc9.tar.gz
external_webkit-be61abb47b98988ca94bd839a1e17c3267365dc9.tar.bz2
Fix for bug:4183801
The computation for the invalidated / clipping rects were wrong, sometimes causing the linked bug when layers had a transparent background (they were not obeying the clipping rect passed by the framework). java counterpart CL: https://android-git.corp.google.com/g/#change,105503 Change-Id: I60769e7cbf1a3a939724c57b3d3ce63a6f87aa87
Diffstat (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r--WebCore/platform/graphics/android/GLWebViewState.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp
index e5034d4..6f95836 100644
--- a/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -380,10 +380,15 @@ void GLWebViewState::resetFrameworkInval()
void GLWebViewState::addDirtyArea(const IntRect& rect)
{
+ if (rect.isEmpty())
+ return;
+
+ IntRect inflatedRect = rect;
+ inflatedRect.inflate(8);
if (m_frameworkLayersInval.isEmpty())
- m_frameworkLayersInval = rect;
+ m_frameworkLayersInval = inflatedRect;
else
- m_frameworkLayersInval.unite(rect);
+ m_frameworkLayersInval.unite(inflatedRect);
}
void GLWebViewState::resetLayersDirtyArea()
@@ -395,7 +400,8 @@ void GLWebViewState::resetLayersDirtyArea()
}
bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
- float scale, SkColor color)
+ IntRect& webViewRect, int titleBarHeight,
+ IntRect& clip, float scale, SkColor color)
{
glFinish();
@@ -437,16 +443,18 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
if (baseForComposited && baseForComposited->countChildren() >= 1)
compositedRoot = static_cast<LayerAndroid*>(baseForComposited->getChild(0));
- bool ret = baseLayer->drawGL(compositedRoot, rect, viewport, scale, color);
+ bool ret = baseLayer->drawGL(compositedRoot, rect, viewport, webViewRect, titleBarHeight, clip, scale, color);
m_previouslyUsedRoot = compositedRoot;
if (ret) {
- IntRect inval = m_frameworkInval;
+ FloatRect frameworkInval = TilesManager::instance()->shader()->rectInInvScreenCoord(m_frameworkInval);
+ IntRect inval(frameworkInval.x(), frameworkInval.y(), frameworkInval.width(), frameworkInval.height());
+
inval.unite(m_frameworkLayersInval);
- invalRect->setX((- viewport.fLeft + inval.x()) * scale);
- invalRect->setY((- viewport.fTop + inval.y()) * scale);
- invalRect->setWidth(inval.width() * scale);
- invalRect->setHeight(inval.height() * scale);
+ invalRect->setX(inval.x());
+ invalRect->setY(inval.y());
+ invalRect->setWidth(inval.width());
+ invalRect->setHeight(inval.height());
XLOG("invalRect(%d, %d, %d, %d)", inval.x(),
inval.y(), inval.right(), inval.bottom());