From be61abb47b98988ca94bd839a1e17c3267365dc9 Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Mon, 4 Apr 2011 18:40:11 -0700 Subject: 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 --- .../platform/graphics/android/GLWebViewState.cpp | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp') 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(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()); -- cgit v1.1