Remove GrContextPriv.h from GrRenderTargetContext.h
Change-Id: Ib3afe6d8f2f9607eededb4dd4ef9dbe305741cfb
Reviewed-on: https://skia-review.googlesource.com/c/192829
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 6ec73e7..a840bf5 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -7,6 +7,7 @@
#include "GrClipStackClip.h"
#include "GrAppliedClip.h"
+#include "GrContextPriv.h"
#include "GrDeferredProxyUploader.h"
#include "GrDrawingManager.h"
#include "GrFixedClip.h"
diff --git a/src/gpu/GrGpuCommandBuffer.cpp b/src/gpu/GrGpuCommandBuffer.cpp
index 2684219..bf8f062 100644
--- a/src/gpu/GrGpuCommandBuffer.cpp
+++ b/src/gpu/GrGpuCommandBuffer.cpp
@@ -7,8 +7,9 @@
#include "GrGpuCommandBuffer.h"
-#include "GrContext.h"
#include "GrCaps.h"
+#include "GrContext.h"
+#include "GrContextPriv.h"
#include "GrFixedClip.h"
#include "GrGpu.h"
#include "GrMesh.h"
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 7d5918b..578f77f 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1702,6 +1702,10 @@
this->getRTOpList()->addOp(std::move(op), *this->caps());
}
+const GrCaps* GrRenderTargetContext::caps() const {
+ return fContext->priv().caps();
+}
+
void GrRenderTargetContext::drawPath(const GrClip& clip,
GrPaint&& paint,
GrAA aa,
diff --git a/src/gpu/GrRenderTargetContext.h b/src/gpu/GrRenderTargetContext.h
index bf2f210..2ab6ecd 100644
--- a/src/gpu/GrRenderTargetContext.h
+++ b/src/gpu/GrRenderTargetContext.h
@@ -10,7 +10,6 @@
#include "../private/GrRenderTargetProxy.h"
#include "GrContext.h"
-#include "GrContextPriv.h"
#include "GrPaint.h"
#include "GrSurfaceContext.h"
#include "GrTypesPriv.h"
@@ -378,7 +377,7 @@
void insertEventMarker(const SkString&);
GrFSAAType fsaaType() const { return fRenderTargetProxy->fsaaType(); }
- const GrCaps* caps() const { return fContext->priv().caps(); }
+ const GrCaps* caps() const;
int width() const { return fRenderTargetProxy->width(); }
int height() const { return fRenderTargetProxy->height(); }
int numColorSamples() const { return fRenderTargetProxy->numColorSamples(); }
@@ -390,14 +389,9 @@
void setNeedsStencil() { fRenderTargetProxy->setNeedsStencil(); }
- GrRenderTarget* accessRenderTarget() {
- // TODO: usage of this entry point needs to be reduced and potentially eliminated
- // since it ends the deferral of the GrRenderTarget's allocation
- if (!fRenderTargetProxy->instantiate(fContext->priv().resourceProvider())) {
- return nullptr;
- }
- return fRenderTargetProxy->peekRenderTarget();
- }
+ // This entry point should only be called if the backing GPU object is known to be
+ // instantiated.
+ GrRenderTarget* accessRenderTarget() { return fRenderTargetProxy->peekRenderTarget(); }
GrSurfaceProxy* asSurfaceProxy() override { return fRenderTargetProxy.get(); }
const GrSurfaceProxy* asSurfaceProxy() const override { return fRenderTargetProxy.get(); }
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index f5469d1..e01a58f 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -11,6 +11,8 @@
#include "GrGpu.h"
#include "GrGpuCommandBuffer.h"
#include "GrMemoryPool.h"
+#include "GrRecordingContext.h"
+#include "GrRecordingContextPriv.h"
#include "GrRect.h"
#include "GrRenderTargetContext.h"
#include "GrResourceAllocator.h"
@@ -574,7 +576,7 @@
// This closely parallels GrTextureOpList::copySurface but renderTargetOpLists
// also store the applied clip and dest proxy with the op
-bool GrRenderTargetOpList::copySurface(GrContext* context,
+bool GrRenderTargetOpList::copySurface(GrRecordingContext* context,
GrSurfaceProxy* dst,
GrSurfaceProxy* src,
const SkIRect& srcRect,
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index 7e44467..439c7ac 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -100,7 +100,7 @@
* depending on the type of surface, configs, etc, and the backend-specific
* limitations.
*/
- bool copySurface(GrContext*,
+ bool copySurface(GrRecordingContext*,
GrSurfaceProxy* dst,
GrSurfaceProxy* src,
const SkIRect& srcRect,
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 0eb89fe..d93492b 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -7,7 +7,9 @@
#include "GrSoftwarePathRenderer.h"
#include "GrAuditTrail.h"
+#include "GrCaps.h"
#include "GrClip.h"
+#include "GrContextPriv.h"
#include "GrDeferredProxyUploader.h"
#include "GrGpuResourcePriv.h"
#include "GrOpFlushState.h"
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index f63c5a7..ba07add 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -12,6 +12,8 @@
#include "GrContextPriv.h"
#include "GrGpu.h"
#include "GrMemoryPool.h"
+#include "GrRecordingContext.h"
+#include "GrRecordingContextPriv.h"
#include "GrResourceAllocator.h"
#include "GrTextureProxy.h"
#include "SkStringUtils.h"
@@ -136,7 +138,7 @@
// This closely parallels GrRenderTargetOpList::copySurface but renderTargetOpList
// stores extra data with the op
-bool GrTextureOpList::copySurface(GrContext* context,
+bool GrTextureOpList::copySurface(GrRecordingContext* context,
GrSurfaceProxy* dst,
GrSurfaceProxy* src,
const SkIRect& srcRect,
diff --git a/src/gpu/GrTextureOpList.h b/src/gpu/GrTextureOpList.h
index dd1dc69..133fb2d 100644
--- a/src/gpu/GrTextureOpList.h
+++ b/src/gpu/GrTextureOpList.h
@@ -48,7 +48,7 @@
* depending on the type of surface, configs, etc, and the backend-specific
* limitations.
*/
- bool copySurface(GrContext*,
+ bool copySurface(GrRecordingContext*,
GrSurfaceProxy* dst,
GrSurfaceProxy* src,
const SkIRect& srcRect,
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp
index f11d2a3..fe73bcf 100644
--- a/src/gpu/GrTextureProducer.cpp
+++ b/src/gpu/GrTextureProducer.cpp
@@ -7,6 +7,7 @@
#include "GrTextureProducer.h"
#include "GrClip.h"
+#include "GrContextPriv.h"
#include "GrProxyProvider.h"
#include "GrRenderTargetContext.h"
#include "GrTextureProxy.h"
diff --git a/src/gpu/ccpr/GrCCAtlas.cpp b/src/gpu/ccpr/GrCCAtlas.cpp
index 4d147fd..c297443 100644
--- a/src/gpu/ccpr/GrCCAtlas.cpp
+++ b/src/gpu/ccpr/GrCCAtlas.cpp
@@ -14,6 +14,7 @@
#include "GrRenderTargetContext.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
+#include "SkIPoint16.h"
#include "SkMakeUnique.h"
#include "SkMathPriv.h"
#include "ccpr/GrCCPathCache.h"
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.cpp b/src/gpu/ccpr/GrCCPerFlushResources.cpp
index b1aa3fa..327a944 100644
--- a/src/gpu/ccpr/GrCCPerFlushResources.cpp
+++ b/src/gpu/ccpr/GrCCPerFlushResources.cpp
@@ -10,9 +10,11 @@
#include "GrClip.h"
#include "GrMemoryPool.h"
#include "GrOnFlushResourceProvider.h"
-#include "GrSurfaceContextPriv.h"
+#include "GrRecordingContext.h"
+#include "GrRecordingContextPriv.h"
#include "GrRenderTargetContext.h"
#include "GrShape.h"
+#include "GrSurfaceContextPriv.h"
#include "SkMakeUnique.h"
#include "ccpr/GrCCPathCache.h"
@@ -56,7 +58,7 @@
public:
DEFINE_OP_CLASS_ID
- static std::unique_ptr<GrDrawOp> Make(GrContext* context,
+ static std::unique_ptr<GrDrawOp> Make(GrRecordingContext* context,
sk_sp<const GrCCPerFlushResources> resources,
sk_sp<GrTextureProxy> copyProxy, int baseInstance,
int endInstance, const SkISize& drawBounds) {
@@ -101,7 +103,7 @@
public:
DEFINE_OP_CLASS_ID
- static std::unique_ptr<GrDrawOp> Make(GrContext* context,
+ static std::unique_ptr<GrDrawOp> Make(GrRecordingContext* context,
sk_sp<const GrCCPerFlushResources> resources,
FillBatchID fillBatchID, StrokeBatchID strokeBatchID,
const SkISize& drawBounds) {
diff --git a/src/gpu/effects/GrRRectBlurEffect.fp b/src/gpu/effects/GrRRectBlurEffect.fp
index 8289d56..c21cd8b 100644
--- a/src/gpu/effects/GrRRectBlurEffect.fp
+++ b/src/gpu/effects/GrRRectBlurEffect.fp
@@ -13,6 +13,7 @@
uniform half blurRadius;
@header {
+ #include "GrCaps.h"
#include "GrClip.h"
#include "GrPaint.h"
#include "GrProxyProvider.h"
diff --git a/src/gpu/effects/GrRRectBlurEffect.h b/src/gpu/effects/GrRRectBlurEffect.h
index 720167d..dc15796 100644
--- a/src/gpu/effects/GrRRectBlurEffect.h
+++ b/src/gpu/effects/GrRRectBlurEffect.h
@@ -12,6 +12,7 @@
#define GrRRectBlurEffect_DEFINED
#include "SkTypes.h"
+#include "GrCaps.h"
#include "GrClip.h"
#include "GrPaint.h"
#include "GrProxyProvider.h"
diff --git a/src/gpu/gl/GrGLGpuCommandBuffer.cpp b/src/gpu/gl/GrGLGpuCommandBuffer.cpp
index 502c845..425a6a1 100644
--- a/src/gpu/gl/GrGLGpuCommandBuffer.cpp
+++ b/src/gpu/gl/GrGLGpuCommandBuffer.cpp
@@ -7,6 +7,7 @@
#include "GrGLGpuCommandBuffer.h"
+#include "GrContextPriv.h"
#include "GrFixedClip.h"
#include "GrRenderTargetPriv.h"
diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
index da1221b..6205b84 100644
--- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
@@ -7,6 +7,7 @@
#include "GrAALinearizingConvexPathRenderer.h"
#include "GrAAConvexTessellator.h"
+#include "GrCaps.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrDrawOpTest.h"
#include "GrGeometryProcessor.h"
diff --git a/src/gpu/ops/GrClearStencilClipOp.cpp b/src/gpu/ops/GrClearStencilClipOp.cpp
index e050fee..58e20a4 100644
--- a/src/gpu/ops/GrClearStencilClipOp.cpp
+++ b/src/gpu/ops/GrClearStencilClipOp.cpp
@@ -9,6 +9,7 @@
#include "GrGpuCommandBuffer.h"
#include "GrMemoryPool.h"
+#include "GrOpFlushState.h"
#include "GrRecordingContext.h"
#include "GrRecordingContextPriv.h"
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index 87ffadb..7b50162 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -6,6 +6,8 @@
*/
#include "GrDefaultPathRenderer.h"
+
+#include "GrCaps.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrDrawOpTest.h"
#include "GrFillRectOp.h"
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index 7d7e7c8..bb55520 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -7,7 +7,9 @@
*/
#include "GrSmallPathRenderer.h"
+
#include "GrBuffer.h"
+#include "GrCaps.h"
#include "GrDistanceFieldGenFromVector.h"
#include "GrDrawOpTest.h"
#include "GrQuad.h"
diff --git a/src/gpu/ops/GrStrokeRectOp.cpp b/src/gpu/ops/GrStrokeRectOp.cpp
index 257719b..e50f918 100644
--- a/src/gpu/ops/GrStrokeRectOp.cpp
+++ b/src/gpu/ops/GrStrokeRectOp.cpp
@@ -7,6 +7,7 @@
#include "GrStrokeRectOp.h"
+#include "GrCaps.h"
#include "GrColor.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrDrawOpTest.h"
diff --git a/src/gpu/ops/GrTessellatingPathRenderer.cpp b/src/gpu/ops/GrTessellatingPathRenderer.cpp
index 269f798..dc3f59f 100644
--- a/src/gpu/ops/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTessellatingPathRenderer.cpp
@@ -8,6 +8,7 @@
#include "GrTessellatingPathRenderer.h"
#include <stdio.h>
#include "GrAuditTrail.h"
+#include "GrCaps.h"
#include "GrClip.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrDrawOpTest.h"
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.cpp b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
index ac20430..cc6758e 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
@@ -8,6 +8,7 @@
#include "GrVkGpuCommandBuffer.h"
#include "GrBackendDrawableInfo.h"
+#include "GrContextPriv.h"
#include "GrFixedClip.h"
#include "GrMesh.h"
#include "GrOpFlushState.h"