New subclasses for both Gr and GrGL gradient effect classes. 

This replaces GrSingleTextureEffect as the base for gradient effects (so we'll be able to do gradient effects without textures), and adds a base class to the GL gradient custom stage implementations (which will soon handle generating the appropriate code to pass colors in and lerp instead of using a cached texture for simpler gradient cases).

Also added a custom stage for linear gradients.
Review URL: https://codereview.appspot.com/6426049

git-svn-id: http://skia.googlecode.com/svn/trunk@4674 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 605b640..4e3baa3 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -441,7 +441,8 @@
                   shader_type_mismatch);
 SK_COMPILE_ASSERT(SkShader::kTwoPointConical_BitmapType == 5,
                   shader_type_mismatch);
-SK_COMPILE_ASSERT(SkShader::kLast_BitmapType == 5, shader_type_mismatch);
+SK_COMPILE_ASSERT(SkShader::kLinear_BitmapType == 6, shader_type_mismatch);
+SK_COMPILE_ASSERT(SkShader::kLast_BitmapType == 6, shader_type_mismatch);
 
 namespace {
 
@@ -607,6 +608,14 @@
                                                 twoPointParams[2])))->unref();
             sampler->setFilter(GrSamplerState::kBilinear_Filter);
             break;
+        case SkShader::kLinear_BitmapType:
+            sampler->setCustomStage(SkNEW_ARGS(GrLinearGradient, (texture)))->unref();
+            if (skPaint.isFilterBitmap()) {
+                sampler->setFilter(GrSamplerState::kBilinear_Filter);
+            } else {
+                sampler->setFilter(GrSamplerState::kNearest_Filter);
+            }
+            break;
         default:
             if (skPaint.isFilterBitmap()) {
                 sampler->setFilter(GrSamplerState::kBilinear_Filter);