GrRenderTargetContext->GrSurfaceDrawContext
Just the class/files. variable names and additional comments to follow.
Change-Id: Ic03d07fd5009eaf3d706c2536486a117328963fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342617
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/tests/BulkRectTest.cpp b/tests/BulkRectTest.cpp
index c0a4d99..8e37aa7 100644
--- a/tests/BulkRectTest.cpp
+++ b/tests/BulkRectTest.cpp
@@ -9,13 +9,13 @@
#include "src/core/SkBlendModePriv.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/ops/GrFillRectOp.h"
#include "src/gpu/ops/GrTextureOp.h"
#include "tests/Test.h"
-static std::unique_ptr<GrRenderTargetContext> new_RTC(GrRecordingContext* rContext) {
- return GrRenderTargetContext::Make(
+static std::unique_ptr<GrSurfaceDrawContext> new_RTC(GrRecordingContext* rContext) {
+ return GrSurfaceDrawContext::Make(
rContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact, {128, 128});
}
@@ -53,9 +53,9 @@
return;
}
- std::unique_ptr<GrRenderTargetContext> rtc = new_RTC(dContext);
+ std::unique_ptr<GrSurfaceDrawContext> rtc = new_RTC(dContext);
- auto quads = new GrRenderTargetContext::QuadSetEntry[requestedTotNumQuads];
+ auto quads = new GrSurfaceDrawContext::QuadSetEntry[requestedTotNumQuads];
for (int i = 0; i < requestedTotNumQuads; ++i) {
quads[i].fRect = SkRect::MakeWH(100.5f, 100.5f); // prevent the int non-AA optimization
@@ -97,7 +97,7 @@
bool allUniqueProxies,
int requestedTotNumQuads, int expectedNumOps) {
- std::unique_ptr<GrRenderTargetContext> rtc = new_RTC(dContext);
+ std::unique_ptr<GrSurfaceDrawContext> rtc = new_RTC(dContext);
GrSurfaceProxyView proxyViewA, proxyViewB;
@@ -112,7 +112,7 @@
GrSwizzle::RGBA());
}
- auto set = new GrRenderTargetContext::TextureSetEntry[requestedTotNumQuads];
+ auto set = new GrSurfaceDrawContext::TextureSetEntry[requestedTotNumQuads];
for (int i = 0; i < requestedTotNumQuads; ++i) {
if (!allUniqueProxies) {
diff --git a/tests/ClearTest.cpp b/tests/ClearTest.cpp
index be121e3..16d704e 100644
--- a/tests/ClearTest.cpp
+++ b/tests/ClearTest.cpp
@@ -23,7 +23,7 @@
#include "src/gpu/GrColor.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrImageInfo.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/ops/GrClearOp.h"
#include "tests/Test.h"
#include "tools/gpu/GrContextFactory.h"
@@ -31,7 +31,7 @@
#include <cstdint>
#include <memory>
-static bool check_rect(GrDirectContext* dContext, GrRenderTargetContext* rtc, const SkIRect& rect,
+static bool check_rect(GrDirectContext* dContext, GrSurfaceDrawContext* rtc, const SkIRect& rect,
uint32_t expectedValue, uint32_t* actualValue, int* failX, int* failY) {
int w = rect.width();
int h = rect.height();
@@ -61,8 +61,8 @@
return true;
}
-std::unique_ptr<GrRenderTargetContext> newRTC(GrRecordingContext* rContext, int w, int h) {
- return GrRenderTargetContext::Make(
+std::unique_ptr<GrSurfaceDrawContext> newRTC(GrRecordingContext* rContext, int w, int h) {
+ return GrSurfaceDrawContext::Make(
rContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact, {w, h});
}
@@ -71,7 +71,7 @@
static const int kH = 10;
SkIRect fullRect = SkIRect::MakeWH(kW, kH);
- std::unique_ptr<GrRenderTargetContext> rtContext;
+ std::unique_ptr<GrSurfaceDrawContext> rtContext;
// A rectangle that is inset by one on all sides and the 1-pixel wide rectangles that surround
// it.
diff --git a/tests/CopySurfaceTest.cpp b/tests/CopySurfaceTest.cpp
index 069a083..f05dc86 100644
--- a/tests/CopySurfaceTest.cpp
+++ b/tests/CopySurfaceTest.cpp
@@ -18,8 +18,8 @@
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrImageInfo.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrSurfaceContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrSurfaceProxy.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
diff --git a/tests/DefaultPathRendererTest.cpp b/tests/DefaultPathRendererTest.cpp
index 50e039a..376f54c 100644
--- a/tests/DefaultPathRendererTest.cpp
+++ b/tests/DefaultPathRendererTest.cpp
@@ -27,8 +27,8 @@
#include "src/gpu/GrFragmentProcessor.h"
#include "src/gpu/GrImageInfo.h"
#include "src/gpu/GrPaint.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrStyle.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/effects/generated/GrConstColorProcessor.h"
#include "tests/Test.h"
#include "tools/gpu/GrContextFactory.h"
@@ -39,7 +39,7 @@
options->fGpuPathRenderers = GpuPathRenderers::kNone;
}
-static SkBitmap read_back(GrDirectContext* dContext, GrRenderTargetContext* rtc,
+static SkBitmap read_back(GrDirectContext* dContext, GrSurfaceDrawContext* rtc,
int width, int height) {
SkImageInfo dstII = SkImageInfo::MakeN32Premul(width, height);
@@ -84,7 +84,7 @@
GrStyle style(SkStrokeRec::kFill_InitStyle);
{
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
dContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox,
{kBigSize/2 + 1, kBigSize/2 + 1});
@@ -102,7 +102,7 @@
}
{
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
dContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact, {kBigSize, kBigSize});
rtc->clear(SK_PMColor4fBLACK);
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index 92a7295..0928dd0 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -33,8 +33,8 @@
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrRenderTargetProxy.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGpuDevice.h"
#include "src/gpu/gl/GrGLDefines.h"
diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp
index 0551868..2e61d24 100644
--- a/tests/DrawOpAtlasTest.cpp
+++ b/tests/DrawOpAtlasTest.cpp
@@ -28,7 +28,7 @@
#include "src/gpu/GrMemoryPool.h"
#include "src/gpu/GrOnFlushResourceProvider.h"
#include "src/gpu/GrOpFlushState.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/GrXferProcessor.h"
#include "src/gpu/ops/GrAtlasTextOp.h"
@@ -196,7 +196,7 @@
auto gpu = context->priv().getGpu();
auto resourceProvider = context->priv().resourceProvider();
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
context, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox, {32, 32});
SkPaint paint;
diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp
index 6189974..b7e8c90 100644
--- a/tests/EGLImageTest.cpp
+++ b/tests/EGLImageTest.cpp
@@ -8,8 +8,8 @@
#include "include/gpu/GrDirectContext.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrShaderCaps.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxyPriv.h"
#include "src/gpu/gl/GrGLGpu.h"
@@ -184,14 +184,14 @@
// Should not be able to wrap as a RT
{
- auto temp = GrRenderTargetContext::MakeFromBackendTexture(context0,
- colorInfo.colorType(),
- /*color space*/ nullptr,
- backendTex,
- 1,
- origin,
- /*surface props*/ nullptr,
- /*release helper*/ nullptr);
+ auto temp = GrSurfaceDrawContext::MakeFromBackendTexture(context0,
+ colorInfo.colorType(),
+ /*color space*/ nullptr,
+ backendTex,
+ 1,
+ origin,
+ /*surface props*/ nullptr,
+ /*release helper*/ nullptr);
if (temp) {
ERRORF(reporter, "Should not be able to wrap an EXTERNAL texture as a RT.");
}
diff --git a/tests/GrCCPRTest.cpp b/tests/GrCCPRTest.cpp
index 06bbb9b..60fbe13 100644
--- a/tests/GrCCPRTest.cpp
+++ b/tests/GrCCPRTest.cpp
@@ -21,7 +21,7 @@
#include "src/gpu/GrPaint.h"
#include "src/gpu/GrPathRenderer.h"
#include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/ccpr/GrCCPathCache.h"
#include "src/gpu/ccpr/GrCoverageCountingPathRenderer.h"
@@ -41,7 +41,7 @@
private:
SkIRect getConservativeBounds() const final { return fPath.getBounds().roundOut(); }
- Effect apply(GrRecordingContext* context, GrRenderTargetContext* rtc, GrAAType,
+ Effect apply(GrRecordingContext* context, GrSurfaceDrawContext* rtc, GrAAType,
bool hasUserStencilSettings, GrAppliedClip* out,
SkRect* bounds) const override {
out->addCoverageFP(fCCPR->makeClipProcessor(
@@ -59,7 +59,7 @@
CCPRPathDrawer(sk_sp<GrDirectContext> dContext, skiatest::Reporter* reporter, DoStroke doStroke)
: fDContext(dContext)
, fCCPR(fDContext->priv().drawingManager()->getCoverageCountingPathRenderer())
- , fRTC(GrRenderTargetContext::Make(
+ , fRTC(GrSurfaceDrawContext::Make(
fDContext.get(), GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact,
{kCanvasSize, kCanvasSize}))
, fDoStroke(DoStroke::kYes == doStroke) {
@@ -67,7 +67,7 @@
ERRORF(reporter, "ccpr not enabled in GrDirectContext for ccpr tests");
}
if (!fRTC) {
- ERRORF(reporter, "failed to create GrRenderTargetContext for ccpr tests");
+ ERRORF(reporter, "failed to create GrSurfaceDrawContext for ccpr tests");
}
}
@@ -127,7 +127,7 @@
private:
sk_sp<GrDirectContext> fDContext;
GrCoverageCountingPathRenderer* fCCPR;
- std::unique_ptr<GrRenderTargetContext> fRTC;
+ std::unique_ptr<GrSurfaceDrawContext> fRTC;
const bool fDoStroke;
};
diff --git a/tests/GrClipStackTest.cpp b/tests/GrClipStackTest.cpp
index 2af6c22..952754e 100644
--- a/tests/GrClipStackTest.cpp
+++ b/tests/GrClipStackTest.cpp
@@ -20,7 +20,7 @@
#include "src/core/SkRectPriv.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
namespace {
@@ -1638,7 +1638,7 @@
SkSimpleMatrixProvider matrixProvider = SkMatrix::I();
sk_sp<GrDirectContext> context = GrDirectContext::MakeMock(&options);
- std::unique_ptr<GrRenderTargetContext> rtc = GrRenderTargetContext::Make(
+ std::unique_ptr<GrSurfaceDrawContext> rtc = GrSurfaceDrawContext::Make(
context.get(), GrColorType::kRGBA_8888, SkColorSpace::MakeSRGB(),
SkBackingFit::kExact, kDeviceBounds.size());
@@ -1785,7 +1785,7 @@
SkSimpleMatrixProvider matrixProvider = SkMatrix::I();
sk_sp<GrDirectContext> context = GrDirectContext::MakeMock(nullptr);
- std::unique_ptr<GrRenderTargetContext> rtc = GrRenderTargetContext::Make(
+ std::unique_ptr<GrSurfaceDrawContext> rtc = GrSurfaceDrawContext::Make(
context.get(), GrColorType::kRGBA_8888, SkColorSpace::MakeSRGB(),
SkBackingFit::kExact, kDeviceBounds.size());
@@ -1835,7 +1835,7 @@
DEF_TEST(GrClipStack_SimpleApply, r) {
SkSimpleMatrixProvider matrixProvider = SkMatrix::I();
sk_sp<GrDirectContext> context = GrDirectContext::MakeMock(nullptr);
- std::unique_ptr<GrRenderTargetContext> rtc = GrRenderTargetContext::Make(
+ std::unique_ptr<GrSurfaceDrawContext> rtc = GrSurfaceDrawContext::Make(
context.get(), GrColorType::kRGBA_8888, SkColorSpace::MakeSRGB(),
SkBackingFit::kExact, kDeviceBounds.size());
@@ -1965,7 +1965,7 @@
sk_gpu_test::GrContextFactory::IsRenderingContext,
r, ctxInfo, only_allow_default) {
GrDirectContext* context = ctxInfo.directContext();
- std::unique_ptr<GrRenderTargetContext> rtc = GrRenderTargetContext::Make(
+ std::unique_ptr<GrSurfaceDrawContext> rtc = GrSurfaceDrawContext::Make(
context, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact, kDeviceBounds.size());
SkSimpleMatrixProvider matrixProvider = SkMatrix::I();
diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp
index 6426269..1c5612d 100644
--- a/tests/GrMeshTest.cpp
+++ b/tests/GrMeshTest.cpp
@@ -21,8 +21,8 @@
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrOpsRenderPass.h"
#include "src/gpu/GrProgramInfo.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrResourceProvider.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
#include "src/gpu/glsl/GrGLSLVarying.h"
@@ -96,7 +96,7 @@
*/
static void run_test(GrDirectContext*, const char* testName, skiatest::Reporter*,
- const std::unique_ptr<GrRenderTargetContext>&, const SkBitmap& gold,
+ const std::unique_ptr<GrSurfaceDrawContext>&, const SkBitmap& gold,
std::function<void(DrawMeshHelper*)> prepareFn,
std::function<void(DrawMeshHelper*)> executeFn);
@@ -110,7 +110,7 @@
#endif
auto dContext = ctxInfo.directContext();
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
dContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact,
{kImageWidth, kImageHeight});
if (!rtc) {
@@ -583,7 +583,7 @@
static void run_test(GrDirectContext* dContext, const char* testName,
skiatest::Reporter* reporter,
- const std::unique_ptr<GrRenderTargetContext>& rtc, const SkBitmap& gold,
+ const std::unique_ptr<GrSurfaceDrawContext>& rtc, const SkBitmap& gold,
std::function<void(DrawMeshHelper*)> prepareFn,
std::function<void(DrawMeshHelper*)> executeFn) {
const int w = gold.width(), h = gold.height(), rowBytes = gold.rowBytes();
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index 35e038a..96ef0ae 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -18,8 +18,8 @@
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrSemaphore.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrSurfaceProxyPriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxy.h"
@@ -348,7 +348,7 @@
}
// Create a new render target and draw 'mipmapView' into it using the provided 'filter'.
-static std::unique_ptr<GrRenderTargetContext> draw_mipmap_into_new_render_target(
+static std::unique_ptr<GrSurfaceDrawContext> draw_mipmap_into_new_render_target(
GrRecordingContext* rContext,
GrColorType colorType,
SkAlphaType alphaType,
@@ -365,12 +365,12 @@
SkBudgeted::kYes,
GrProtected::kNo);
- auto rtc = GrRenderTargetContext::Make(rContext,
- colorType,
- nullptr,
- std::move(renderTarget),
- kTopLeft_GrSurfaceOrigin,
- nullptr);
+ auto rtc = GrSurfaceDrawContext::Make(rContext,
+ colorType,
+ nullptr,
+ std::move(renderTarget),
+ kTopLeft_GrSurfaceOrigin,
+ nullptr);
rtc->drawTexture(nullptr,
std::move(mipmapView),
@@ -426,7 +426,7 @@
// dirty again until GrRenderTask::makeClosed().
mipmapProxy->markMipmapsClean();
- auto mipmapRTC = GrRenderTargetContext::Make(
+ auto mipmapRTC = GrSurfaceDrawContext::Make(
dContext.get(), colorType, nullptr, mipmapProxy, kTopLeft_GrSurfaceOrigin, nullptr);
mipmapRTC->clear({.1f,.2f,.3f,.4f});
diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp
index bc7f743..fba900f 100644
--- a/tests/GrPipelineDynamicStateTest.cpp
+++ b/tests/GrPipelineDynamicStateTest.cpp
@@ -19,8 +19,8 @@
#include "src/gpu/GrOpsRenderPass.h"
#include "src/gpu/GrProgramInfo.h"
#include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrResourceProvider.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
#include "src/gpu/glsl/GrGLSLVarying.h"
@@ -186,7 +186,7 @@
auto dContext = ctxInfo.directContext();
GrResourceProvider* rp = dContext->priv().resourceProvider();
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
dContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact,
{kScreenSize, kScreenSize});
if (!rtc) {
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index 7c849f5..204dd8c 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -17,8 +17,8 @@
#include "src/gpu/GrImageInfo.h"
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrRenderTarget.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrResourceProvider.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTexture.h"
#include "tests/Test.h"
#include "tests/TestUtils.h"
@@ -289,7 +289,7 @@
{
std::unique_ptr<GrSurfaceContext> surfCtx;
if (renderable == GrRenderable::kYes) {
- surfCtx = GrRenderTargetContext::Make(
+ surfCtx = GrSurfaceDrawContext::Make(
dContext, combo.fColorType, nullptr, fit,
{desc.fWidth, desc.fHeight}, 1, GrMipmapped::kNo,
GrProtected::kNo, kTopLeft_GrSurfaceOrigin);
diff --git a/tests/GrThreadSafeCacheTest.cpp b/tests/GrThreadSafeCacheTest.cpp
index 7f8b88c..6db901b 100644
--- a/tests/GrThreadSafeCacheTest.cpp
+++ b/tests/GrThreadSafeCacheTest.cpp
@@ -18,8 +18,8 @@
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrStyle.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrThreadSafeCache.h"
#include "tests/Test.h"
#include "tests/TestUtils.h"
@@ -35,17 +35,17 @@
return SkImageInfo::Make(wh, wh, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
}
-static std::unique_ptr<GrRenderTargetContext> new_RTC(GrRecordingContext* rContext, int wh) {
- return GrRenderTargetContext::Make(rContext,
- GrColorType::kRGBA_8888,
- nullptr,
- SkBackingFit::kExact,
- {wh, wh},
- 1,
- GrMipMapped::kNo,
- GrProtected::kNo,
- kImageOrigin,
- SkBudgeted::kYes);
+static std::unique_ptr<GrSurfaceDrawContext> new_RTC(GrRecordingContext* rContext, int wh) {
+ return GrSurfaceDrawContext::Make(rContext,
+ GrColorType::kRGBA_8888,
+ nullptr,
+ SkBackingFit::kExact,
+ {wh, wh},
+ 1,
+ GrMipMapped::kNo,
+ GrProtected::kNo,
+ kImageOrigin,
+ SkBudgeted::kYes);
}
static void create_view_key(GrUniqueKey* key, int wh, int id) {
@@ -640,7 +640,7 @@
const GrSurfaceProxyView& lazyView,
sk_sp<GrThreadSafeCache::Trampoline> trampoline) {
- std::unique_ptr<GrRenderTargetContext> rtc = new_RTC(dContext, wh);
+ std::unique_ptr<GrSurfaceDrawContext> rtc = new_RTC(dContext, wh);
GrPaint paint;
paint.setColor4f({0.0f, 0.0f, 1.0f, 1.0f});
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index 2004335..2bc4f3b 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -15,7 +15,7 @@
#include "src/gpu/GrOnFlushResourceProvider.h"
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrSurfaceProxy.h"
#include "src/gpu/GrSurfaceProxyPriv.h"
#include "src/gpu/GrTexture.h"
@@ -177,7 +177,7 @@
SkIRect getConservativeBounds() const final {
return SkIRect::MakeSize(fAtlas->dimensions());
}
- Effect apply(GrRecordingContext* context, GrRenderTargetContext*, GrAAType,
+ Effect apply(GrRecordingContext* context, GrSurfaceDrawContext*, GrAAType,
bool hasUserStencilSettings, GrAppliedClip* out,
SkRect* bounds) const override {
GrProxyProvider* proxyProvider = context->priv().proxyProvider();
@@ -205,10 +205,10 @@
for (bool nullTexture : {false, true}) {
LazyProxyTest test(reporter);
ctx->priv().addOnFlushCallbackObject(&test);
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
ctx.get(), GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact, {100, 100});
REPORTER_ASSERT(reporter, rtc);
- auto mockAtlas = GrRenderTargetContext::Make(
+ auto mockAtlas = GrSurfaceDrawContext::Make(
ctx.get(), GrColorType::kAlpha_F16, nullptr, SkBackingFit::kExact, {10, 10});
REPORTER_ASSERT(reporter, mockAtlas);
LazyProxyTest::Clip clip(&test, mockAtlas->asTextureProxy());
@@ -380,7 +380,7 @@
sk_sp<GrDirectContext> ctx = GrDirectContext::MakeMock(&mockOptions, GrContextOptions());
GrProxyProvider* proxyProvider = ctx->priv().proxyProvider();
for (bool failInstantiation : {false, true}) {
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
ctx.get(), GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact, {100, 100});
REPORTER_ASSERT(reporter, rtc);
diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp
index 77bf5da..16a493d 100644
--- a/tests/OnFlushCallbackTest.cpp
+++ b/tests/OnFlushCallbackTest.cpp
@@ -17,8 +17,8 @@
#include "src/gpu/GrOnFlushResourceProvider.h"
#include "src/gpu/GrProgramInfo.h"
#include "src/gpu/GrProxyProvider.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrResourceProvider.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/effects/GrTextureEffect.h"
#include "src/gpu/geometry/GrQuad.h"
@@ -467,9 +467,9 @@
int start,
GrSurfaceProxyView atlasView,
SkAlphaType atlasAlphaType) {
- auto rtc = GrRenderTargetContext::Make(
- rContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox,
- {3 * kDrawnTileSize, kDrawnTileSize});
+ auto rtc = GrSurfaceDrawContext::Make(
+ rContext, GrColorType::kRGBA_8888, nullptr,
+ SkBackingFit::kApprox, {3 * kDrawnTileSize, kDrawnTileSize});
rtc->clear({ 1, 0, 0, 1 });
@@ -579,7 +579,7 @@
static const int kFinalWidth = 6*kDrawnTileSize;
static const int kFinalHeight = kDrawnTileSize;
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
dContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox,
{kFinalWidth, kFinalHeight});
diff --git a/tests/PathRendererCacheTests.cpp b/tests/PathRendererCacheTests.cpp
index f7af666..e8c091a 100644
--- a/tests/PathRendererCacheTests.cpp
+++ b/tests/PathRendererCacheTests.cpp
@@ -12,10 +12,10 @@
#include "include/gpu/GrRecordingContext.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrResourceCache.h"
#include "src/gpu/GrSoftwarePathRenderer.h"
#include "src/gpu/GrStyle.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/effects/GrPorterDuffXferProcessor.h"
#include "src/gpu/geometry/GrStyledShape.h"
#include "src/gpu/ops/GrTriangulatingPathRenderer.h"
@@ -31,7 +31,7 @@
}
static void draw_path(GrRecordingContext* rContext,
- GrRenderTargetContext* renderTargetContext,
+ GrSurfaceDrawContext* renderTargetContext,
const SkPath& path,
GrPathRenderer* pr,
GrAAType aaType,
@@ -83,7 +83,7 @@
dContext->setResourceCacheLimit(8000000);
GrResourceCache* cache = dContext->priv().getResourceCache();
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
dContext.get(), GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox, {800, 800}, 1,
GrMipmapped::kNo, GrProtected::kNo, kTopLeft_GrSurfaceOrigin);
if (!rtc) {
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index dd42e5a..a4ab132 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -21,7 +21,7 @@
#include "src/gpu/GrMemoryPool.h"
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrProgramInfo.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
#include "src/gpu/glsl/GrGLSLVarying.h"
@@ -174,7 +174,7 @@
GrGpu* gpu = context->priv().getGpu();
#endif
- auto renderTargetContext = GrRenderTargetContext::Make(
+ auto renderTargetContext = GrSurfaceDrawContext::Make(
context, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox, {1, 1});
if (!renderTargetContext) {
ERRORF(reporter, "Could not create render target context.");
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index 92b632a..89557e5 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -15,13 +15,14 @@
#include "src/gpu/GrImageInfo.h"
#include "src/gpu/GrMemoryPool.h"
#include "src/gpu/GrProxyProvider.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrResourceProvider.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ops/GrFillRectOp.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "tests/TestUtils.h"
+
#include <atomic>
#include <random>
@@ -156,7 +157,7 @@
for (bool makeClone : {false, true}) {
for (int parentCnt = 0; parentCnt < 2; parentCnt++) {
- auto renderTargetContext = GrRenderTargetContext::Make(
+ auto renderTargetContext = GrSurfaceDrawContext::Make(
context, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox, {1, 1});
{
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
@@ -227,7 +228,7 @@
}
void test_draw_op(GrRecordingContext* rContext,
- GrRenderTargetContext* rtc,
+ GrSurfaceDrawContext* rtc,
std::unique_ptr<GrFragmentProcessor> fp) {
GrPaint paint;
paint.setColorFragmentProcessor(std::move(fp));
@@ -240,7 +241,7 @@
// The output buffer must be the same size as the render-target context.
void render_fp(GrDirectContext* dContext,
- GrRenderTargetContext* rtc,
+ GrSurfaceDrawContext* rtc,
std::unique_ptr<GrFragmentProcessor> fp,
GrColor* outBuffer) {
test_draw_op(dContext, rtc, std::move(fp));
@@ -392,9 +393,9 @@
// We tag logged data as unpremul to avoid conversion when encoding as PNG. The input texture
// actually contains unpremul data. Also, even though we made the result data by rendering into
-// a "unpremul" GrRenderTargetContext, our input texture is unpremul and outside of the random
+// a "unpremul" GrSurfaceDrawContext, our input texture is unpremul and outside of the random
// effect configuration, we didn't do anything to ensure the output is actually premul. We just
-// don't currently allow kUnpremul GrRenderTargetContexts.
+// don't currently allow kUnpremul GrSurfaceDrawContexts.
static constexpr auto kLogAlphaType = kUnpremul_SkAlphaType;
bool log_pixels(GrColor* pixels, int widthHeight, SkString* dst) {
@@ -544,7 +545,7 @@
// Make the destination context for the test.
static constexpr int kRenderSize = 256;
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
context, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact,
{kRenderSize, kRenderSize});
@@ -909,7 +910,7 @@
// Make the destination context for the test.
static constexpr int kRenderSize = 1024;
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
context, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact,
{kRenderSize, kRenderSize});
diff --git a/tests/ProgramsTest.cpp b/tests/ProgramsTest.cpp
index 633be6c..0008f7c 100644
--- a/tests/ProgramsTest.cpp
+++ b/tests/ProgramsTest.cpp
@@ -137,7 +137,7 @@
static const int kRenderTargetHeight = 1;
static const int kRenderTargetWidth = 1;
-static std::unique_ptr<GrRenderTargetContext> random_render_target_context(
+static std::unique_ptr<GrSurfaceDrawContext> random_render_target_context(
GrRecordingContext* rContext,
SkRandom* random,
const GrCaps* caps) {
@@ -151,7 +151,7 @@
// Above could be 0 if msaa isn't supported.
sampleCnt = std::max(1, sampleCnt);
- return GrRenderTargetContext::Make(
+ return GrSurfaceDrawContext::Make(
rContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact,
{kRenderTargetWidth, kRenderTargetHeight}, sampleCnt, GrMipmapped::kNo,
GrProtected::kNo, origin);
@@ -298,7 +298,7 @@
direct->submit(false);
// Validate that GrFPs work correctly without an input.
- auto renderTargetContext = GrRenderTargetContext::Make(
+ auto renderTargetContext = GrSurfaceDrawContext::Make(
direct, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact,
{kRenderTargetWidth, kRenderTargetHeight});
if (!renderTargetContext) {
diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp
index a340ba1..9d106de 100644
--- a/tests/RectangleTextureTest.cpp
+++ b/tests/RectangleTextureTest.cpp
@@ -11,7 +11,7 @@
#include "include/gpu/GrDirectContext.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/SkGr.h"
#ifdef SK_GL
@@ -24,7 +24,7 @@
static void test_basic_draw_as_src(skiatest::Reporter* reporter, GrDirectContext* dContext,
GrSurfaceProxyView rectView, GrColorType colorType,
SkAlphaType alphaType, uint32_t expectedPixelValues[]) {
- auto rtContext = GrRenderTargetContext::Make(
+ auto rtContext = GrSurfaceDrawContext::Make(
dContext, colorType, nullptr, SkBackingFit::kExact, rectView.proxy()->dimensions());
for (auto filter : {GrSamplerState::Filter::kNearest, GrSamplerState::Filter::kLinear}) {
for (auto mm : {GrSamplerState::MipmapMode::kNone, GrSamplerState::MipmapMode::kLinear}) {
@@ -42,7 +42,7 @@
static void test_clear(skiatest::Reporter* reporter, GrDirectContext* dContext,
GrSurfaceContext* rectContext) {
- if (GrRenderTargetContext* rtc = rectContext->asRenderTargetContext()) {
+ if (GrSurfaceDrawContext* rtc = rectContext->asRenderTargetContext()) {
// Clear the whole thing.
GrColor color0 = GrColorPackRGBA(0xA, 0xB, 0xC, 0xD);
rtc->clear(SkPMColor4f::FromBytes_RGBA(color0));
diff --git a/tests/RenderTargetContextTest.cpp b/tests/RenderTargetContextTest.cpp
index 76ee6aa..453c69b 100644
--- a/tests/RenderTargetContextTest.cpp
+++ b/tests/RenderTargetContextTest.cpp
@@ -12,18 +12,18 @@
#include "include/gpu/GrDirectContext.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrImageInfo.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTextureProxy.h"
static const int kSize = 64;
-static std::unique_ptr<GrRenderTargetContext> get_rtc(GrRecordingContext* rContext) {
- return GrRenderTargetContext::Make(
+static std::unique_ptr<GrSurfaceDrawContext> get_rtc(GrRecordingContext* rContext) {
+ return GrSurfaceDrawContext::Make(
rContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact, {kSize, kSize});
}
static void check_instantiation_status(skiatest::Reporter* reporter,
- GrRenderTargetContext* rtCtx,
+ GrSurfaceDrawContext* rtCtx,
bool wrappedExpectation) {
REPORTER_ASSERT(reporter, rtCtx->asRenderTargetProxy()->isInstantiated() == wrappedExpectation);
@@ -36,8 +36,8 @@
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RenderTargetContextTest, reporter, ctxInfo) {
auto dContext = ctxInfo.directContext();
- // Calling instantiate on a GrRenderTargetContext's textureProxy also instantiates the
- // GrRenderTargetContext
+ // Calling instantiate on a GrSurfaceDrawContext's textureProxy also instantiates the
+ // GrSurfaceDrawContext
{
auto rtCtx = get_rtc(dContext);
@@ -68,6 +68,6 @@
}
// TODO: in a future world we should be able to add a test that the majority of
- // GrRenderTargetContext calls do not force the instantiation of a deferred
- // GrRenderTargetContext
+ // GrSurfaceDrawContext calls do not force the instantiation of a deferred
+ // GrSurfaceDrawContext
}
diff --git a/tests/SRGBReadWritePixelsTest.cpp b/tests/SRGBReadWritePixelsTest.cpp
index afc11a0..8bc0e1e 100644
--- a/tests/SRGBReadWritePixelsTest.cpp
+++ b/tests/SRGBReadWritePixelsTest.cpp
@@ -11,8 +11,8 @@
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrImageInfo.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrSurfaceContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/SkGr.h"
#include "tests/Test.h"
@@ -192,7 +192,7 @@
static std::unique_ptr<GrSurfaceContext> make_surface_context(Encoding contextEncoding,
GrRecordingContext* rContext,
skiatest::Reporter* reporter) {
- auto surfaceContext = GrRenderTargetContext::Make(
+ auto surfaceContext = GrSurfaceDrawContext::Make(
rContext, GrColorType::kRGBA_8888, encoding_as_color_space(contextEncoding),
SkBackingFit::kExact, {kW, kH}, 1, GrMipmapped::kNo, GrProtected::kNo,
kBottomLeft_GrSurfaceOrigin, SkBudgeted::kNo);
diff --git a/tests/SkSLCross.cpp b/tests/SkSLCross.cpp
index 3669486..88a10c6 100644
--- a/tests/SkSLCross.cpp
+++ b/tests/SkSLCross.cpp
@@ -7,18 +7,19 @@
#include "tests/Test.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
-static void run_test(skiatest::Reporter*, GrDirectContext*, GrRenderTargetContext*, SkVector a,
+static void run_test(skiatest::Reporter*, GrDirectContext*,
+ GrSurfaceDrawContext*, SkVector a,
SkVector b, float expectedCrossProduct);
// This is a GPU test that ensures the SkSL 2d cross() intrinsic returns the correct sign (negative,
// positive, or zero).
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkSLCross, reporter, ctxInfo) {
GrDirectContext* directContext = ctxInfo.directContext();
- auto rtc = GrRenderTargetContext::Make(directContext, GrColorType::kRGBA_8888, nullptr,
- SkBackingFit::kExact, {1, 1});
+ auto rtc = GrSurfaceDrawContext::Make(directContext, GrColorType::kRGBA_8888, nullptr,
+ SkBackingFit::kExact, {1, 1});
if (!rtc) {
ERRORF(reporter, "could not create render target context.");
return;
@@ -81,7 +82,7 @@
} // namespace
static void run_test(skiatest::Reporter* reporter, GrDirectContext* directContext,
- GrRenderTargetContext* rtc, SkVector a, SkVector b,
+ GrSurfaceDrawContext* rtc, SkVector a, SkVector b,
float expectedCrossProduct) {
SkASSERT(rtc->width() == 1);
SkASSERT(rtc->height() == 1);
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 10898d6..369a526 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -22,8 +22,8 @@
#include "src/gpu/GrGpuResourcePriv.h"
#include "src/gpu/GrImageInfo.h"
#include "src/gpu/GrRenderTarget.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrResourceProvider.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/SkGpuDevice.h"
#include "src/image/SkImage_Base.h"
#include "src/image/SkImage_Gpu.h"
@@ -691,7 +691,7 @@
static bool supports_readpixels(const GrCaps* caps, SkSurface* surface) {
auto surfaceGpu = static_cast<SkSurface_Gpu*>(surface);
- GrRenderTargetContext* context = surfaceGpu->getDevice()->accessRenderTargetContext();
+ GrSurfaceDrawContext* context = surfaceGpu->getDevice()->accessRenderTargetContext();
GrRenderTarget* rt = context->accessRenderTarget();
if (!rt) {
return false;
diff --git a/tests/TriangulatingPathRendererTests.cpp b/tests/TriangulatingPathRendererTests.cpp
index fb89215..96f20b5 100644
--- a/tests/TriangulatingPathRendererTests.cpp
+++ b/tests/TriangulatingPathRendererTests.cpp
@@ -11,8 +11,8 @@
#include "include/effects/SkGradientShader.h"
#include "include/gpu/GrDirectContext.h"
#include "src/gpu/GrDirectContextPriv.h"
-#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrStyle.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/effects/GrPorterDuffXferProcessor.h"
#include "src/gpu/geometry/GrStyledShape.h"
#include "src/gpu/ops/GrTriangulatingPathRenderer.h"
@@ -701,7 +701,7 @@
}
static void test_path(GrRecordingContext* rContext,
- GrRenderTargetContext* renderTargetContext,
+ GrSurfaceDrawContext* renderTargetContext,
const SkPath& path,
const SkMatrix& matrix = SkMatrix::I(),
GrAAType aaType = GrAAType::kNone,
@@ -734,7 +734,7 @@
DEF_GPUTEST_FOR_ALL_CONTEXTS(TriangulatingPathRendererTests, reporter, ctxInfo) {
auto ctx = ctxInfo.directContext();
- auto rtc = GrRenderTargetContext::Make(
+ auto rtc = GrSurfaceDrawContext::Make(
ctx, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox, {800, 800}, 1,
GrMipmapped::kNo, GrProtected::kNo, kTopLeft_GrSurfaceOrigin);
if (!rtc) {
diff --git a/tests/VkBackendSurfaceTest.cpp b/tests/VkBackendSurfaceTest.cpp
index b9f2847..1ad17ae 100644
--- a/tests/VkBackendSurfaceTest.cpp
+++ b/tests/VkBackendSurfaceTest.cpp
@@ -16,7 +16,7 @@
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/vk/GrVkTypes.h"
#include "include/gpu/vk/GrVkVulkan.h"
-#include "src/gpu/GrRenderTargetContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGpuDevice.h"