Glop path texture support

Change-Id: I505eb05991ca4c9b2e01e49988b8f962fad51462
diff --git a/libs/hwui/GlopBuilder.cpp b/libs/hwui/GlopBuilder.cpp
index e56988c..91e0f89 100644
--- a/libs/hwui/GlopBuilder.cpp
+++ b/libs/hwui/GlopBuilder.cpp
@@ -246,6 +246,7 @@
 
     mOutGlop->fill.texture = &texture;
     mOutGlop->fill.textureFilter = PaintUtils::getFilter(paint);
+    mOutGlop->fill.textureClamp = GL_CLAMP_TO_EDGE;
 
     if (paint) {
         int color = paint->getColor();
@@ -289,7 +290,8 @@
     REQUIRE_STAGES(kMeshStage);
 
     mOutGlop->fill.texture = nullptr;
-    mOutGlop->fill.textureFilter = GL_NEAREST;
+    mOutGlop->fill.textureFilter = GL_INVALID_ENUM;
+    mOutGlop->fill.textureClamp = GL_INVALID_ENUM;
 
     setFill(paint.getColor(), alphaScale, PaintUtils::getXfermode(paint.getXfermode()),
             paint.getShader(), paint.getColorFilter());
@@ -297,6 +299,27 @@
     return *this;
 }
 
+GlopBuilder& GlopBuilder::setFillPathTexturePaint(Texture& texture,
+        const SkPaint& paint, float alphaScale) {
+    TRIGGER_STAGE(kFillStage);
+    REQUIRE_STAGES(kMeshStage);
+
+    mOutGlop->fill.texture = &texture;
+
+    //specify invalid, since these are always static for path textures
+    mOutGlop->fill.textureFilter = GL_INVALID_ENUM;
+    mOutGlop->fill.textureClamp = GL_INVALID_ENUM;
+
+    setFill(paint.getColor(), alphaScale, PaintUtils::getXfermode(paint.getXfermode()),
+            paint.getShader(), paint.getColorFilter());
+
+    mDescription.modulate = mOutGlop->fill.color.a < 1.0f
+            || mOutGlop->fill.color.r > 0.0f
+            || mOutGlop->fill.color.g > 0.0f
+            || mOutGlop->fill.color.b > 0.0f;
+    return *this;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // Transform
 ////////////////////////////////////////////////////////////////////////////////
@@ -311,7 +334,6 @@
     return *this;
 }
 
-
 ////////////////////////////////////////////////////////////////////////////////
 // ModelView
 ////////////////////////////////////////////////////////////////////////////////