Move texture upload behavior to TextureState

Change-Id: If1cb32bbc04f437fa0d079084de832de9fd777c2
diff --git a/libs/hwui/renderstate/TextureState.h b/libs/hwui/renderstate/TextureState.h
index d3c014c..3a2b85a 100644
--- a/libs/hwui/renderstate/TextureState.h
+++ b/libs/hwui/renderstate/TextureState.h
@@ -23,9 +23,13 @@
 #include <SkXfermode.h>
 #include <memory>
 
+class SkBitmap;
+
 namespace android {
 namespace uirenderer {
 
+class Texture;
+
 class TextureState {
     friend class Caches; // TODO: move to RenderState
 public:
@@ -71,6 +75,14 @@
      * Clear the cache of bound textures.
      */
     void unbindTexture(GLuint texture);
+
+    /**
+     * Generates the texture from a bitmap into the specified texture structure.
+     *
+     * @param regenerate If true, the bitmap data is reuploaded into the texture, but
+     *        no new texture is generated.
+     */
+    void generateTexture(const SkBitmap* bitmap, Texture* texture, bool regenerate);
 private:
     // total number of texture units available for use
     static const int kTextureUnitsCount = 4;