Remove GrGpu.h from GrResourceProvider.h

Noticed this while cleaning up GrResourceProvider.h's usage. It seems like a powerful header to just be splashing around.

Change-Id: I686fea61354a7e3c1c759627ffe4a560f7945f83
Reviewed-on: https://skia-review.googlesource.com/20040
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/gn/gpu.gni b/gn/gpu.gni
index 9dee9f5..fab5d97 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -282,6 +282,7 @@
   "$_src/gpu/ops/GrSmallPathRenderer.h",
   "$_src/gpu/ops/GrStencilAndCoverPathRenderer.cpp",
   "$_src/gpu/ops/GrStencilAndCoverPathRenderer.h",
+  "$_src/gpu/ops/GrStencilPathOp.cpp",
   "$_src/gpu/ops/GrStencilPathOp.h",
   "$_src/gpu/ops/GrTessellatingPathRenderer.cpp",
   "$_src/gpu/ops/GrTessellatingPathRenderer.h",
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index c2cb6dc..50264ef 100644
--- a/src/gpu/GrResourceProvider.h
+++ b/src/gpu/GrResourceProvider.h
@@ -8,12 +8,14 @@
 #ifndef GrResourceProvider_DEFINED
 #define GrResourceProvider_DEFINED
 
+#include "GrBackendSurface.h"
 #include "GrBuffer.h"
-#include "GrGpu.h"
 #include "GrPathRange.h"
 #include "SkImageInfo.h"
+#include "SkScalerContext.h"
 
 class GrBackendRenderTarget;
+class GrGpu;
 class GrPath;
 class GrRenderTarget;
 class GrSemaphore;
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 161b62b..c98f1da 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -12,6 +12,7 @@
 #include "GrPipelineBuilder.h"
 #include "GrResourceProvider.h"
 #include "GrSWMaskHelper.h"
+#include "ops/GrDrawOp.h"
 #include "ops/GrRectOpFactory.h"
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp
index 86027dd..be29857 100644
--- a/src/gpu/GrTextureAdjuster.cpp
+++ b/src/gpu/GrTextureAdjuster.cpp
@@ -8,6 +8,7 @@
 #include "GrTextureAdjuster.h"
 
 #include "GrContext.h"
+#include "GrGpu.h"
 #include "GrResourceProvider.h"
 #include "SkGr.h"
 
diff --git a/src/gpu/gl/GrGLGpuCommandBuffer.h b/src/gpu/gl/GrGLGpuCommandBuffer.h
index c6e7208..324b4d0 100644
--- a/src/gpu/gl/GrGLGpuCommandBuffer.h
+++ b/src/gpu/gl/GrGLGpuCommandBuffer.h
@@ -10,9 +10,9 @@
 
 #include "GrGpuCommandBuffer.h"
 
-#include "GrGLGpu.h"
 #include "GrOpFlushState.h"
 
