PixelCopy fixes

Bug: 27708453

Fixes some issues with camera sources. Previously
it was using GL_TEXTURE_2D target which doesn't
work properly if the source is YUV. It is critical
to ensure GL_TEXTURE_EXTERNAL_OES is used throughout
so the right sampler is used.

Change-Id: I0dcd8941ba08331f24809467b0e828663a38e93b
diff --git a/libs/hwui/GlopBuilder.cpp b/libs/hwui/GlopBuilder.cpp
index 7d4f410..fdbe76a 100644
--- a/libs/hwui/GlopBuilder.cpp
+++ b/libs/hwui/GlopBuilder.cpp
@@ -471,6 +471,21 @@
     return *this;
 }
 
+GlopBuilder& GlopBuilder::setFillExternalTexture(Texture& texture) {
+    TRIGGER_STAGE(kFillStage);
+    REQUIRE_STAGES(kMeshStage | kRoundRectClipStage);
+
+    mOutGlop->fill.texture = { &texture,
+            GL_TEXTURE_EXTERNAL_OES, GL_LINEAR, GL_CLAMP_TO_EDGE,
+            nullptr };
+
+    setFill(SK_ColorWHITE, 1.0f, SkXfermode::kSrc_Mode, Blend::ModeOrderSwap::NoSwap,
+            nullptr, nullptr);
+
+    mDescription.modulate = mOutGlop->fill.color.a < 1.0f;
+    return *this;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // Transform
 ////////////////////////////////////////////////////////////////////////////////