Fixed color bleeding issue when drawing a sub region of a bitmap with filtering enabled.
Problem was resolved by adding the notion of a custom texture domain in generated shaders, when necessary.




git-svn-id: http://skia.googlecode.com/svn/trunk@1337 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGLProgram.h b/gpu/src/GrGLProgram.h
index 1611ca2..74078e3 100644
--- a/gpu/src/GrGLProgram.h
+++ b/gpu/src/GrGLProgram.h
@@ -70,14 +70,6 @@
      */
     void doGLPost() const;
 
-    /**
-     *  Configures the GrGLProgram based on the state of a GrDrawTarget
-     *  object.  This is the fast and light initialization. Retrieves all the
-     *  state that is required for performing the heavy init (i.e. genProgram),
-     *  or for retrieving heavy init results from cache.
-     */
-    void buildFromTarget(const GrDrawTarget* target);
-
     static int PositionAttributeIdx() { return 0; }
     static int TexCoordAttributeIdx(int tcIdx) { return 1 + tcIdx; }
     static int ColorAttributeIdx() { return 1 + GrDrawTarget::kMaxTexCoords; }
@@ -114,8 +106,9 @@
 
         struct StageDesc {
             enum OptFlagBits {
-                kNoPerspective_OptFlagBit  = 0x1,
-                kIdentityMatrix_OptFlagBit = 0x2
+                kNoPerspective_OptFlagBit       = 1 << 0,
+                kIdentityMatrix_OptFlagBit      = 1 << 1,
+                kCustomTextureDomain_OptFlagBit = 1 << 2
             };
 
             unsigned fOptFlags;
@@ -153,11 +146,13 @@
         GrGLint fNormalizedTexelSizeUni;
         GrGLint fSamplerUni;
         GrGLint fRadial2Uni;
+        GrGLint fTexDomUni;
         void reset() {
             fTextureMatrixUni = kUnusedUniform;
             fNormalizedTexelSizeUni = kUnusedUniform;
             fSamplerUni = kUnusedUniform;
             fRadial2Uni = kUnusedUniform;
+            fTexDomUni = kUnusedUniform;
         }
     };