Rebase and fix chromium

Combine texture provider and resource provider

Largely mechanical. Only three places that were calling createApprox
via texture provider (ie without flags), so that was simple.

BUG=skia:

Change-Id: I876367bcdc6a8db736deedab1028de1972015509
Reviewed-on: https://skia-review.googlesource.com/9176
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index bbce742..8283910 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -127,7 +127,7 @@
     : fColor(color)
     , fLocalMatrix(localMatrix)
     , fUsesLocalCoords(usesLocalCoords)
-    , fTextureSampler(context->textureProvider(), std::move(proxy), params)
+    , fTextureSampler(context->resourceProvider(), std::move(proxy), params)
     , fInColor(nullptr)
     , fMaskFormat(format) {
     this->initClassID<GrBitmapTextGeoProc>();
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 6a4cca5..d629902 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -219,7 +219,7 @@
     desc.fConfig = kConfig;
 
     sk_sp<GrTextureProxy> dataProxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
-                                                                   context->textureProvider(),
+                                                                   context->resourceProvider(),
                                                                    desc, SkBudgeted::kYes, data, 0);
     if (!dataProxy) {
         return;
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 19f5e2a..a5f68d9 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -234,7 +234,7 @@
                                                            bool usesLocalCoords)
     : fColor(color)
     , fViewMatrix(viewMatrix)
-    , fTextureSampler(context->textureProvider(), std::move(proxy), params)
+    , fTextureSampler(context->resourceProvider(), std::move(proxy), params)
 #ifdef SK_GAMMA_APPLY_TO_A8
     , fDistanceAdjust(distanceAdjust)
 #endif
@@ -481,7 +481,7 @@
         bool usesLocalCoords)
     : fColor(color)
     , fViewMatrix(viewMatrix)
-    , fTextureSampler(context->textureProvider(), std::move(proxy), params)
+    , fTextureSampler(context->resourceProvider(), std::move(proxy), params)
     , fFlags(flags & kNonLCD_DistanceFieldEffectMask)
     , fInColor(nullptr)
     , fUsesLocalCoords(usesLocalCoords) {
@@ -785,7 +785,7 @@
                                                   uint32_t flags, bool usesLocalCoords)
     : fColor(color)
     , fViewMatrix(viewMatrix)
-    , fTextureSampler(context->textureProvider(), std::move(proxy), params)
+    , fTextureSampler(context->resourceProvider(), std::move(proxy), params)
     , fDistanceAdjust(distanceAdjust)
     , fFlags(flags & kLCD_DistanceFieldEffectMask)
     , fUsesLocalCoords(usesLocalCoords) {
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp
index acfc0d1..01cad66 100644
--- a/src/gpu/effects/GrSingleTextureEffect.cpp
+++ b/src/gpu/effects/GrSingleTextureEffect.cpp
@@ -52,7 +52,7 @@
                                              const SkMatrix& m)
         : INHERITED(optFlags)
         , fCoordTransform(ctx, m, proxy.get(), GrSamplerParams::kNone_FilterMode)
-        , fTextureSampler(ctx->textureProvider(), std::move(proxy))
+        , fTextureSampler(ctx->resourceProvider(), std::move(proxy))
         , fColorSpaceXform(std::move(colorSpaceXform)) {
     this->addCoordTransform(&fCoordTransform);
     this->addTextureSampler(&fTextureSampler);
@@ -65,7 +65,7 @@
                                              GrSamplerParams::FilterMode filterMode)
         : INHERITED(optFlags)
         , fCoordTransform(ctx, m, proxy.get(), filterMode)
-        , fTextureSampler(ctx->textureProvider(), std::move(proxy), filterMode)
+        , fTextureSampler(ctx->resourceProvider(), std::move(proxy), filterMode)
         , fColorSpaceXform(std::move(colorSpaceXform)) {
     this->addCoordTransform(&fCoordTransform);
     this->addTextureSampler(&fTextureSampler);
@@ -77,7 +77,7 @@
                                              const SkMatrix& m, const GrSamplerParams& params)
         : INHERITED(optFlags)
         , fCoordTransform(ctx, m, proxy.get(), params.filterMode())
