Add support for text culling.

Change-Id: Ibf0adacdc5c64d40a8000b21d7cb0797d63efe29
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 8f04d92..58a3a69 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -530,11 +530,6 @@
 }
 
 void OpenGLRenderer::drawText(const char* text, int count, float x, float y, SkPaint* paint) {
-    // TODO: Support paint's text alignments, proper clipping
-    if (quickReject(x, y, x + 1, y +1)) {
-        return;
-    }
-
     int alpha;
     SkXfermode::Mode mode;
     getAlphaAndMode(paint, &alpha, &mode);
@@ -556,8 +551,11 @@
     // Always premultiplied
     glUniform4f(mDrawTextProgram->color, r, g, b, a);
 
+    // TODO: Implement scale properly
+    const Rect& clip = mSnapshot->getLocalClip();
+
     mFontRenderer.setFont(SkTypeface::UniqueID(paint->getTypeface()), paint->getTextSize());
-    mFontRenderer.renderText(paint, text, count, 0, count, x, y);
+    mFontRenderer.renderText(paint, &clip, text, count, 0, count, x, y);
 
     glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
 }