OSDN Git Service

Fix extras clipping
authorJohn Reck <jreck@google.com>
Mon, 7 Nov 2011 19:21:27 +0000 (11:21 -0800)
committerJohn Reck <jreck@google.com>
Tue, 8 Nov 2011 00:04:14 +0000 (16:04 -0800)
 Bug: 5556494

Change-Id: I82e8282271dfc623afa9b1ef0d0061ca9c3df5f4

Source/WebCore/platform/graphics/android/GLExtras.cpp
Source/WebCore/platform/graphics/android/GLWebViewState.cpp

index c6cb7f3..873ea33 100644 (file)
@@ -202,8 +202,6 @@ void GLExtras::drawFindOnPage(SkRect& viewport)
 void GLExtras::drawGL(IntRect& webViewRect, SkRect& viewport, int titleBarHeight)
 {
     if (m_drawExtra) {
-        // TODO: Support clipping
-        glDisable(GL_SCISSOR_TEST);
         if (m_drawExtra == m_ring)
             drawCursorRings();
         else if (m_drawExtra == m_findOnPage)
@@ -211,6 +209,5 @@ void GLExtras::drawGL(IntRect& webViewRect, SkRect& viewport, int titleBarHeight
         else
             XLOGC("m_drawExtra %p is unknown! (cursor: %p, find: %p",
                   m_drawExtra, m_ring, m_findOnPage);
-        glEnable(GL_SCISSOR_TEST);
     }
 }
index a44a743..489a337 100644 (file)
@@ -474,6 +474,8 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
     double currentTime = setupDrawing(rect, viewport, webViewRect, titleBarHeight, clip, scale);
     ret |= baseLayer->drawGL(currentTime, compositedRoot, rect,
                                  viewport, scale, buffersSwappedPtr);
+    FloatRect extrasclip(0, 0, rect.width(), rect.height());
+    TilesManager::instance()->shader()->clip(extrasclip);
     m_glExtras.drawGL(webViewRect, viewport, titleBarHeight);
 
     glBindBuffer(GL_ARRAY_BUFFER, 0);