Reland of SkShaderBase

Introduce a private base class (SkShaderBase), to hide
implementation details from the public interface (SkShader).

Change-Id: Ib1d76cde880bd51868b97408710f8bb38128e536
Reviewed-on: https://skia-review.googlesource.com/17925
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/gm/SkLinearBitmapPipelineGM.cpp b/gm/SkLinearBitmapPipelineGM.cpp
index f07d2f7..87566ad 100644
--- a/gm/SkLinearBitmapPipelineGM.cpp
+++ b/gm/SkLinearBitmapPipelineGM.cpp
@@ -16,7 +16,7 @@
 #include "SkLinearBitmapPipeline.h"
 #include "SkXfermodePriv.h"
 #include "SkPM4fPriv.h"
-#include "SkShader.h"
+#include "SkShaderBase.h"
 
 static void fill_in_bits(SkBitmap& bm, SkIRect ir, SkColor c, bool premul) {
     bm.allocN32Pixels(ir.width(), ir.height());
@@ -72,11 +72,11 @@
         paint.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality);
     }
     paint.setShader(std::move(shader));
-    const SkShader::ContextRec rec(paint, *mat, nullptr,
-                                   SkBlitter::PreferredShaderDest(pmsrc.info()),
-                                   canvas->imageInfo().colorSpace());
+    const SkShaderBase::ContextRec rec(paint, *mat, nullptr,
+                                       SkBlitter::PreferredShaderDest(pmsrc.info()),
+                                       canvas->imageInfo().colorSpace());
 
-    SkShader::Context* ctx = paint.getShader()->makeContext(rec, &alloc);
+    SkShaderBase::Context* ctx = as_SB(paint.getShader())->makeContext(rec, &alloc);
 
     for (int y = 0; y < ir.height(); y++) {
         ctx->shadeSpan(0, y, pmdst.writable_addr32(0, y), ir.width());