Cruft leftover from GrSurfaceContext hierarchy v1/v2 split
Non-substantive changes that didn't fit any earlier CL in the chain.
Bug: skia:11837
Change-Id: Ic9b7c05c014b03ab5b30532098fb8cd2da846d9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428958
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp
index 5664a2c..59b0418 100644
--- a/tests/FloatingPointTextureTest.cpp
+++ b/tests/FloatingPointTextureTest.cpp
@@ -60,11 +60,11 @@
continue;
}
- auto sContext = dContext->priv().makeSC(std::move(fpView), info.colorInfo());
- REPORTER_ASSERT(reporter, sContext);
+ auto sc = dContext->priv().makeSC(std::move(fpView), info.colorInfo());
+ REPORTER_ASSERT(reporter, sc);
GrPixmap readPixmap(info, readBuffer.begin(), info.minRowBytes());
- bool result = sContext->readPixels(dContext, readPixmap, {0, 0});
+ bool result = sc->readPixels(dContext, readPixmap, {0, 0});
REPORTER_ASSERT(reporter, result);
REPORTER_ASSERT(reporter,
!memcmp(readBuffer.begin(), controlPixelData.begin(), readBuffer.bytes()));
diff --git a/tests/ReadWritePixelsGpuTest.cpp b/tests/ReadWritePixelsGpuTest.cpp
index 20d417e..9264c9c 100644
--- a/tests/ReadWritePixelsGpuTest.cpp
+++ b/tests/ReadWritePixelsGpuTest.cpp
@@ -502,12 +502,12 @@
for (GrSurfaceOrigin origin : {kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin}) {
auto factory = std::function<GpuSrcFactory<Surface>>(
[direct, origin, renderable](const SkPixmap& src) {
- auto surfContext = skgpu::SurfaceContext::Make(
+ auto sc = skgpu::SurfaceContext::Make(
direct, src.info(), SkBackingFit::kExact, origin, renderable);
- if (surfContext) {
- surfContext->writePixels(direct, src, {0, 0});
+ if (sc) {
+ sc->writePixels(direct, src, {0, 0});
}
- return surfContext;
+ return sc;
});
auto label = SkStringPrintf("Renderable: %d, Origin: %d", (int)renderable, origin);
gpu_read_pixels_test_driver(reporter, rules, factory, reader, label);
diff --git a/tests/SRGBReadWritePixelsTest.cpp b/tests/SRGBReadWritePixelsTest.cpp
index c07dd9e..bd106e2 100644
--- a/tests/SRGBReadWritePixelsTest.cpp
+++ b/tests/SRGBReadWritePixelsTest.cpp
@@ -121,7 +121,7 @@
void read_and_check_pixels(skiatest::Reporter* reporter,
GrDirectContext* dContext,
- skgpu::SurfaceContext* sContext,
+ skgpu::SurfaceContext* sc,
uint32_t* origData,
const SkImageInfo& dstInfo, CheckFn checker, float error,
const char* subtestName) {
@@ -129,7 +129,7 @@
GrPixmap readPM = GrPixmap::Allocate(dstInfo);
memset(readPM.addr(), 0, sizeof(uint32_t)*w*h);
- if (!sContext->readPixels(dContext, readPM, {0, 0})) {
+ if (!sc->readPixels(dContext, readPM, {0, 0})) {
ERRORF(reporter, "Could not read pixels for %s.", subtestName);
return;
}
@@ -195,7 +195,8 @@
encoding_as_color_space(contextEncoding),
kW, kH);
- auto sc = skgpu::SurfaceContext::Make(rContext, info,
+ auto sc = skgpu::SurfaceContext::Make(rContext,
+ info,
SkBackingFit::kExact,
kBottomLeft_GrSurfaceOrigin,
GrRenderable::kYes);
diff --git a/tests/TestUtils.h b/tests/TestUtils.h
index 104885c..91b058e 100644
--- a/tests/TestUtils.h
+++ b/tests/TestUtils.h
@@ -17,12 +17,12 @@
typedef uint32_t GrColor;
// Ensure that reading back from 'srcContext' as RGBA 8888 matches 'expectedPixelValues
-void TestReadPixels(skiatest::Reporter*, GrDirectContext*, skgpu::SurfaceContext* srcContext,
+void TestReadPixels(skiatest::Reporter*, GrDirectContext*, skgpu::SurfaceContext*,
uint32_t expectedPixelValues[], const char* testName);
// See if trying to write RGBA 8888 pixels to 'dstContext' matches matches the
// expectation ('expectedToWork')
-void TestWritePixels(skiatest::Reporter*, GrDirectContext*, skgpu::SurfaceContext* srcContext,
+void TestWritePixels(skiatest::Reporter*, GrDirectContext*, skgpu::SurfaceContext*,
bool expectedToWork, const char* testName);
// Ensure that the pixels can be copied from 'proxy' viewed as colorType, to an RGBA 8888
diff --git a/tests/WrappedSurfaceCopyOnWriteTest.cpp b/tests/WrappedSurfaceCopyOnWriteTest.cpp
index 91ec489..7478872 100644
--- a/tests/WrappedSurfaceCopyOnWriteTest.cpp
+++ b/tests/WrappedSurfaceCopyOnWriteTest.cpp
@@ -20,10 +20,6 @@
#include "tools/gpu/BackendSurfaceFactory.h"
#include "tools/gpu/ProxyUtils.h"
-#if SK_GPU_V1
-#include "src/gpu/v1/SurfaceDrawContext_v1.h"
-#endif
-
DEF_GPUTEST_FOR_ALL_CONTEXTS(WrappedSurfaceCopyOnWrite, reporter, ctxInfo) {
GrDirectContext* dContext = ctxInfo.directContext();
@@ -91,13 +87,15 @@
/*color space*/ nullptr,
10, 10);
- auto dstSC = skgpu::SurfaceContext::Make(dContext, info,
+ auto dstSC = skgpu::SurfaceContext::Make(dContext,
+ info,
SkBackingFit::kExact,
kBottomLeft_GrSurfaceOrigin,
GrRenderable::kYes);
dstSC->asFillContext()->clear(SkPMColor4f{1, 0, 0, 1});
- auto srcSC = skgpu::SurfaceContext::Make(dContext, info,
+ auto srcSC = skgpu::SurfaceContext::Make(dContext,
+ info,
SkBackingFit::kExact,
kBottomLeft_GrSurfaceOrigin,
GrRenderable::kYes);
@@ -130,32 +128,23 @@
}
#if SK_GPU_V1
-#include "src/gpu/v1/SurfaceDrawContext_v1.h"
// Make sure GrOpsTask are skippable
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkipOpsTaskTest, reporter, ctxInfo) {
GrDirectContext* dContext = ctxInfo.directContext();
- auto dst = skgpu::v1::SurfaceDrawContext::Make(dContext,
- GrColorType::kRGBA_8888,
- /*color space*/ nullptr,
- SkBackingFit::kExact,
- {10, 10},
- SkSurfaceProps());
+ GrImageInfo ii(GrColorType::kRGBA_8888, kPremul_SkAlphaType, /*color space*/ nullptr, 10, 10);
+
+ auto dst = dContext->priv().makeSFC(ii, SkBackingFit::kExact);
dst->clear(SkPMColor4f{1, 0, 0, 1});
dContext->flush();
dst->clear(SkPMColor4f{0, 0, 1, 1});
- sk_sp<GrRenderTask> task = sk_ref_sp(dst->getOpsTask());
+ sk_sp<GrRenderTask> task = dst->refRenderTask();
// GrDrawingManager maintains an "active ops task" and doesn't like having it closed behind
// its back. temp exists just to replace dst's ops task as the active one.
- auto temp = skgpu::v1::SurfaceDrawContext::Make(dContext,
- GrColorType::kRGBA_8888,
- /*color space*/ nullptr,
- SkBackingFit::kExact,
- {10, 10},
- SkSurfaceProps());
+ auto temp = dContext->priv().makeSFC(ii, SkBackingFit::kExact);
temp->clear(SkPMColor4f{0, 0, 0, 0});
GrSurfaceProxyView readView = dst->readSurfaceView();