diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2012-04-12 09:44:01 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-04-12 09:44:01 -0700 |
commit | c5dcbf89c81ccb7d1de3038952bddf06ce821277 (patch) | |
tree | 21d69d922a7a3ce91f2e8d050c06c12c226f3291 /Source | |
parent | a35f2cdc8e1872f5e4baadbf3f177d88cde061ee (diff) | |
parent | d08dc21a96bd91ee23a4419266186cadb4b43681 (diff) | |
download | external_webkit-c5dcbf89c81ccb7d1de3038952bddf06ce821277.zip external_webkit-c5dcbf89c81ccb7d1de3038952bddf06ce821277.tar.gz external_webkit-c5dcbf89c81ccb7d1de3038952bddf06ce821277.tar.bz2 |
Merge "Correct viewport for GL drawing when webview is on FBO"
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebKit/android/nav/WebView.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 44ad1c5..22598eb 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -711,13 +711,17 @@ class GLDrawFunctor : Functor { int titlebarHeight = webViewRect.height() - viewRect.height(); uirenderer::DrawGlInfo* info = reinterpret_cast<uirenderer::DrawGlInfo*>(data); - WebCore::IntRect localViewRect = viewRect; - if (info->isLayer) - localViewRect.move(-1 * localViewRect.x(), -1 * localViewRect.y()); - WebCore::IntRect clip(info->clipLeft, info->clipTop, info->clipRight - info->clipLeft, info->clipBottom - info->clipTop); + + WebCore::IntRect localViewRect = viewRect; + if (info->isLayer) { + // When webview is on a layer, we need to use the viewport relative + // to the FBO, rather than the screen(which will use viewRect). + localViewRect.setX(clip.x()); + localViewRect.setY(info->height - clip.y() - clip.height()); + } bool shouldDraw = (messageId == uirenderer::DrawGlInfo::kModeDraw); TilesManager::instance()->shader()->setWebViewMatrix(info->transform, info->isLayer); int returnFlags = (*wvInstance.*funcPtr)(localViewRect, &inval, webViewRect, |