Revert "Fission GrSurfaceFillContext into skgpu:: and skgpu::v1:: versions"
This reverts commit af844c79d5358fd51a7f2fb439324cfd7f0798c1.
Reason for revert: breaking chrome roller
Original change's description:
> Fission GrSurfaceFillContext into skgpu:: and skgpu::v1:: versions
>
> The only really interesting parts are:
> src/gpu/SurfaceFillContext.*
> src/gpu/v1/SurfaceFillContext.*
>
> Everything else is mostly mechanical.
>
> Bug: skia:11837
> Change-Id: If2945f30dadd6ad0cccf6ff2b53e4a92b1dc6cbc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436099
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
TBR=robertphillips@google.com,michaelludwig@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
Change-Id: I3b2d1d4a30e253a107f55dc3c5ecaaee5386e6e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11837
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436557
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
diff --git a/gm/clear_swizzle.cpp b/gm/clear_swizzle.cpp
index 0dfac54..59ba717 100644
--- a/gm/clear_swizzle.cpp
+++ b/gm/clear_swizzle.cpp
@@ -10,9 +10,8 @@
#include "include/core/SkRect.h"
#include "include/private/SkColorData.h"
#include "src/core/SkCanvasPriv.h"
-#include "src/gpu/GrRecordingContextPriv.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrSwizzle.h"
-#include "src/gpu/SurfaceFillContext.h"
namespace skiagm {
diff --git a/gm/dsl_processor_test.cpp b/gm/dsl_processor_test.cpp
index e384e00..a8c954d 100644
--- a/gm/dsl_processor_test.cpp
+++ b/gm/dsl_processor_test.cpp
@@ -8,7 +8,7 @@
#include "gm/gm.h"
#include "include/effects/SkRuntimeEffect.h"
#include "src/core/SkCanvasPriv.h"
-#include "src/gpu/SurfaceFillContext.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/sksl/dsl/priv/DSLFPs.h"
#include "src/sksl/dsl/priv/DSLWriter.h"
diff --git a/gm/fpcoordinateoverride.cpp b/gm/fpcoordinateoverride.cpp
index fc9adfe..4f29b57 100644
--- a/gm/fpcoordinateoverride.cpp
+++ b/gm/fpcoordinateoverride.cpp
@@ -21,8 +21,8 @@
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrFragmentProcessor.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrRRectEffect.h"
#include "src/gpu/effects/GrSkSLFP.h"
#include "src/gpu/effects/GrTextureEffect.h"
diff --git a/gm/swizzle.cpp b/gm/swizzle.cpp
index a554c3c..ca10ea1 100644
--- a/gm/swizzle.cpp
+++ b/gm/swizzle.cpp
@@ -13,8 +13,8 @@
#include "include/core/SkTypes.h"
#include "src/core/SkCanvasPriv.h"
#include "src/gpu/GrFragmentProcessor.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrTextureEffect.h"
#include "tools/Resources.h"
diff --git a/gn/gpu.gni b/gn/gpu.gni
index b8ee03a..774e125 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -215,6 +215,8 @@
"$_src/gpu/GrSurface.h",
"$_src/gpu/GrSurfaceContext.cpp",
"$_src/gpu/GrSurfaceContext.h",
+ "$_src/gpu/GrSurfaceFillContext.cpp",
+ "$_src/gpu/GrSurfaceFillContext.h",
"$_src/gpu/GrSurfaceProxy.cpp",
"$_src/gpu/GrSurfaceProxy.h",
"$_src/gpu/GrSurfaceProxyPriv.h",
@@ -472,8 +474,6 @@
"$_src/gpu/BaseDevice.h",
"$_src/gpu/SkGr.cpp",
"$_src/gpu/SkGr.h",
- "$_src/gpu/SurfaceFillContext.cpp",
- "$_src/gpu/SurfaceFillContext.h",
"$_src/image/SkImage_Gpu.cpp",
"$_src/image/SkImage_Gpu.h",
"$_src/image/SkImage_GpuBase.cpp",
@@ -599,8 +599,6 @@
"$_src/gpu/v1/Device_v1.h",
"$_src/gpu/v1/SurfaceDrawContext.cpp",
"$_src/gpu/v1/SurfaceDrawContext_v1.h",
- "$_src/gpu/v1/SurfaceFillContext.cpp",
- "$_src/gpu/v1/SurfaceFillContext_v1.h",
]
skia_gpu_sources += skia_skgpu_v1_sources
diff --git a/src/core/SkCanvasPriv.cpp b/src/core/SkCanvasPriv.cpp
index 50bac7c..741709b 100644
--- a/src/core/SkCanvasPriv.cpp
+++ b/src/core/SkCanvasPriv.cpp
@@ -133,7 +133,7 @@
}
#endif // SK_GPU_V1
-skgpu::SurfaceFillContext* SkCanvasPriv::TopDeviceSurfaceFillContext(SkCanvas* canvas) {
+GrSurfaceFillContext* SkCanvasPriv::TopDeviceSurfaceFillContext(SkCanvas* canvas) {
if (auto gpuDevice = canvas->topDevice()->asGpuDevice()) {
return gpuDevice->surfaceFillContext();
}
@@ -149,7 +149,7 @@
}
#endif // SK_GPU_V1
-skgpu::SurfaceFillContext* SkCanvasPriv::TopDeviceSurfaceFillContext(SkCanvas* canvas) {
+GrSurfaceFillContext* SkCanvasPriv::TopDeviceSurfaceFillContext(SkCanvas* canvas) {
return nullptr;
}
diff --git a/src/core/SkCanvasPriv.h b/src/core/SkCanvasPriv.h
index 12d042e..6b12529 100644
--- a/src/core/SkCanvasPriv.h
+++ b/src/core/SkCanvasPriv.h
@@ -15,12 +15,8 @@
class SkWriteBuffer;
#if GR_TEST_UTILS
-namespace skgpu {
- class SurfaceFillContext;
-#if SK_GPU_V1
- namespace v1 { class SurfaceDrawContext; }
-#endif // SK_GPU_V1
-}
+namespace skgpu { namespace v1 { class SurfaceDrawContext; }}
+class GrSurfaceFillContext;
#endif // GR_TEST_UTILS
// This declaration must match the one in SkDeferredDisplayList.h
@@ -67,7 +63,7 @@
#if SK_GPU_V1
static skgpu::v1::SurfaceDrawContext* TopDeviceSurfaceDrawContext(SkCanvas*);
#endif
- static skgpu::SurfaceFillContext* TopDeviceSurfaceFillContext(SkCanvas*);
+ static GrSurfaceFillContext* TopDeviceSurfaceFillContext(SkCanvas*);
#endif // GR_TEST_UTILS
static GrRenderTargetProxy* TopDeviceTargetProxy(SkCanvas*);
diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp
index 98785c7..1492b08 100644
--- a/src/core/SkGpuBlurUtils.cpp
+++ b/src/core/SkGpuBlurUtils.cpp
@@ -65,7 +65,7 @@
* Draws 'dstRect' into 'surfaceFillContext' evaluating a 1D Gaussian over 'srcView'. The src rect
* is 'dstRect' offset by 'dstToSrcOffset'. 'mode' and 'bounds' are applied to the src coords.
*/
-static void convolve_gaussian_1d(skgpu::SurfaceFillContext* sfc,
+static void convolve_gaussian_1d(GrSurfaceFillContext* sfc,
GrSurfaceProxyView srcView,
const SkIRect srcSubset,
SkIVector dstToSrcOffset,
@@ -112,7 +112,7 @@
SkASSERT(!SkGpuBlurUtils::IsEffectivelyZeroSigma(sigmaX) &&
!SkGpuBlurUtils::IsEffectivelyZeroSigma(sigmaY));
// Create the sdc with default SkSurfaceProps. Gaussian blurs will soon use a
- // SurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
+ // GrSurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
auto sdc = skgpu::v1::SurfaceDrawContext::Make(
rContext, srcColorType, std::move(finalCS), dstFit, dstBounds.size(), SkSurfaceProps(),
1, GrMipmapped::kNo, srcView.proxy()->isProtected(), srcView.origin());
@@ -167,7 +167,7 @@
// at {0, 0} in the new RTC.
//
// Create the sdc with default SkSurfaceProps. Gaussian blurs will soon use a
- // SurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
+ // GrSurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
auto dstSDC = skgpu::v1::SurfaceDrawContext::Make(
rContext, srcColorType, std::move(finalCS), fit, dstBounds.size(), SkSurfaceProps(), 1,
GrMipmapped::kNo, srcView.proxy()->isProtected(), srcView.origin());
@@ -318,7 +318,7 @@
src.reset(); // no longer needed
// Create the sdc with default SkSurfaceProps. Gaussian blurs will soon use a
- // SurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
+ // GrSurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
auto dstSDC = skgpu::v1::SurfaceDrawContext::Make(
rContext, srcColorType, std::move(colorSpace), fit, dstSize, SkSurfaceProps(), 1,
GrMipmapped::kNo, srcView.proxy()->isProtected(), srcView.origin());
@@ -520,7 +520,7 @@
// a draw that applies the tile mode.
if (!radiusX && !radiusY) {
// Create the sdc with default SkSurfaceProps. Gaussian blurs will soon use a
- // SurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
+ // GrSurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
auto result = skgpu::v1::SurfaceDrawContext::Make(rContext,
srcColorType,
std::move(colorSpace),
@@ -606,7 +606,7 @@
int padY = mode == SkTileMode::kClamp ||
(mode == SkTileMode::kDecal && sigmaY > kMaxSigma) ? 1 : 0;
// Create the sdc with default SkSurfaceProps. Gaussian blurs will soon use a
- // SurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
+ // GrSurfaceFillContext, at which point the SkSurfaceProps won't exist anymore.
auto rescaledSDC = skgpu::v1::SurfaceDrawContext::Make(
srcCtx->recordingContext(),
colorInfo.colorType(),
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 856ae95..3b60bde 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -25,9 +25,9 @@
#include "src/gpu/GrColorSpaceXform.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrRecordingContextPriv.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#endif
#include <atomic>
diff --git a/src/core/SkRuntimeEffect.cpp b/src/core/SkRuntimeEffect.cpp
index 8d1e6d1..636740e 100644
--- a/src/core/SkRuntimeEffect.cpp
+++ b/src/core/SkRuntimeEffect.cpp
@@ -36,8 +36,7 @@
#include "src/gpu/GrColorInfo.h"
#include "src/gpu/GrFPArgs.h"
#include "src/gpu/GrImageInfo.h"
-#include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/SurfaceFillContext.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/effects/GrMatrixEffect.h"
#include "src/gpu/effects/GrSkSLFP.h"
#include "src/image/SkImage_Gpu.h"
diff --git a/src/effects/imagefilters/SkArithmeticImageFilter.cpp b/src/effects/imagefilters/SkArithmeticImageFilter.cpp
index ba8b4db..a946aef 100644
--- a/src/effects/imagefilters/SkArithmeticImageFilter.cpp
+++ b/src/effects/imagefilters/SkArithmeticImageFilter.cpp
@@ -20,9 +20,9 @@
#include "src/core/SkRuntimeEffectPriv.h"
#include "src/gpu/GrColorSpaceXform.h"
#include "src/gpu/GrRecordingContextPriv.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrSkSLFP.h"
#include "src/gpu/effects/GrTextureEffect.h"
#endif
diff --git a/src/effects/imagefilters/SkBlendImageFilter.cpp b/src/effects/imagefilters/SkBlendImageFilter.cpp
index 5d1a5c9..2df3231 100644
--- a/src/effects/imagefilters/SkBlendImageFilter.cpp
+++ b/src/effects/imagefilters/SkBlendImageFilter.cpp
@@ -22,9 +22,9 @@
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrColorSpaceXform.h"
#include "src/gpu/GrRecordingContextPriv.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrTextureEffect.h"
#endif
diff --git a/src/effects/imagefilters/SkDisplacementMapImageFilter.cpp b/src/effects/imagefilters/SkDisplacementMapImageFilter.cpp
index a096425..907d044 100644
--- a/src/effects/imagefilters/SkDisplacementMapImageFilter.cpp
+++ b/src/effects/imagefilters/SkDisplacementMapImageFilter.cpp
@@ -19,10 +19,10 @@
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrColorSpaceXform.h"
#include "src/gpu/GrRecordingContextPriv.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrTextureEffect.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
diff --git a/src/effects/imagefilters/SkLightingImageFilter.cpp b/src/effects/imagefilters/SkLightingImageFilter.cpp
index 5283117..e756322 100644
--- a/src/effects/imagefilters/SkLightingImageFilter.cpp
+++ b/src/effects/imagefilters/SkLightingImageFilter.cpp
@@ -22,10 +22,10 @@
#include "src/gpu/GrFragmentProcessor.h"
#include "src/gpu/GrPaint.h"
#include "src/gpu/GrRecordingContextPriv.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrTextureEffect.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
@@ -438,7 +438,7 @@
private:
#if SK_SUPPORT_GPU
- void drawRect(skgpu::SurfaceFillContext*,
+ void drawRect(GrSurfaceFillContext*,
GrSurfaceProxyView srcView,
const SkMatrix& matrix,
const SkIRect& dstRect,
@@ -454,7 +454,7 @@
};
#if SK_SUPPORT_GPU
-void SkLightingImageFilterInternal::drawRect(skgpu::SurfaceFillContext* sfc,
+void SkLightingImageFilterInternal::drawRect(GrSurfaceFillContext* sfc,
GrSurfaceProxyView srcView,
const SkMatrix& matrix,
const SkIRect& dstRect,
diff --git a/src/effects/imagefilters/SkMorphologyImageFilter.cpp b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
index 4e2d862..326207d 100644
--- a/src/effects/imagefilters/SkMorphologyImageFilter.cpp
+++ b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
@@ -19,10 +19,10 @@
#include "include/gpu/GrRecordingContext.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrRecordingContextPriv.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrTextureEffect.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
@@ -357,7 +357,7 @@
}
#endif
-static void apply_morphology_rect(skgpu::SurfaceFillContext* sfc,
+static void apply_morphology_rect(GrSurfaceFillContext* sfc,
GrSurfaceProxyView view,
SkAlphaType srcAlphaType,
const SkIRect& srcRect,
@@ -376,7 +376,7 @@
sfc->fillRectToRectWithFP(srcRect, dstRect, std::move(fp));
}
-static void apply_morphology_rect_no_bounds(skgpu::SurfaceFillContext* sfc,
+static void apply_morphology_rect_no_bounds(GrSurfaceFillContext* sfc,
GrSurfaceProxyView view,
SkAlphaType srcAlphaType,
const SkIRect& srcRect,
@@ -389,7 +389,7 @@
sfc->fillRectToRectWithFP(srcRect, dstRect, std::move(fp));
}
-static void apply_morphology_pass(skgpu::SurfaceFillContext* sfc,
+static void apply_morphology_pass(GrSurfaceFillContext* sfc,
GrSurfaceProxyView view,
SkAlphaType srcAlphaType,
const SkIRect& srcRect,
diff --git a/src/gpu/BaseDevice.h b/src/gpu/BaseDevice.h
index 8c6a60c..4ed6406 100644
--- a/src/gpu/BaseDevice.h
+++ b/src/gpu/BaseDevice.h
@@ -12,12 +12,8 @@
#include "include/private/GrTypesPriv.h"
class GrRenderTargetProxy;
-namespace skgpu {
- class SurfaceFillContext;
-#if SK_GPU_V1
- namespace v1 { class SurfaceDrawContext; }
-#endif // SK_GPU_V1
-}
+namespace skgpu { namespace v1 { class SurfaceDrawContext; }}
+class GrSurfaceFillContext;
class GrSurfaceProxyView;
// NOTE: when not defined, SkGpuDevice extends SkBaseDevice directly and manages its clip stack
@@ -57,7 +53,7 @@
virtual skgpu::v1::SurfaceDrawContext* surfaceDrawContext() { return nullptr; }
#endif
- virtual skgpu::SurfaceFillContext* surfaceFillContext() = 0;
+ virtual GrSurfaceFillContext* surfaceFillContext() = 0;
GrRenderTargetProxy* targetProxy();
GrRecordingContext* recordingContext() const { return fContext.get(); }
diff --git a/src/gpu/GrDirectContextPriv.cpp b/src/gpu/GrDirectContextPriv.cpp
index 2bfef8a..1ffd631 100644
--- a/src/gpu/GrDirectContextPriv.cpp
+++ b/src/gpu/GrDirectContextPriv.cpp
@@ -16,10 +16,10 @@
#include "src/gpu/GrMemoryPool.h"
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrSurfaceContext.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrThreadSafePipelineBuilder.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrSkSLFP.h"
#include "src/gpu/effects/GrTextureEffect.h"
#include "src/gpu/text/GrAtlasManager.h"
diff --git a/src/gpu/GrRecordingContextPriv.cpp b/src/gpu/GrRecordingContextPriv.cpp
index 4c61390..b0bdd4a 100644
--- a/src/gpu/GrRecordingContextPriv.cpp
+++ b/src/gpu/GrRecordingContextPriv.cpp
@@ -18,7 +18,7 @@
#include "src/gpu/v1/SurfaceDrawContext_v1.h"
#endif
#if SK_GPU_V2
-#include "src/gpu/SurfaceFillContext.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/v2/Device_v2.h"
#endif
@@ -133,10 +133,10 @@
info.refColorSpace(),
SkSurfaceProps());
} else {
- sc = std::make_unique<skgpu::v1::SurfaceFillContext>(this->context(),
- std::move(readView),
- std::move(writeView),
- info);
+ sc = std::make_unique<GrSurfaceFillContext>(this->context(),
+ std::move(readView),
+ std::move(writeView),
+ info);
}
} else {
sc = std::make_unique<GrSurfaceContext>(this->context(), std::move(readView), info);
@@ -149,13 +149,13 @@
return nullptr;
}
-std::unique_ptr<skgpu::SurfaceFillContext> GrRecordingContextPriv::makeSFC(GrImageInfo info,
- SkBackingFit fit,
- int sampleCount,
- GrMipmapped mipmapped,
- GrProtected isProtected,
- GrSurfaceOrigin origin,
- SkBudgeted budgeted) {
+std::unique_ptr<GrSurfaceFillContext> GrRecordingContextPriv::makeSFC(GrImageInfo info,
+ SkBackingFit fit,
+ int sampleCount,
+ GrMipmapped mipmapped,
+ GrProtected isProtected,
+ GrSurfaceOrigin origin,
+ SkBudgeted budgeted) {
#if GR_TEST_UTILS
if (this->options().fUseSkGpuV2 == GrContextOptions::Enable::kYes) {
@@ -197,32 +197,30 @@
GrSurfaceProxyView readView( proxy, origin, readSwizzle);
GrSurfaceProxyView writeView(std::move(proxy), origin, writeSwizzle);
- std::unique_ptr<skgpu::SurfaceFillContext> sfc;
- sfc = std::make_unique<skgpu::v1::SurfaceFillContext>(this->context(),
- std::move(readView),
- std::move(writeView),
- info.colorInfo());
- sfc->discard();
- return sfc;
+ auto fillContext = std::make_unique<GrSurfaceFillContext>(this->context(),
+ std::move(readView),
+ std::move(writeView),
+ info.colorInfo());
+ fillContext->discard();
+ return fillContext;
#endif
}
return nullptr;
}
-std::unique_ptr<skgpu::SurfaceFillContext> GrRecordingContextPriv::makeSFC(
- SkAlphaType alphaType,
- sk_sp<SkColorSpace> colorSpace,
- SkISize dimensions,
- SkBackingFit fit,
- const GrBackendFormat& format,
- int sampleCount,
- GrMipmapped mipmapped,
- GrProtected isProtected,
- GrSwizzle readSwizzle,
- GrSwizzle writeSwizzle,
- GrSurfaceOrigin origin,
- SkBudgeted budgeted) {
+std::unique_ptr<GrSurfaceFillContext> GrRecordingContextPriv::makeSFC(SkAlphaType alphaType,
+ sk_sp<SkColorSpace> cs,
+ SkISize dimensions,
+ SkBackingFit fit,
+ const GrBackendFormat& format,
+ int sampleCount,
+ GrMipmapped mipmapped,
+ GrProtected isProtected,
+ GrSwizzle readSwizzle,
+ GrSwizzle writeSwizzle,
+ GrSurfaceOrigin origin,
+ SkBudgeted budgeted) {
#if GR_TEST_UTILS
if (this->context()->options().fUseSkGpuV2 == GrContextOptions::Enable::kYes) {
@@ -238,7 +236,7 @@
SkASSERT(format.isValid() && format.backend() == fContext->backend());
if (alphaType == kPremul_SkAlphaType || alphaType == kOpaque_SkAlphaType) {
return skgpu::v1::SurfaceDrawContext::Make(this->context(),
- std::move(colorSpace),
+ std::move(cs),
fit,
dimensions,
format,
@@ -263,23 +261,22 @@
if (!proxy) {
return nullptr;
}
- GrImageInfo info(GrColorType::kUnknown, alphaType, std::move(colorSpace), dimensions);
+ GrImageInfo info(GrColorType::kUnknown, alphaType, std::move(cs), dimensions);
GrSurfaceProxyView readView( proxy, origin, readSwizzle);
GrSurfaceProxyView writeView(std::move(proxy), origin, writeSwizzle);
- std::unique_ptr<skgpu::SurfaceFillContext> sfc;
- sfc = std::make_unique<skgpu::v1::SurfaceFillContext>(this->context(),
- std::move(readView),
- std::move(writeView),
- info.colorInfo());
- sfc->discard();
- return sfc;
+ auto fillContext = std::make_unique<GrSurfaceFillContext>(this->context(),
+ std::move(readView),
+ std::move(writeView),
+ info.colorInfo());
+ fillContext->discard();
+ return fillContext;
#endif
}
return nullptr;
}
-std::unique_ptr<skgpu::SurfaceFillContext> GrRecordingContextPriv::makeSFCWithFallback(
+std::unique_ptr<GrSurfaceFillContext> GrRecordingContextPriv::makeSFCWithFallback(
GrImageInfo info,
SkBackingFit fit,
int sampleCount,
@@ -330,7 +327,7 @@
return nullptr;
}
-std::unique_ptr<skgpu::SurfaceFillContext> GrRecordingContextPriv::makeSFCFromBackendTexture(
+std::unique_ptr<GrSurfaceFillContext> GrRecordingContextPriv::makeSFCFromBackendTexture(
GrColorInfo info,
const GrBackendTexture& tex,
int sampleCount,
@@ -378,10 +375,10 @@
GrSurfaceProxyView readView( proxy, origin, readSwizzle);
GrSurfaceProxyView writeView(std::move(proxy), origin, writeSwizzle);
- return std::make_unique<skgpu::v1::SurfaceFillContext>(this->context(),
- std::move(readView),
- std::move(writeView),
- std::move(info));
+ return std::make_unique<GrSurfaceFillContext>(this->context(),
+ std::move(readView),
+ std::move(writeView),
+ std::move(info));
#endif
}
diff --git a/src/gpu/GrRecordingContextPriv.h b/src/gpu/GrRecordingContextPriv.h
index 82add47..56b15c6 100644
--- a/src/gpu/GrRecordingContextPriv.h
+++ b/src/gpu/GrRecordingContextPriv.h
@@ -17,7 +17,6 @@
class GrImageInfo;
class GrSwizzle;
class SkDeferredDisplayList;
-namespace skgpu { class SurfaceFillContext; }
/** Class that exposes methods on GrRecordingContext that are only intended for use internal to
Skia. This class is purely a privileged window into GrRecordingContext. It should never have
@@ -134,38 +133,37 @@
* Uses GrImageInfo's color type to pick the default texture format. Will return a
* SurfaceDrawContext if possible.
*/
- std::unique_ptr<skgpu::SurfaceFillContext> makeSFC(
- GrImageInfo,
- SkBackingFit = SkBackingFit::kExact,
- int sampleCount = 1,
- GrMipmapped = GrMipmapped::kNo,
- GrProtected = GrProtected::kNo,
- GrSurfaceOrigin = kTopLeft_GrSurfaceOrigin,
- SkBudgeted = SkBudgeted::kYes);
+ std::unique_ptr<GrSurfaceFillContext> makeSFC(GrImageInfo,
+ SkBackingFit = SkBackingFit::kExact,
+ int sampleCount = 1,
+ GrMipmapped = GrMipmapped::kNo,
+ GrProtected = GrProtected::kNo,
+ GrSurfaceOrigin = kTopLeft_GrSurfaceOrigin,
+ SkBudgeted = SkBudgeted::kYes);
/**
- * Makes a custom configured SurfaceFillContext where the caller specifies the specific
+ * Makes a custom configured GrSurfaceFillContext where the caller specifies the specific
* texture format and swizzles. The color type will be kUnknown. Returns a SurfaceDrawContext
* if possible.
*/
- std::unique_ptr<skgpu::SurfaceFillContext> makeSFC(SkAlphaType,
- sk_sp<SkColorSpace>,
- SkISize dimensions,
- SkBackingFit,
- const GrBackendFormat&,
- int sampleCount,
- GrMipmapped,
- GrProtected,
- GrSwizzle readSwizzle,
- GrSwizzle writeSwizzle,
- GrSurfaceOrigin,
- SkBudgeted);
+ std::unique_ptr<GrSurfaceFillContext> makeSFC(SkAlphaType,
+ sk_sp<SkColorSpace>,
+ SkISize dimensions,
+ SkBackingFit,
+ const GrBackendFormat&,
+ int sampleCount,
+ GrMipmapped,
+ GrProtected,
+ GrSwizzle readSwizzle,
+ GrSwizzle writeSwizzle,
+ GrSurfaceOrigin,
+ SkBudgeted);
/**
* Like the above but uses GetFallbackColorTypeAndFormat to find a fallback color type (and
* compatible format) if the passed GrImageInfo's color type is not renderable.
*/
- std::unique_ptr<skgpu::SurfaceFillContext> makeSFCWithFallback(
+ std::unique_ptr<GrSurfaceFillContext> makeSFCWithFallback(
GrImageInfo,
SkBackingFit = SkBackingFit::kExact,
int sampleCount = 1,
@@ -175,11 +173,11 @@
SkBudgeted = SkBudgeted::kYes);
/**
- * Creates a SurfaceFillContext from an existing GrBackendTexture. The GrColorInfo's color
+ * Creates a GrSurfaceFillContext from an existing GrBackendTexture. The GrColorInfo's color
* type must be compatible with backend texture's format or this will fail. All formats are
* considered compatible with kUnknown. Returns a SurfaceDrawContext if possible.
*/
- std::unique_ptr<skgpu::SurfaceFillContext> makeSFCFromBackendTexture(
+ std::unique_ptr<GrSurfaceFillContext> makeSFCFromBackendTexture(
GrColorInfo,
const GrBackendTexture&,
int sampleCount,
diff --git a/src/gpu/GrRenderTargetProxy.h b/src/gpu/GrRenderTargetProxy.h
index c351981..73989a1 100644
--- a/src/gpu/GrRenderTargetProxy.h
+++ b/src/gpu/GrRenderTargetProxy.h
@@ -19,9 +19,9 @@
class GrResourceProvider;
// GrArenas matches the lifetime of a single frame. It is created and held on the
-// SurfaceFillContext's RenderTargetProxy with the first call to get an arena. Each GrOpsTask
+// GrSurfaceFillContext's RenderTargetProxy with the first call to get an arena. Each GrOpsTask
// takes a ref on it to keep the arenas alive. When the first GrOpsTask's onExecute() is
-// completed, the arena ref on the SurfaceFillContext's RenderTargetProxy is nulled out so that
+// completed, the arena ref on the GrSurfaceFillContext's RenderTargetProxy is nulled out so that
// any new GrOpsTasks will create and ref a new set of arenas.
class GrArenas : public SkNVRefCnt<GrArenas> {
public:
diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index b884b9e..72c95f5 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -24,8 +24,8 @@
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrResourceProvider.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrBicubicEffect.h"
#include "src/gpu/effects/GrTextureEffect.h"
@@ -640,7 +640,7 @@
return;
}
- std::unique_ptr<skgpu::SurfaceFillContext> tempFC;
+ std::unique_ptr<GrSurfaceFillContext> tempFC;
int x = srcRect.fLeft;
int y = srcRect.fTop;
if (needsRescale) {
@@ -1106,11 +1106,11 @@
this->origin());
}
-std::unique_ptr<skgpu::SurfaceFillContext> GrSurfaceContext::rescale(const GrImageInfo& info,
- GrSurfaceOrigin origin,
- SkIRect srcRect,
- RescaleGamma rescaleGamma,
- RescaleMode rescaleMode) {
+std::unique_ptr<GrSurfaceFillContext> GrSurfaceContext::rescale(const GrImageInfo& info,
+ GrSurfaceOrigin origin,
+ SkIRect srcRect,
+ RescaleGamma rescaleGamma,
+ RescaleMode rescaleMode) {
auto sfc = fContext->priv().makeSFCWithFallback(info,
SkBackingFit::kExact,
1,
@@ -1127,7 +1127,7 @@
return sfc;
}
-bool GrSurfaceContext::rescaleInto(skgpu::SurfaceFillContext* dst,
+bool GrSurfaceContext::rescaleInto(GrSurfaceFillContext* dst,
SkIRect dstRect,
SkIRect srcRect,
RescaleGamma rescaleGamma,
@@ -1167,8 +1167,8 @@
// Within a rescaling pass A is the input (if not null) and B is the output. At the end of the
// pass B is moved to A. If 'this' is the input on the first pass then tempA is null.
- std::unique_ptr<skgpu::SurfaceFillContext> tempA;
- std::unique_ptr<skgpu::SurfaceFillContext> tempB;
+ std::unique_ptr<GrSurfaceFillContext> tempA;
+ std::unique_ptr<GrSurfaceFillContext> tempB;
// Assume we should ignore the rescale linear request if the surface has no color space since
// it's unclear how we'd linearize from an unknown color space.
@@ -1220,7 +1220,7 @@
}
auto input = tempA ? tempA.get() : this;
sk_sp<GrColorSpaceXform> xform;
- skgpu::SurfaceFillContext* stepDst;
+ GrSurfaceFillContext* stepDst;
SkIRect stepDstRect;
if (nextDims == finalSize) {
stepDst = dst;
diff --git a/src/gpu/GrSurfaceContext.h b/src/gpu/GrSurfaceContext.h
index 0a8c7c3..069c562 100644
--- a/src/gpu/GrSurfaceContext.h
+++ b/src/gpu/GrSurfaceContext.h
@@ -26,7 +26,8 @@
class GrRenderTargetProxy;
class GrSingleOwner;
class GrSurface;
-namespace skgpu { class SurfaceFillContext; }
+namespace skgpu { namespace v1 { class SurfaceDrawContext; }}
+class GrSurfaceFillContext;
class GrSurfaceProxy;
class GrTextureProxy;
struct SkIPoint;
@@ -157,7 +158,7 @@
return fReadView.asRenderTargetProxyRef();
}
- virtual skgpu::SurfaceFillContext* asFillContext() { return nullptr; }
+ virtual GrSurfaceFillContext* asFillContext() { return nullptr; }
/**
* Rescales the contents of srcRect. The gamma in which the rescaling occurs is controlled by
@@ -166,17 +167,17 @@
* different size than srcRect. Though, it could be relaxed to allow non-scaling color
* conversions.
*/
- std::unique_ptr<skgpu::SurfaceFillContext> rescale(const GrImageInfo& info,
- GrSurfaceOrigin,
- SkIRect srcRect,
- SkImage::RescaleGamma,
- SkImage::RescaleMode);
+ std::unique_ptr<GrSurfaceFillContext> rescale(const GrImageInfo& info,
+ GrSurfaceOrigin,
+ SkIRect srcRect,
+ SkImage::RescaleGamma,
+ SkImage::RescaleMode);
/**
* Like the above but allows the caller ot specify a destination fill context and
* rect within that context. The dst rect must be contained by the dst or this will fail.
*/
- bool rescaleInto(skgpu::SurfaceFillContext* dst,
+ bool rescaleInto(GrSurfaceFillContext* dst,
SkIRect dstRect,
SkIRect srcRect,
SkImage::RescaleGamma,
diff --git a/src/gpu/v1/SurfaceFillContext.cpp b/src/gpu/GrSurfaceFillContext.cpp
similarity index 78%
rename from src/gpu/v1/SurfaceFillContext.cpp
rename to src/gpu/GrSurfaceFillContext.cpp
index 839feaa..8d9a439 100644
--- a/src/gpu/v1/SurfaceFillContext.cpp
+++ b/src/gpu/GrSurfaceFillContext.cpp
@@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
-#include "src/gpu/v1/SurfaceFillContext_v1.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "include/private/GrImageContext.h"
#include "src/gpu/GrDstProxyView.h"
@@ -15,7 +15,6 @@
#include "src/gpu/geometry/GrRect.h"
#include "src/gpu/ops/GrClearOp.h"
#include "src/gpu/ops/GrFillRectOp.h"
-#include "src/gpu/v1/SurfaceDrawContext_v1.h"
#define ASSERT_SINGLE_OWNER GR_ASSERT_SINGLE_OWNER(this->singleOwner())
#define RETURN_IF_ABANDONED if (fContext->abandoned()) { return; }
@@ -31,33 +30,31 @@
GrDrawingManager* fDrawingManager;
};
-namespace skgpu::v1 {
-
// In MDB mode the reffing of the 'getLastOpsTask' call's result allows in-progress
-// GrOpsTask to be picked up and added to by SurfaceFillContext lower in the call
+// GrOpsTask to be picked up and added to by GrSurfaceFillContext lower in the call
// stack. When this occurs with a closed GrOpsTask, a new one will be allocated
-// when the SurfaceFillContext attempts to use it (via getOpsTask).
-SurfaceFillContext::SurfaceFillContext(GrRecordingContext* rContext,
- GrSurfaceProxyView readView,
- GrSurfaceProxyView writeView,
- const GrColorInfo& colorInfo,
- bool flushTimeOpsTask)
- : skgpu::SurfaceFillContext(rContext,
- std::move(readView),
- std::move(writeView),
- std::move(colorInfo))
+// when the GrSurfaceFillContext attempts to use it (via getOpsTask).
+GrSurfaceFillContext::GrSurfaceFillContext(GrRecordingContext* context,
+ GrSurfaceProxyView readView,
+ GrSurfaceProxyView writeView,
+ const GrColorInfo& colorInfo,
+ bool flushTimeOpsTask)
+ : GrSurfaceContext(context, std::move(readView), std::move(colorInfo))
+ , fWriteView(std::move(writeView))
, fFlushTimeOpsTask(flushTimeOpsTask) {
- fOpsTask = sk_ref_sp(rContext->priv().drawingManager()->getLastOpsTask(this->asSurfaceProxy()));
+ fOpsTask = sk_ref_sp(context->priv().drawingManager()->getLastOpsTask(this->asSurfaceProxy()));
+ SkASSERT(this->asSurfaceProxy() == fWriteView.proxy());
+ SkASSERT(this->origin() == fWriteView.origin());
SkDEBUGCODE(this->validate();)
}
-void SurfaceFillContext::fillRectWithFP(const SkIRect& dstRect,
- std::unique_ptr<GrFragmentProcessor> fp) {
+void GrSurfaceFillContext::fillRectWithFP(const SkIRect& dstRect,
+ std::unique_ptr<GrFragmentProcessor> fp) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- GR_CREATE_TRACE_MARKER_CONTEXT("v1::SurfaceFillContext", "fillRectWithFP", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("GrSurfaceFillContext", "fillRectWithFP", fContext);
AutoCheckFlush acf(this->drawingManager());
@@ -69,7 +66,7 @@
this->addDrawOp(std::move(op));
}
-void SurfaceFillContext::addDrawOp(GrOp::Owner owner) {
+void GrSurfaceFillContext::addDrawOp(GrOp::Owner owner) {
GrDrawOp* op = static_cast<GrDrawOp*>(owner.get());
GrClampType clampType = GrColorTypeClampType(this->colorInfo().colorType());
auto clip = GrAppliedClip::Disabled();
@@ -97,7 +94,7 @@
caps);
}
-void SurfaceFillContext::ClearToGrPaint(std::array<float, 4> color, GrPaint* paint) {
+void GrSurfaceFillContext::ClearToGrPaint(std::array<float, 4> color, GrPaint* paint) {
paint->setColor4f({color[0], color[1], color[2], color[3]});
if (color[3] == 1.f) {
// Can just rely on the src-over blend mode to do the right thing.
@@ -110,7 +107,7 @@
}
}
-void SurfaceFillContext::addOp(GrOp::Owner op) {
+void GrSurfaceFillContext::addOp(GrOp::Owner op) {
GrDrawingManager* drawingMgr = this->drawingManager();
this->getOpsTask()->addOp(drawingMgr,
std::move(op),
@@ -118,7 +115,7 @@
*this->caps());
}
-GrOpsTask* SurfaceFillContext::getOpsTask() {
+GrOpsTask* GrSurfaceFillContext::getOpsTask() {
ASSERT_SINGLE_OWNER
SkDEBUGCODE(this->validate();)
@@ -129,11 +126,7 @@
return fOpsTask.get();
}
-sk_sp<GrRenderTask> SurfaceFillContext::refRenderTask() {
- return sk_ref_sp(this->getOpsTask());
-}
-
-GrOpsTask* SurfaceFillContext::replaceOpsTask() {
+GrOpsTask* GrSurfaceFillContext::replaceOpsTask() {
sk_sp<GrOpsTask> newOpsTask = this->drawingManager()->newOpsTask(
this->writeSurfaceView(), this->arenas(), fFlushTimeOpsTask);
this->willReplaceOpsTask(fOpsTask.get(), newOpsTask.get());
@@ -142,31 +135,31 @@
}
#ifdef SK_DEBUG
-void SurfaceFillContext::onValidate() const {
+void GrSurfaceFillContext::onValidate() const {
if (fOpsTask && !fOpsTask->isClosed()) {
SkASSERT(this->drawingManager()->getLastRenderTask(fWriteView.proxy()) == fOpsTask.get());
}
}
#endif
-void SurfaceFillContext::discard() {
+void GrSurfaceFillContext::discard() {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- GR_CREATE_TRACE_MARKER_CONTEXT("v1::SurfaceFillContext", "discard", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("GrSurfaceFillContext", "discard", fContext);
AutoCheckFlush acf(this->drawingManager());
this->getOpsTask()->discard();
}
-void SurfaceFillContext::internalClear(const SkIRect* scissor,
- std::array<float, 4> color,
- bool upgradePartialToFull) {
+void GrSurfaceFillContext::internalClear(const SkIRect* scissor,
+ std::array<float, 4> color,
+ bool upgradePartialToFull) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- GR_CREATE_TRACE_MARKER_CONTEXT("v1::SurfaceFillContext", "clear", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("GrSurfaceFillContext", "clear", fContext);
// There are three ways clears are handled: load ops, native clears, and draws. Load ops are
// only for fullscreen clears; native clears can be fullscreen or with scissors if the backend
@@ -227,9 +220,9 @@
}
}
-bool SurfaceFillContext::blitTexture(GrSurfaceProxyView view,
- const SkIRect& srcRect,
- const SkIPoint& dstPoint) {
+bool GrSurfaceFillContext::blitTexture(GrSurfaceProxyView view,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint) {
SkASSERT(view.asTextureProxy());
SkIRect clippedSrcRect;
SkIPoint clippedDstPoint;
@@ -248,5 +241,3 @@
this->fillRectToRectWithFP(srcRectF, dstRect, std::move(fp));
return true;
}
-
-} // namespace skgpu::v1
diff --git a/src/gpu/GrSurfaceFillContext.h b/src/gpu/GrSurfaceFillContext.h
new file mode 100644
index 0000000..cbd268a
--- /dev/null
+++ b/src/gpu/GrSurfaceFillContext.h
@@ -0,0 +1,206 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrSurfaceFillContext_DEFINED
+#define GrSurfaceFillContext_DEFINED
+
+#include "include/core/SkSize.h"
+#include "include/private/GrTypesPriv.h"
+#include "src/gpu/GrImageInfo.h"
+#include "src/gpu/GrOpsTask.h"
+#include "src/gpu/GrSurfaceContext.h"
+#include "src/gpu/GrSwizzle.h"
+#include "src/gpu/effects/GrMatrixEffect.h"
+
+#include <array>
+#include <tuple>
+
+class GrFragmentProcessor;
+class GrImageContext;
+class GrOp;
+class GrBackendFormat;
+class GrRecordingContext;
+class GrSurfaceProxyView;
+class SkColorSpace;
+
+class GrSurfaceFillContext : public GrSurfaceContext {
+public:
+ GrSurfaceFillContext(GrRecordingContext*,
+ GrSurfaceProxyView readView,
+ GrSurfaceProxyView writeView,
+ const GrColorInfo&,
+ bool flushTimeOpsTask = false);
+
+ GrSurfaceFillContext* asFillContext() override { return this; }
+
+ /**
+ * Provides a performance hint that the render target's contents are allowed
+ * to become undefined.
+ */
+ void discard();
+
+ /**
+ * Clear the rect of the render target to the given color.
+ * @param rect the rect to clear to
+ * @param color the color to clear to.
+ */
+ template <SkAlphaType AlphaType>
+ void clear(const SkIRect& rect, const SkRGBA4f<AlphaType>& color) {
+ this->internalClear(&rect, this->adjustColorAlphaType(color));
+ }
+
+ /** Clears the entire render target to the color. */
+ template <SkAlphaType AlphaType> void clear(const SkRGBA4f<AlphaType>& color) {
+ this->internalClear(nullptr, this->adjustColorAlphaType(color));
+ }
+
+ /**
+ * Clear at minimum the pixels within 'scissor', but is allowed to clear the full render target
+ * if that is the more performant option.
+ */
+ template <SkAlphaType AlphaType>
+ void clearAtLeast(const SkIRect& scissor, const SkRGBA4f<AlphaType>& color) {
+ this->internalClear(&scissor,
+ this->adjustColorAlphaType(color),
+ /* upgrade to full */ true);
+ }
+
+ /** Fills 'dstRect' with 'fp' */
+ void fillRectWithFP(const SkIRect& dstRect, std::unique_ptr<GrFragmentProcessor> fp);
+
+ /**
+ * A convenience version of fillRectWithFP that applies a coordinate transformation via
+ * GrMatrixEffect.
+ */
+ void fillRectWithFP(const SkIRect& dstRect,
+ const SkMatrix& localMatrix,
+ std::unique_ptr<GrFragmentProcessor> fp) {
+ fp = GrMatrixEffect::Make(localMatrix, std::move(fp));
+ this->fillRectWithFP(dstRect, std::move(fp));
+ }
+
+ /** Fills 'dstRect' with 'fp' using a local matrix that maps 'srcRect' to 'dstRect' */
+ void fillRectToRectWithFP(const SkRect& srcRect,
+ const SkIRect& dstRect,
+ std::unique_ptr<GrFragmentProcessor> fp) {
+ SkMatrix lm = SkMatrix::RectToRect(SkRect::Make(dstRect), srcRect);
+ this->fillRectWithFP(dstRect, lm, std::move(fp));
+ }
+
+ /** Fills 'dstRect' with 'fp' using a local matrix that maps 'srcRect' to 'dstRect' */
+ void fillRectToRectWithFP(const SkIRect& srcRect,
+ const SkIRect& dstRect,
+ std::unique_ptr<GrFragmentProcessor> fp) {
+ this->fillRectToRectWithFP(SkRect::Make(srcRect), dstRect, std::move(fp));
+ }
+
+ /** Fills the entire render target with the passed FP. */
+ void fillWithFP(std::unique_ptr<GrFragmentProcessor> fp) {
+ this->fillRectWithFP(SkIRect::MakeSize(fWriteView.proxy()->dimensions()), std::move(fp));
+ }
+
+ /**
+ * A convenience version of fillWithFP that applies a coordinate transformation via
+ * GrMatrixEffect and fills the entire render target.
+ */
+ void fillWithFP(const SkMatrix& localMatrix, std::unique_ptr<GrFragmentProcessor> fp) {
+ this->fillRectWithFP(
+ SkIRect::MakeSize(fWriteView.proxy()->dimensions()), localMatrix, std::move(fp));
+ }
+
+ /**
+ * Draws the src texture with no matrix. The dstRect is the dstPoint with the width and height
+ * of the srcRect. The srcRect and dstRect are clipped to the bounds of the src and dst surfaces
+ * respectively.
+ */
+ bool blitTexture(GrSurfaceProxyView view, const SkIRect& srcRect, const SkIPoint& dstPoint);
+
+ GrOpsTask* getOpsTask();
+
+ int numSamples() const { return this->asRenderTargetProxy()->numSamples(); }
+ bool wrapsVkSecondaryCB() const { return this->asRenderTargetProxy()->wrapsVkSecondaryCB(); }
+
+ SkArenaAlloc* arenaAlloc() { return this->arenas()->arenaAlloc(); }
+ GrSubRunAllocator* subRunAlloc() { return this->arenas()->subRunAlloc(); }
+
+#if GR_TEST_UTILS
+ GrOpsTask* testingOnly_PeekLastOpsTask() { return fOpsTask.get(); }
+#endif
+
+ const GrSurfaceProxyView& writeSurfaceView() const { return fWriteView; }
+
+protected:
+ /**
+ * Creates a constant color paint for a clear, using src-over if possible to improve batching.
+ */
+ static void ClearToGrPaint(std::array<float, 4> color, GrPaint* paint);
+
+ void addOp(GrOp::Owner);
+
+ GrOpsTask* replaceOpsTask();
+
+private:
+ sk_sp<GrArenas> arenas() { return fWriteView.proxy()->asRenderTargetProxy()->arenas(); }
+
+ template <SkAlphaType AlphaType>
+ static std::array<float, 4> ConvertColor(SkRGBA4f<AlphaType> color);
+
+ template <SkAlphaType AlphaType>
+ std::array<float, 4> adjustColorAlphaType(SkRGBA4f<AlphaType> color) const;
+
+ /** Override to be notified in subclass before the current ops task is replaced. */
+ virtual void willReplaceOpsTask(GrOpsTask* prevTask, GrOpsTask* nextTask) {}
+
+ /**
+ * Override to be called to participate in the decision to discard all previous ops if a
+ * fullscreen clear occurs.
+ */
+ virtual GrOpsTask::CanDiscardPreviousOps canDiscardPreviousOpsOnFullClear() const {
+ return GrOpsTask::CanDiscardPreviousOps::kYes;
+ }
+
+ void internalClear(const SkIRect* scissor,
+ std::array<float, 4> color,
+ bool upgradePartialToFull = false);
+
+ void addDrawOp(GrOp::Owner);
+
+ SkDEBUGCODE(void onValidate() const override;)
+
+ GrSurfaceProxyView fWriteView;
+
+ // The GrOpsTask can be closed by some other surface context that has picked it up. For this
+ // reason, the GrOpsTask should only ever be accessed via 'getOpsTask'.
+ sk_sp<GrOpsTask> fOpsTask;
+
+ bool fFlushTimeOpsTask;
+
+ using INHERITED = GrSurfaceContext;
+};
+
+template<>
+inline std::array<float, 4> GrSurfaceFillContext::ConvertColor<kPremul_SkAlphaType>(
+ SkPMColor4f color) {
+ return color.unpremul().array();
+}
+
+template<>
+inline std::array<float, 4> GrSurfaceFillContext::ConvertColor<kUnpremul_SkAlphaType>(
+ SkColor4f color) {
+ return color.premul().array();
+}
+
+template <SkAlphaType AlphaType>
+std::array<float, 4> GrSurfaceFillContext::adjustColorAlphaType(SkRGBA4f<AlphaType> color) const {
+ if (AlphaType == kUnknown_SkAlphaType ||
+ this->colorInfo().alphaType() == kUnknown_SkAlphaType) {
+ return color.array();
+ }
+ return (AlphaType == this->colorInfo().alphaType()) ? color.array() : ConvertColor(color);
+}
+
+#endif
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index b19f527..082b561 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -17,9 +17,9 @@
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrResourceProvider.h"
#include "src/gpu/GrSurface.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureRenderTargetProxy.h"
-#include "src/gpu/SurfaceFillContext.h"
#ifdef SK_DEBUG
#include "include/gpu/GrDirectContext.h"
@@ -310,7 +310,7 @@
GrSurfaceProxyView view(std::move(src), origin, GrSwizzle::RGBA());
if (dstContext && dstContext->blitTexture(std::move(view), srcRect, dstPoint)) {
if (outTask) {
- *outTask = dstContext->refRenderTask();
+ *outTask = sk_ref_sp(dstContext->getOpsTask());
}
return dstContext->asSurfaceProxyRef();
}
diff --git a/src/gpu/SurfaceFillContext.cpp b/src/gpu/SurfaceFillContext.cpp
deleted file mode 100644
index eab314d..0000000
--- a/src/gpu/SurfaceFillContext.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2021 Google LLC
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "src/gpu/SurfaceFillContext.h"
-
-#include "src/gpu/effects/GrMatrixEffect.h"
-
-namespace skgpu {
-
-void SurfaceFillContext::fillRectWithFP(const SkIRect& dstRect,
- const SkMatrix& localMatrix,
- std::unique_ptr<GrFragmentProcessor> fp) {
- fp = GrMatrixEffect::Make(localMatrix, std::move(fp));
- this->fillRectWithFP(dstRect, std::move(fp));
-}
-
-} // namespace skgpu
diff --git a/src/gpu/SurfaceFillContext.h b/src/gpu/SurfaceFillContext.h
deleted file mode 100644
index a24c8de..0000000
--- a/src/gpu/SurfaceFillContext.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright 2021 Google LLC
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SurfaceFillContext_DEFINED
-#define SurfaceFillContext_DEFINED
-
-#include "src/gpu/GrSurfaceContext.h"
-
-namespace skgpu {
-
-class SurfaceFillContext : public GrSurfaceContext {
-public:
-
- SurfaceFillContext* asFillContext() override { return this; }
-
- /**
- * Provides a performance hint that the render target's contents are allowed
- * to become undefined.
- */
- virtual void discard() = 0;
-
- /**
- * Clear the rect of the render target to the given color.
- * @param rect the rect to clear to
- * @param color the color to clear to.
- */
- template <SkAlphaType AlphaType>
- void clear(const SkIRect& rect, const SkRGBA4f<AlphaType>& color) {
- this->internalClear(&rect, this->adjustColorAlphaType(color));
- }
-
- /** Clears the entire render target to the color. */
- template <SkAlphaType AlphaType> void clear(const SkRGBA4f<AlphaType>& color) {
- this->internalClear(nullptr, this->adjustColorAlphaType(color));
- }
-
- /**
- * Clear at minimum the pixels within 'scissor', but is allowed to clear the full render target
- * if that is the more performant option.
- */
- template <SkAlphaType AlphaType>
- void clearAtLeast(const SkIRect& scissor, const SkRGBA4f<AlphaType>& color) {
- this->internalClear(&scissor,
- this->adjustColorAlphaType(color),
- /* upgrade to full */ true);
- }
-
- /** Fills 'dstRect' with 'fp' */
- virtual void fillRectWithFP(const SkIRect& dstRect, std::unique_ptr<GrFragmentProcessor>) = 0;
-
- /**
- * A convenience version of fillRectWithFP that applies a coordinate transformation via
- * GrMatrixEffect.
- */
- void fillRectWithFP(const SkIRect& dstRect,
- const SkMatrix& localMatrix,
- std::unique_ptr<GrFragmentProcessor>);
-
- /** Fills 'dstRect' with 'fp' using a local matrix that maps 'srcRect' to 'dstRect' */
- void fillRectToRectWithFP(const SkRect& srcRect,
- const SkIRect& dstRect,
- std::unique_ptr<GrFragmentProcessor> fp) {
- SkMatrix lm = SkMatrix::RectToRect(SkRect::Make(dstRect), srcRect);
- this->fillRectWithFP(dstRect, lm, std::move(fp));
- }
-
- /** Fills 'dstRect' with 'fp' using a local matrix that maps 'srcRect' to 'dstRect' */
- void fillRectToRectWithFP(const SkIRect& srcRect,
- const SkIRect& dstRect,
- std::unique_ptr<GrFragmentProcessor> fp) {
- this->fillRectToRectWithFP(SkRect::Make(srcRect), dstRect, std::move(fp));
- }
-
- /** Fills the entire render target with the passed FP. */
- void fillWithFP(std::unique_ptr<GrFragmentProcessor> fp) {
- this->fillRectWithFP(SkIRect::MakeSize(fWriteView.proxy()->dimensions()), std::move(fp));
- }
-
- /**
- * A convenience version of fillWithFP that applies a coordinate transformation via
- * GrMatrixEffect and fills the entire render target.
- */
- void fillWithFP(const SkMatrix& localMatrix, std::unique_ptr<GrFragmentProcessor> fp) {
- this->fillRectWithFP(SkIRect::MakeSize(fWriteView.proxy()->dimensions()),
- localMatrix,
- std::move(fp));
- }
-
- /**
- * Draws the src texture with no matrix. The dstRect is the dstPoint with the width and height
- * of the srcRect. The srcRect and dstRect are clipped to the bounds of the src and dst surfaces
- * respectively.
- */
- virtual bool blitTexture(GrSurfaceProxyView,
- const SkIRect& srcRect,
- const SkIPoint& dstPoint) = 0;
-
- virtual sk_sp<GrRenderTask> refRenderTask() = 0;
-
-protected:
- SurfaceFillContext(GrRecordingContext* rContext,
- GrSurfaceProxyView readView,
- GrSurfaceProxyView writeView,
- const GrColorInfo& colorInfo)
- : GrSurfaceContext(rContext, std::move(readView), colorInfo)
- , fWriteView(std::move(writeView)) {
- SkASSERT(this->asSurfaceProxy() == fWriteView.proxy());
- SkASSERT(this->origin() == fWriteView.origin());
- }
-
- template <SkAlphaType AlphaType>
- static std::array<float, 4> ConvertColor(SkRGBA4f<AlphaType> color);
-
- template <SkAlphaType AlphaType>
- std::array<float, 4> adjustColorAlphaType(SkRGBA4f<AlphaType> color) const;
-
- GrSurfaceProxyView fWriteView;
-
-private:
- virtual void internalClear(const SkIRect* scissor,
- std::array<float, 4> color,
- bool upgradePartialToFull = false) = 0;
-
- using INHERITED = GrSurfaceContext;
-};
-
-template<>
-inline std::array<float, 4> SurfaceFillContext::ConvertColor<kPremul_SkAlphaType>(
- SkPMColor4f color) {
- return color.unpremul().array();
-}
-
-template<>
-inline std::array<float, 4> SurfaceFillContext::ConvertColor<kUnpremul_SkAlphaType>(
- SkColor4f color) {
- return color.premul().array();
-}
-
-template <SkAlphaType AlphaType>
-std::array<float, 4> SurfaceFillContext::adjustColorAlphaType(SkRGBA4f<AlphaType> color) const {
- if (AlphaType == kUnknown_SkAlphaType ||
- this->colorInfo().alphaType() == kUnknown_SkAlphaType) {
- return color.array();
- }
- return (AlphaType == this->colorInfo().alphaType()) ? color.array() : ConvertColor(color);
-}
-
-} // namespace skgpu
-
-#endif // SurfaceFillContext_DEFINED
diff --git a/src/gpu/v1/Device.cpp b/src/gpu/v1/Device.cpp
index b7230b0..ff80195 100644
--- a/src/gpu/v1/Device.cpp
+++ b/src/gpu/v1/Device.cpp
@@ -291,7 +291,7 @@
return fSurfaceDrawContext.get();
}
-skgpu::SurfaceFillContext* Device::surfaceFillContext() {
+GrSurfaceFillContext* Device::surfaceFillContext() {
ASSERT_SINGLE_OWNER
return fSurfaceDrawContext.get();
}
diff --git a/src/gpu/v1/Device_v1.h b/src/gpu/v1/Device_v1.h
index f21d889..11e6191 100644
--- a/src/gpu/v1/Device_v1.h
+++ b/src/gpu/v1/Device_v1.h
@@ -106,7 +106,7 @@
SurfaceDrawContext* surfaceDrawContext() override;
const SurfaceDrawContext* surfaceDrawContext() const;
- skgpu::SurfaceFillContext* surfaceFillContext() override;
+ GrSurfaceFillContext* surfaceFillContext() override;
// set all pixels to 0
void clearAll();
diff --git a/src/gpu/v1/SurfaceDrawContext.cpp b/src/gpu/v1/SurfaceDrawContext.cpp
index d4b4c7f..8c8bdd8 100644
--- a/src/gpu/v1/SurfaceDrawContext.cpp
+++ b/src/gpu/v1/SurfaceDrawContext.cpp
@@ -294,11 +294,11 @@
sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps& surfaceProps,
bool flushTimeOpsTask)
- : SurfaceFillContext(rContext,
- std::move(readView),
- std::move(writeView),
- {colorType, kPremul_SkAlphaType, std::move(colorSpace)},
- flushTimeOpsTask)
+ : GrSurfaceFillContext(rContext,
+ std::move(readView),
+ std::move(writeView),
+ {colorType, kPremul_SkAlphaType, std::move(colorSpace)},
+ flushTimeOpsTask)
, fSurfaceProps(surfaceProps)
, fCanUseDynamicMSAA(
(fSurfaceProps.flags() & SkSurfaceProps::kDynamicMSAA_Flag) &&
diff --git a/src/gpu/v1/SurfaceDrawContext_v1.h b/src/gpu/v1/SurfaceDrawContext_v1.h
index 9cb51f0..17b6a47 100644
--- a/src/gpu/v1/SurfaceDrawContext_v1.h
+++ b/src/gpu/v1/SurfaceDrawContext_v1.h
@@ -18,10 +18,10 @@
#include "src/gpu/GrOpsTask.h"
#include "src/gpu/GrPaint.h"
#include "src/gpu/GrRenderTargetProxy.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrSurfaceProxyView.h"
#include "src/gpu/GrXferProcessor.h"
#include "src/gpu/geometry/GrQuad.h"
-#include "src/gpu/v1/SurfaceFillContext_v1.h"
class GrBackendSemaphore;
class GrClip;
@@ -60,7 +60,7 @@
/**
* A helper object to orchestrate commands (draws, etc...) for GrSurfaces that are GrRenderTargets.
*/
-class SurfaceDrawContext : public SurfaceFillContext {
+class SurfaceDrawContext : public GrSurfaceFillContext {
public:
static std::unique_ptr<SurfaceDrawContext> Make(GrRecordingContext*,
GrColorType,
@@ -707,7 +707,7 @@
bool fPreserveOpsOnFullClear_TestingOnly = false;
#endif
SkGlyphRunListPainter fGlyphPainter;
- using INHERITED = SurfaceFillContext;
+ using INHERITED = GrSurfaceFillContext;
};
} // namespace skgpu::v1
diff --git a/src/gpu/v1/SurfaceFillContext_v1.h b/src/gpu/v1/SurfaceFillContext_v1.h
deleted file mode 100644
index 8961584..0000000
--- a/src/gpu/v1/SurfaceFillContext_v1.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2020 Google LLC
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SurfaceFillContext_v1_DEFINED
-#define SurfaceFillContext_v1_DEFINED
-
-#include "include/core/SkSize.h"
-#include "include/private/GrTypesPriv.h"
-#include "src/gpu/GrImageInfo.h"
-#include "src/gpu/GrOpsTask.h"
-#include "src/gpu/GrSwizzle.h"
-#include "src/gpu/SurfaceFillContext.h"
-#include "src/gpu/effects/GrMatrixEffect.h"
-
-#include <array>
-#include <tuple>
-
-class GrFragmentProcessor;
-class GrImageContext;
-class GrOp;
-class GrBackendFormat;
-class GrRecordingContext;
-class GrSurfaceProxyView;
-class SkColorSpace;
-
-namespace skgpu::v1 {
-
-class SurfaceFillContext : public skgpu::SurfaceFillContext {
-public:
- SurfaceFillContext(GrRecordingContext*,
- GrSurfaceProxyView readView,
- GrSurfaceProxyView writeView,
- const GrColorInfo&,
- bool flushTimeOpsTask = false);
-
- void discard() override;
-
- void fillRectWithFP(const SkIRect& dstRect, std::unique_ptr<GrFragmentProcessor> fp) override;
-
- bool blitTexture(GrSurfaceProxyView view,
- const SkIRect& srcRect,
- const SkIPoint& dstPoint) override;
-
- GrOpsTask* getOpsTask();
- sk_sp<GrRenderTask> refRenderTask() override;
-
- int numSamples() const { return this->asRenderTargetProxy()->numSamples(); }
- bool wrapsVkSecondaryCB() const { return this->asRenderTargetProxy()->wrapsVkSecondaryCB(); }
-
- SkArenaAlloc* arenaAlloc() { return this->arenas()->arenaAlloc(); }
- GrSubRunAllocator* subRunAlloc() { return this->arenas()->subRunAlloc(); }
-
-#if GR_TEST_UTILS
- GrOpsTask* testingOnly_PeekLastOpsTask() { return fOpsTask.get(); }
-#endif
-
- const GrSurfaceProxyView& writeSurfaceView() const { return fWriteView; }
-
-protected:
- /**
- * Creates a constant color paint for a clear, using src-over if possible to improve batching.
- */
- static void ClearToGrPaint(std::array<float, 4> color, GrPaint* paint);
-
- void addOp(GrOp::Owner);
-
- GrOpsTask* replaceOpsTask();
-
-private:
- sk_sp<GrArenas> arenas() { return fWriteView.proxy()->asRenderTargetProxy()->arenas(); }
-
- /** Override to be notified in subclass before the current ops task is replaced. */
- virtual void willReplaceOpsTask(GrOpsTask* prevTask, GrOpsTask* nextTask) {}
-
- /**
- * Override to be called to participate in the decision to discard all previous ops if a
- * fullscreen clear occurs.
- */
- virtual GrOpsTask::CanDiscardPreviousOps canDiscardPreviousOpsOnFullClear() const {
- return GrOpsTask::CanDiscardPreviousOps::kYes;
- }
-
- void internalClear(const SkIRect* scissor,
- std::array<float, 4> color,
- bool upgradePartialToFull = false) override;
-
- void addDrawOp(GrOp::Owner);
-
- SkDEBUGCODE(void onValidate() const override;)
-
- // The GrOpsTask can be closed by some other surface context that has picked it up. For this
- // reason, the GrOpsTask should only ever be accessed via 'getOpsTask'.
- sk_sp<GrOpsTask> fOpsTask;
-
- bool fFlushTimeOpsTask;
-
- using INHERITED = skgpu::SurfaceFillContext;
-};
-
-} // namespace skgpu::v1
-
-#endif // SurfaceFillContext_v1_DEFINED
diff --git a/src/gpu/v2/Device.cpp b/src/gpu/v2/Device.cpp
index a6be7b8..bb1f365 100644
--- a/src/gpu/v2/Device.cpp
+++ b/src/gpu/v2/Device.cpp
@@ -26,7 +26,7 @@
GrSurfaceProxyView Device::readSurfaceView() { return {}; }
-skgpu::SurfaceFillContext* Device::surfaceFillContext() {
+GrSurfaceFillContext* Device::surfaceFillContext() {
return nullptr;
}
diff --git a/src/gpu/v2/Device_v2.h b/src/gpu/v2/Device_v2.h
index 6270c2c..f3f1a6e 100644
--- a/src/gpu/v2/Device_v2.h
+++ b/src/gpu/v2/Device_v2.h
@@ -44,7 +44,7 @@
GrSurfaceProxyView readSurfaceView() override;
- skgpu::SurfaceFillContext* surfaceFillContext() override;
+ GrSurfaceFillContext* surfaceFillContext() override;
bool wait(int numSemaphores,
const GrBackendSemaphore* waitSemaphores,
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index d4f6073..14689ab 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -33,11 +33,11 @@
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrSemaphore.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/GrTextureProxyPriv.h"
#include "src/gpu/GrYUVATextureProxies.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrTextureEffect.h"
#include "src/gpu/gl/GrGLTexture.h"
diff --git a/src/image/SkImage_GpuBase.h b/src/image/SkImage_GpuBase.h
index d5331af..1392dde 100644
--- a/src/image/SkImage_GpuBase.h
+++ b/src/image/SkImage_GpuBase.h
@@ -17,6 +17,7 @@
class GrColorSpaceXform;
class GrDirectContext;
class GrImageContext;
+class GrSurfaceFillContext;
class SkColorSpace;
class SkImage_GpuBase : public SkImage_Base {
diff --git a/src/image/SkImage_GpuYUVA.cpp b/src/image/SkImage_GpuYUVA.cpp
index b3924cd..6fe926c 100644
--- a/src/image/SkImage_GpuYUVA.cpp
+++ b/src/image/SkImage_GpuYUVA.cpp
@@ -22,8 +22,8 @@
#include "src/gpu/GrImageContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrRecordingContextPriv.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrBicubicEffect.h"
#include "src/gpu/effects/GrYUVtoRGBEffect.h"
#include "src/image/SkImage_Gpu.h"
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index bed740a..6763df9 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -28,9 +28,9 @@
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrSamplerState.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrYUVATextureProxies.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrYUVtoRGBEffect.h"
#endif
diff --git a/tests/BackendAllocationTest.cpp b/tests/BackendAllocationTest.cpp
index 21c5cea..1cedf96 100644
--- a/tests/BackendAllocationTest.cpp
+++ b/tests/BackendAllocationTest.cpp
@@ -12,7 +12,7 @@
#include "src/core/SkAutoPixmapStorage.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
-#include "src/gpu/SurfaceFillContext.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/effects/GrBlendFragmentProcessor.h"
#include "src/gpu/effects/GrTextureEffect.h"
#include "src/image/SkImage_Base.h"
@@ -297,7 +297,7 @@
#endif
} else {
auto name = SkStringPrintf("%s::readPixels",
- (renderableCtx == GrRenderable::kYes ? "SurfaceFillContext"
+ (renderableCtx == GrRenderable::kYes ? "GrSurfaceFillContext"
: "GrSurfaceContext"));
check_solid_pixmap(reporter, expectedColor, actual, colorType, label, name.c_str());
}
diff --git a/tests/CopySurfaceTest.cpp b/tests/CopySurfaceTest.cpp
index bbe4d09..baf928f 100644
--- a/tests/CopySurfaceTest.cpp
+++ b/tests/CopySurfaceTest.cpp
@@ -18,10 +18,10 @@
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrImageInfo.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrSurfaceProxy.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "tests/Test.h"
#include "tools/gpu/GrContextFactory.h"
#include "tools/gpu/ProxyUtils.h"
diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp
index 7e35754..5823835 100644
--- a/tests/EGLImageTest.cpp
+++ b/tests/EGLImageTest.cpp
@@ -9,9 +9,9 @@
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrShaderCaps.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxyPriv.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/gl/GrGLGpu.h"
#include "src/gpu/gl/GrGLUtil.h"
#include "tests/Test.h"
diff --git a/tests/ReadWritePixelsGpuTest.cpp b/tests/ReadWritePixelsGpuTest.cpp
index 1a27f4d..fa381c1 100644
--- a/tests/ReadWritePixelsGpuTest.cpp
+++ b/tests/ReadWritePixelsGpuTest.cpp
@@ -15,7 +15,7 @@
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrImageInfo.h"
#include "src/gpu/GrSurfaceContext.h"
-#include "src/gpu/SurfaceFillContext.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/effects/GrTextureEffect.h"
#include "tests/Test.h"
#include "tests/TestUtils.h"
diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp
index d304c3a..8a7cbbb 100644
--- a/tests/RectangleTextureTest.cpp
+++ b/tests/RectangleTextureTest.cpp
@@ -11,9 +11,9 @@
#include "include/gpu/GrDirectContext.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "src/gpu/effects/GrTextureEffect.h"
#ifdef SK_GL
#include "src/gpu/gl/GrGLGpu.h"
@@ -40,7 +40,7 @@
static void test_clear(skiatest::Reporter* reporter, GrDirectContext* dContext,
GrSurfaceContext* rectContext) {
- if (auto sfc = rectContext->asFillContext()) {
+ if (GrSurfaceFillContext* sfc = rectContext->asFillContext()) {
// Clear the whole thing.
GrColor color0 = GrColorPackRGBA(0xA, 0xB, 0xC, 0xD);
sfc->clear(SkPMColor4f::FromBytes_RGBA(color0));
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 31b6f86..2c0bc52 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -25,7 +25,7 @@
#include "src/gpu/GrImageInfo.h"
#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrResourceProvider.h"
-#include "src/gpu/SurfaceFillContext.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/image/SkImage_Base.h"
#include "src/image/SkImage_Gpu.h"
#include "src/image/SkSurface_Gpu.h"
diff --git a/tests/WrappedSurfaceCopyOnWriteTest.cpp b/tests/WrappedSurfaceCopyOnWriteTest.cpp
index bc184e9..18a06b3 100644
--- a/tests/WrappedSurfaceCopyOnWriteTest.cpp
+++ b/tests/WrappedSurfaceCopyOnWriteTest.cpp
@@ -13,8 +13,8 @@
#include "src/core/SkCanvasPriv.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
+#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/GrSurfaceProxy.h"
-#include "src/gpu/SurfaceFillContext.h"
#include "tests/Test.h"
#include "tests/TestUtils.h"
#include "tools/gpu/BackendSurfaceFactory.h"
@@ -22,6 +22,8 @@
#if SK_GPU_V1
#include "src/gpu/v1/SurfaceDrawContext_v1.h"
+#else
+#include "src/gpu/GrSurfaceFillContext.h"
#endif
DEF_GPUTEST_FOR_ALL_CONTEXTS(WrappedSurfaceCopyOnWrite, reporter, ctxInfo) {