OSDN Git Service

Fix for FBO offset when drawing with alpha
authorRussell Brenner <russellbrenner@google.com>
Fri, 18 Mar 2011 20:57:51 +0000 (13:57 -0700)
committerRussell Brenner <russellbrenner@google.com>
Fri, 18 Mar 2011 23:24:57 +0000 (16:24 -0700)
Use new DrawGlInfo struct to detect when drawing to an FBO and adjust
topLeft of destination to (0,0).

Bug: 3275491
Change-Id: Ia3ef85d6a21475dbd27743a15edd9d16d0d9cc9e

WebKit/android/nav/WebView.cpp

index ea311ae..3a156de 100644 (file)
@@ -1490,9 +1490,14 @@ class GLDrawFunctor : Functor {
 
         WebCore::IntRect inval;
         int titlebarHeight = webViewRect.height() - viewRect.height();
-        bool retVal = (*wvInstance.*funcPtr)(viewRect, &inval, scale, extras);
+
+        uirenderer::DrawGlInfo* info = reinterpret_cast<uirenderer::DrawGlInfo*>(data);
+        WebCore::IntRect localViewRect = viewRect;
+        if (info->isLayer)
+            localViewRect.move(-1 * localViewRect.x(), -1 * localViewRect.y());
+
+        bool retVal = (*wvInstance.*funcPtr)(localViewRect, &inval, scale, extras);
         if (retVal) {
-            uirenderer::DrawGlInfo* info = reinterpret_cast<uirenderer::DrawGlInfo*>(data);
             IntRect finalInval;
             if (inval.isEmpty()) {
                 finalInval = webViewRect;