+class GrGLGpu;
 class GrGLRenderTarget;
 
 class GrGLGpuCommandBuffer : public GrGpuCommandBuffer {
diff --git a/src/gpu/gl/GrGLSemaphore.h b/src/gpu/gl/GrGLSemaphore.h
index 40dc53b..f439ebd 100644
--- a/src/gpu/gl/GrGLSemaphore.h
+++ b/src/gpu/gl/GrGLSemaphore.h
@@ -10,7 +10,7 @@
 
 #include "GrSemaphore.h"
 
-#include "GrGLGpu.h"
+class GrGLGpu;
 
 class GrGLSemaphore : public GrSemaphore {
 public:
diff --git a/src/gpu/gl/GrGLTextureRenderTarget.h b/src/gpu/gl/GrGLTextureRenderTarget.h
index e6eb195..d74239e 100644
--- a/src/gpu/gl/GrGLTextureRenderTarget.h
+++ b/src/gpu/gl/GrGLTextureRenderTarget.h
@@ -13,8 +13,6 @@
 #include "GrGLTexture.h"
 #include "GrGLRenderTarget.h"
 
-class GrGLGpu;
-
 #ifdef SK_BUILD_FOR_WIN
 // Windows gives bogus warnings about inheriting asTexture/asRenderTarget via dominance.
 #pragma warning(push)
diff --git a/src/gpu/ops/GrMeshDrawOp.cpp b/src/gpu/ops/GrMeshDrawOp.cpp
index d1367e9..48f2ea6 100644
--- a/src/gpu/ops/GrMeshDrawOp.cpp
+++ b/src/gpu/ops/GrMeshDrawOp.cpp
@@ -5,6 +5,7 @@
  * found in the LICENSE file.
  */
 
+#include "GrGpuCommandBuffer.h"
 #include "GrMeshDrawOp.h"
 #include "GrOpFlushState.h"
 #include "GrResourceProvider.h"
diff --git a/src/gpu/ops/GrStencilPathOp.cpp b/src/gpu/ops/GrStencilPathOp.cpp
new file mode 100644
index 0000000..01042f6
--- /dev/null
+++ b/src/gpu/ops/GrStencilPathOp.cpp
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrStencilPathOp.h"
+
+#include "GrGpu.h"
+#include "GrOpFlushState.h"
+
+void GrStencilPathOp::onExecute(GrOpFlushState* state) {
+    SkASSERT(state->drawOpArgs().fRenderTarget);
+
+    GrPathRendering::StencilPathArgs args(fUseHWAA, state->drawOpArgs().fRenderTarget,
+                                          &fViewMatrix, &fScissor, &fStencil);
+    state->gpu()->pathRendering()->stencilPath(args, fPath.get());
+}
+
diff --git a/src/gpu/ops/GrStencilPathOp.h b/src/gpu/ops/GrStencilPathOp.h
index 5b308f0..45240be 100644
--- a/src/gpu/ops/GrStencilPathOp.h
+++ b/src/gpu/ops/GrStencilPathOp.h
@@ -9,11 +9,12 @@
 #define GrStencilPathOp_DEFINED
 
 #include "GrOp.h"
-#include "GrOpFlushState.h"
 #include "GrPath.h"
 #include "GrPathRendering.h"
 #include "GrStencilSettings.h"
 
+class GrOpFlushState;
+
 class GrStencilPathOp final : public GrOp {
 public:
     DEFINE_OP_CLASS_ID
@@ -62,13 +63,7 @@
 
     void onPrepare(GrOpFlushState*) override {}
 
-    void onExecute(GrOpFlushState* state) override {
-        SkASSERT(state->drawOpArgs().fRenderTarget);
-
-        GrPathRendering::StencilPathArgs args(fUseHWAA, state->drawOpArgs().fRenderTarget,
-                                              &fViewMatrix, &fScissor, &fStencil);
-        state->gpu()->pathRendering()->stencilPath(args, fPath.get());
-    }
+    void onExecute(GrOpFlushState* state) override;
 
     SkMatrix                                          fViewMatrix;
     bool                                              fUseHWAA;
diff --git a/tests/CopySurfaceTest.cpp b/tests/CopySurfaceTest.cpp
index 2e35256..8dfca0c 100644
--- a/tests/CopySurfaceTest.cpp
+++ b/tests/CopySurfaceTest.cpp
@@ -14,6 +14,7 @@
 #include "GrResourceProvider.h"
 #include "GrSurfaceContext.h"
 #include "GrSurfaceProxy.h"
+#include "GrTextureProxy.h"
 
 #include "SkUtils.h"
 
diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp
index ed68e91..06a99a5 100644
--- a/tests/FloatingPointTextureTest.cpp
+++ b/tests/FloatingPointTextureTest.cpp
@@ -19,6 +19,7 @@
 #include "GrContext.h"
 #include "GrContextPriv.h"
 #include "GrResourceProvider.h"
+#include "GrTextureProxy.h"
 #include "SkHalf.h"
 
 static const int DEV_W = 100, DEV_H = 100;
diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp
index 0811982..e4663e1 100644
--- a/tests/GrMeshTest.cpp
+++ b/tests/GrMeshTest.cpp
@@ -12,6 +12,7 @@
 
 #include "GrContext.h"
 #include "GrGeometryProcessor.h"
+#include "GrGpuCommandBuffer.h"
 #include "GrOpFlushState.h"
 #include "GrRenderTargetContext.h"
 #include "GrRenderTargetContextPriv.h"
diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp
index f3dd273..6c01400 100644
--- a/tests/GrPipelineDynamicStateTest.cpp
+++ b/tests/GrPipelineDynamicStateTest.cpp
@@ -13,6 +13,7 @@
 #include "GrContext.h"
 #include "GrColor.h"
 #include "GrGeometryProcessor.h"
+#include "GrGpuCommandBuffer.h"
 #include "GrOpFlushState.h"
 #include "GrRenderTargetContext.h"
 #include "GrRenderTargetContextPriv.h"
diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp
index 2334172..7088570 100644
--- a/tests/ImageFilterCacheTest.cpp
+++ b/tests/ImageFilterCacheTest.cpp
@@ -181,8 +181,10 @@
 #include "GrContext.h"
 #include "GrContextPriv.h"
 #include "GrResourceProvider.h"
+#include "GrSurfaceProxyPriv.h"
 #include "GrTest.h"
 #include "GrTexture.h"
+#include "GrTextureProxy.h"
 
 static sk_sp<GrTextureProxy> create_proxy(GrResourceProvider* resourceProvider) {
     SkBitmap srcBM = create_bm();
diff --git a/tests/PackedConfigsTextureTest.cpp b/tests/PackedConfigsTextureTest.cpp
index 916f27a..f91fc42 100644
--- a/tests/PackedConfigsTextureTest.cpp
+++ b/tests/PackedConfigsTextureTest.cpp
@@ -17,6 +17,7 @@
 #include "GrContext.h"
 #include "GrContextPriv.h"
 #include "GrResourceProvider.h"
+#include "GrTextureProxy.h"
 
 static const int DEV_W = 10, DEV_H = 10;
 static const SkIRect DEV_RECT = SkIRect::MakeWH(DEV_W, DEV_H);
diff --git a/tests/ProxyConversionTest.cpp b/tests/ProxyConversionTest.cpp
index 98f0985..513b680 100644
--- a/tests/ProxyConversionTest.cpp
+++ b/tests/ProxyConversionTest.cpp
@@ -11,6 +11,7 @@
 
 #if SK_SUPPORT_GPU
 #include "GrBackendSurface.h"
+#include "GrRenderTarget.h"
 #include "GrRenderTargetProxy.h"
 #include "GrResourceProvider.h"
 #include "GrSurfaceProxy.h"
diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp
index 61e5720..04510b3 100644
--- a/tests/ProxyRefTest.cpp
+++ b/tests/ProxyRefTest.cpp
@@ -11,6 +11,7 @@
 
 #if SK_SUPPORT_GPU
 #include "GrContextPriv.h"
+#include "GrGpuResourceRef.h"
 #include "GrRenderTargetProxy.h"
 #include "GrResourceProvider.h"
 #include "GrSurfaceProxy.h"
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp
index 531159f..344400c 100644
--- a/tests/ReadWriteAlphaTest.cpp
+++ b/tests/ReadWriteAlphaTest.cpp
@@ -15,6 +15,7 @@
 #include "GrResourceProvider.h"
 #include "GrSurfaceContext.h"
 #include "GrSurfaceProxy.h"
+#include "GrTextureProxy.h"
 #include "SkCanvas.h"
 #include "SkSurface.h"