-        , fTextureSampler(ctx->textureProvider(), std::move(proxy), params)
+        , fTextureSampler(ctx->resourceProvider(), std::move(proxy), params)
         , fColorSpaceXform(std::move(colorSpaceXform)) {
     this->addCoordTransform(&fCoordTransform);
     this->addTextureSampler(&fTextureSampler);
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 39bc3cc..2ac6af8 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -423,7 +423,7 @@
         const SkIRect& subset,
         const SkIPoint& deviceSpaceOffset)
         : INHERITED(kCompatibleWithCoverageAsAlpha_OptimizationFlag)
-        , fTextureSampler(context->textureProvider(), proxy, GrSamplerParams::ClampNoFilter())
+        , fTextureSampler(context->resourceProvider(), proxy, GrSamplerParams::ClampNoFilter())
         , fTextureDomain(proxy.get(), GrTextureDomain::MakeTexelDomain(subset),
                          GrTextureDomain::kDecal_Mode) {
     this->addTextureSampler(&fTextureSampler);
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index 1791b20..df36e65 100644
--- a/src/gpu/effects/GrTextureStripAtlas.cpp
+++ b/src/gpu/effects/GrTextureStripAtlas.cpp
@@ -10,7 +10,6 @@
 #include "GrContextPriv.h"
 #include "GrResourceProvider.h"
 #include "GrSurfaceContext.h"
-#include "GrTextureProvider.h"
 #include "SkGr.h"
 #include "SkPixelRef.h"
 #include "SkTSearch.h"
@@ -209,9 +208,9 @@
     builder.finish();
 
     // MDB TODO (caching): this side-steps the issue of proxies with unique IDs
-    sk_sp<GrTexture> texture(fDesc.fContext->textureProvider()->findAndRefTextureByUniqueKey(key));
+    sk_sp<GrTexture> texture(fDesc.fContext->resourceProvider()->findAndRefTextureByUniqueKey(key));
     if (!texture) {
-        texture.reset(fDesc.fContext->textureProvider()->createTexture(
+        texture.reset(fDesc.fContext->resourceProvider()->createTexture(
                                                         texDesc, SkBudgeted::kYes,
                                                         nullptr, 0,
                                                         GrResourceProvider::kNoPendingIO_Flag));
@@ -219,7 +218,7 @@
             return;
         }
 
-        fDesc.fContext->textureProvider()->assignUniqueKeyToTexture(key, texture.get());
+        fDesc.fContext->resourceProvider()->assignUniqueKeyToTexture(key, texture.get());
         // This is a new texture, so all of our cache info is now invalid
         this->initLRU();
         fKeyTable.rewind();
diff --git a/src/gpu/effects/GrYUVEffect.cpp b/src/gpu/effects/GrYUVEffect.cpp
index e09e185..78ac9ba 100644
--- a/src/gpu/effects/GrYUVEffect.cpp
+++ b/src/gpu/effects/GrYUVEffect.cpp
@@ -159,10 +159,10 @@
                    GrSamplerParams::FilterMode uvFilterMode, SkYUVColorSpace colorSpace, bool nv12)
             : INHERITED(kPreservesOpaqueInput_OptimizationFlag)
             , fYTransform(ctx, yuvMatrix[0], yProxy.get(), GrSamplerParams::kNone_FilterMode)
-            , fYSampler(ctx->textureProvider(), std::move(yProxy))
+            , fYSampler(ctx->resourceProvider(), std::move(yProxy))
             , fUTransform(ctx, yuvMatrix[1], uProxy.get(), uvFilterMode)
-            , fUSampler(ctx->textureProvider(), std::move(uProxy), uvFilterMode)
-            , fVSampler(ctx->textureProvider(), vProxy, uvFilterMode)
+            , fUSampler(ctx->resourceProvider(), std::move(uProxy), uvFilterMode)
+            , fVSampler(ctx->resourceProvider(), vProxy, uvFilterMode)
             , fColorSpace(colorSpace)
             , fNV12(nv12) {
         this->initClassID<YUVtoRGBEffect>();
diff --git a/src/gpu/effects/GrYUVEffect.h b/src/gpu/effects/GrYUVEffect.h
index 6af442e..524928b 100644
--- a/src/gpu/effects/GrYUVEffect.h
+++ b/src/gpu/effects/GrYUVEffect.h
@@ -12,7 +12,6 @@
 
 class GrContext;
 class GrFragmentProcessor;
-class GrTextureProvider;
 class GrTextureProxy;
 
 namespace GrYUVEffect {