aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-02-01 18:34:32 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-01 18:34:40 +0000
commitc1ce2f7966babaae0deb150f93f1227ee5af9285 (patch)
treeab4caf4bd03f6e642f618739e4283eb9ef62ebaf /tests
parent130fb3f7aac19e40eddfc8fa85a9b39e7c99a7e8 (diff)
Revert "Redefine the meaning of sample counts in GPU backend."
This reverts commit 48825b11ad25c98b9a4884d5cc0edd4e290c4409. Reason for revert: nanobench Original change's description: > Redefine the meaning of sample counts in GPU backend. > > Old: 0 -> nonMSAA > 1+ -> MSAA > > New: > 0 -> error/unsupported > 1 -> nonMSAA > 2+ -> MSAA > > We still allow 0 to mean nonMSAA in three sets of public APIs for backwards compatibility: > > 1) SkSurface factories > 2) GrBackendRenderTarget constructors > 3) GrCaps::getSampleCnt()'s requestedCount parameter > > However, we immediately clamp to 1 and treat 0 as invalid/non-renderable internally. > > This also changes the behavior when using a large sample count. We now fail in that case rather than using the largest sample available sample count. GrCaps::getSampleCount() will return 0 in this case. > > > Bug: skia: > Change-Id: Ida22c6b22c1365e563c9046b611e88bf5eb3ff33 > Reviewed-on: https://skia-review.googlesource.com/101560 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Ic257619a8a5ee9ac15419ecf10259e42daed7f82 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/102662 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/BlendTest.cpp4
-rw-r--r--tests/DeferredDisplayListTest.cpp7
-rw-r--r--tests/DeviceTest.cpp2
-rw-r--r--tests/EGLImageTest.cpp2
-rw-r--r--tests/GLProgramsTest.cpp4
-rw-r--r--tests/GpuDrawPathTest.cpp2
-rw-r--r--tests/GpuSampleLocationsTest.cpp30
-rw-r--r--tests/GrSurfaceTest.cpp10
-rw-r--r--tests/PathRendererCacheTests.cpp4
-rw-r--r--tests/ProxyTest.cpp10
-rw-r--r--tests/ResourceCacheTest.cpp33
-rw-r--r--tests/SkpSkGrTest.cpp2
-rw-r--r--tests/SurfaceTest.cpp8
-rw-r--r--tests/TessellatingPathRendererTests.cpp9
-rw-r--r--tests/TextureProxyTest.cpp2
-rwxr-xr-xtests/TransferPixelsTest.cpp2
-rw-r--r--tests/VkClearTests.cpp4
-rw-r--r--tests/VkUploadPixelsTests.cpp2
-rw-r--r--tests/VkWrapTests.cpp20
-rw-r--r--tests/WritePixelsTest.cpp6
20 files changed, 77 insertions, 86 deletions
diff --git a/tests/BlendTest.cpp b/tests/BlendTest.cpp
index 3ac7e3c41c..b17b9f1e45 100644
--- a/tests/BlendTest.cpp
+++ b/tests/BlendTest.cpp
@@ -140,7 +140,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ES2BlendWithNoTexture, reporter, ctxInfo)
std::vector<TestCase> testCases;
for (auto origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin}) {
- for (int sampleCnt : {1, 4}) {
+ for (int sampleCnt : {0, 4}) {
for (auto rectAndPoints : allRectsAndPoints) {
for (auto clip : {SkRect::MakeXYWH(0, 0, 10, 10), SkRect::MakeXYWH(1, 1, 8, 8)}) {
testCases.push_back({rectAndPoints, clip, sampleCnt, origin});
@@ -162,7 +162,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ES2BlendWithNoTexture, reporter, ctxInfo)
sk_sp<SkSurface> surface = create_gpu_surface_backend_texture_as_render_target(
context, sampleCnt, kWidth, kHeight, kColorType, kConfig, origin, &backingSurface);
- if (!surface && sampleCnt > 1) {
+ if (!surface && sampleCnt > 0) {
// Some platforms don't support MSAA.
continue;
}
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index 778714282a..8ee24be89a 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -31,8 +31,9 @@ public:
, fOrigin(kTopLeft_GrSurfaceOrigin)
, fColorType(kRGBA_8888_SkColorType)
, fColorSpace(SkColorSpace::MakeSRGB())
- , fSampleCount(1)
- , fSurfaceProps(0x0, kUnknown_SkPixelGeometry) {}
+ , fSampleCount(0)
+ , fSurfaceProps(0x0, kUnknown_SkPixelGeometry) {
+ }
int sampleCount() const { return fSampleCount; }
@@ -133,7 +134,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(SkSurfaceCharacterization, reporter, ctxInfo) {
int supportedSampleCount = context->caps()->getSampleCount(
params.sampleCount(),
gpuSurf->getDevice()->accessRenderTargetContext()->asRenderTargetProxy()->config());
- if (1 == supportedSampleCount) {
+ if (0 == supportedSampleCount) {
// If changing the sample count won't result in a different
// surface characterization, skip this step
continue;
diff --git a/tests/DeviceTest.cpp b/tests/DeviceTest.cpp
index 58369cc149..64b83fcb3c 100644
--- a/tests/DeviceTest.cpp
+++ b/tests/DeviceTest.cpp
@@ -81,7 +81,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_GPUDevice, reporter, ctxInfo) {
SkImageInfo ii = SkImageInfo::MakeN32Premul(2*kWidth, 2*kHeight);
sk_sp<SkBaseDevice> gpuDev(SkGpuDevice::Make(context, SkBudgeted::kNo, ii,
- 1, kBottomLeft_GrSurfaceOrigin, nullptr,
+ 0, kBottomLeft_GrSurfaceOrigin, nullptr,
GrMipMapped::kNo,
SkGpuDevice::kClear_InitContents));
diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp
index b0631d0b3c..dac78a89c0 100644
--- a/tests/EGLImageTest.cpp
+++ b/tests/EGLImageTest.cpp
@@ -163,7 +163,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) {
{
sk_sp<GrRenderTargetContext> temp =
context0->contextPriv().makeBackendTextureRenderTargetContext(
- backendTex, kBottomLeft_GrSurfaceOrigin, 1, nullptr);
+ backendTex, kBottomLeft_GrSurfaceOrigin, 0, nullptr);
if (temp) {
ERRORF(reporter, "Should not be able to wrap an EXTERNAL texture as a RT.");
}
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index df35559b25..6c2e8d2f04 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -150,9 +150,7 @@ static sk_sp<GrRenderTargetContext> random_render_target_context(GrContext* cont
const GrCaps* caps) {
GrSurfaceOrigin origin = random->nextBool() ? kTopLeft_GrSurfaceOrigin
: kBottomLeft_GrSurfaceOrigin;
- int sampleCnt = random->nextBool() ? caps->getSampleCount(2, kRGBA_8888_GrPixelConfig) : 1;
- // Above could be 0 if msaa isn't supported.
- sampleCnt = SkTMax(1, sampleCnt);
+ int sampleCnt = random->nextBool() ? caps->getSampleCount(4, kRGBA_8888_GrPixelConfig) : 0;
sk_sp<GrRenderTargetContext> renderTargetContext(context->makeDeferredRenderTargetContext(
SkBackingFit::kExact,
diff --git a/tests/GpuDrawPathTest.cpp b/tests/GpuDrawPathTest.cpp
index 79afa63f2d..012dc61cb8 100644
--- a/tests/GpuDrawPathTest.cpp
+++ b/tests/GpuDrawPathTest.cpp
@@ -78,7 +78,7 @@ static void test_drawSameRectOvals(skiatest::Reporter*, SkCanvas* canvas) {
DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(GpuDrawPath, reporter, ctxInfo) {
for (auto& test_func : { &test_drawPathEmpty, &test_drawSameRectOvals }) {
- for (auto& sampleCount : {1, 4, 16}) {
+ for (auto& sampleCount : {0, 4, 16}) {
SkImageInfo info = SkImageInfo::MakeN32Premul(255, 255);
auto surface(
SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo, info,
diff --git a/tests/GpuSampleLocationsTest.cpp b/tests/GpuSampleLocationsTest.cpp
index 5530539e68..de15e03389 100644
--- a/tests/GpuSampleLocationsTest.cpp
+++ b/tests/GpuSampleLocationsTest.cpp
@@ -109,36 +109,22 @@ void assert_equal(skiatest::Reporter* reporter, const SamplePattern& pattern,
}
}
-static int pick_random_sample_count(int testPatternSize, SkRandom* rand, const GrCaps* caps) {
- GrAlwaysAssert(testPatternSize > 1 && SkIsPow2(testPatternSize));
- int randSampCnt = rand->nextRangeU(1 + testPatternSize / 2, testPatternSize);
- do {
- int cnt = caps->getSampleCount(randSampCnt, kRGBA_8888_GrPixelConfig);
- if (cnt) {
- return cnt;
- }
- --randSampCnt;
- } while (randSampCnt);
- // This test assumes an MSAA kRGBA_8888 RTC can be created.
- GrAlwaysAssert(false);
- return 0;
-}
-
void test_sampleLocations(skiatest::Reporter* reporter, TestSampleLocationsInterface* testInterface,
GrContext* ctx) {
SkRandom rand;
sk_sp<GrRenderTargetContext> bottomUps[numTestPatterns];
sk_sp<GrRenderTargetContext> topDowns[numTestPatterns];
for (int i = 0; i < numTestPatterns; ++i) {
- int patternSize = (int)kTestPatterns[i].size();
- int randNumSamples = pick_random_sample_count(patternSize, &rand, ctx->caps());
+ int numSamples = (int)kTestPatterns[i].size();
+ GrAlwaysAssert(numSamples > 1 && SkIsPow2(numSamples));
bottomUps[i] = ctx->makeDeferredRenderTargetContext(
- SkBackingFit::kExact, 100, 100, kRGBA_8888_GrPixelConfig, nullptr, randNumSamples,
- GrMipMapped::kNo, kBottomLeft_GrSurfaceOrigin);
- randNumSamples = pick_random_sample_count(patternSize, &rand, ctx->caps());
+ SkBackingFit::kExact, 100, 100, kRGBA_8888_GrPixelConfig, nullptr,
+ rand.nextRangeU(1 + numSamples / 2, numSamples), GrMipMapped::kNo,
+ kBottomLeft_GrSurfaceOrigin);
topDowns[i] = ctx->makeDeferredRenderTargetContext(
- SkBackingFit::kExact, 100, 100, kRGBA_8888_GrPixelConfig, nullptr, randNumSamples,
- GrMipMapped::kNo, kTopLeft_GrSurfaceOrigin);
+ SkBackingFit::kExact, 100, 100, kRGBA_8888_GrPixelConfig, nullptr,
+ rand.nextRangeU(1 + numSamples / 2, numSamples), GrMipMapped::kNo,
+ kTopLeft_GrSurfaceOrigin);
}
// Ensure all sample locations get queried and/or cached properly.
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index 29f4f25695..3e246ccd93 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -33,7 +33,7 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) {
desc.fWidth = 256;
desc.fHeight = 256;
desc.fConfig = kRGBA_8888_GrPixelConfig;
- desc.fSampleCnt = 1;
+ desc.fSampleCnt = 0;
sk_sp<GrSurface> texRT1 = resourceProvider->createTexture(desc, SkBudgeted::kNo);
REPORTER_ASSERT(reporter, texRT1.get() == texRT1->asRenderTarget());
@@ -55,8 +55,8 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) {
GrBackendTexture backendTex = gpu->createTestingOnlyBackendTexture(
nullptr, 256, 256, kRGBA_8888_GrPixelConfig, false, GrMipMapped::kNo);
- sk_sp<GrSurface> texRT2 =
- resourceProvider->wrapRenderableBackendTexture(backendTex, 1, kBorrow_GrWrapOwnership);
+ sk_sp<GrSurface> texRT2 = resourceProvider->wrapRenderableBackendTexture(
+ backendTex, 0, kBorrow_GrWrapOwnership);
REPORTER_ASSERT(reporter, texRT2.get() == texRT2->asRenderTarget());
REPORTER_ASSERT(reporter, texRT2.get() == texRT2->asTexture());
@@ -120,7 +120,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(GrSurfaceRenderability, reporter, ctxInfo) {
desc.fFlags = kNone_GrSurfaceFlags;
desc.fOrigin = origin;
desc.fConfig = config;
- desc.fSampleCnt = 1;
+ desc.fSampleCnt = 0;
sk_sp<GrSurface> tex = resourceProvider->createTexture(desc, SkBudgeted::kNo);
bool ict = caps->isConfigTexturable(desc.fConfig);
@@ -148,7 +148,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(GrSurfaceRenderability, reporter, ctxInfo) {
"config:%d, tex:%d, isConfigRenderable(false):%d", config,
SkToBool(tex), icr);
- desc.fSampleCnt = 2;
+ desc.fSampleCnt = 4;
tex = resourceProvider->createTexture(desc, SkBudgeted::kNo);
icr = caps->isConfigRenderable(config, true);
REPORTER_ASSERT(reporter, SkToBool(tex) == icr,
diff --git a/tests/PathRendererCacheTests.cpp b/tests/PathRendererCacheTests.cpp
index 19197b0d5f..15b1faa4ba 100644
--- a/tests/PathRendererCacheTests.cpp
+++ b/tests/PathRendererCacheTests.cpp
@@ -80,8 +80,8 @@ static void test_path(skiatest::Reporter* reporter,
GrResourceCache* cache = ctx->contextPriv().getResourceCache();
sk_sp<GrRenderTargetContext> rtc(ctx->makeDeferredRenderTargetContext(
- SkBackingFit::kApprox, 800, 800, kRGBA_8888_GrPixelConfig, nullptr, 1, GrMipMapped::kNo,
- kTopLeft_GrSurfaceOrigin));
+ SkBackingFit::kApprox, 800, 800, kRGBA_8888_GrPixelConfig, nullptr, 0,
+ GrMipMapped::kNo, kTopLeft_GrSurfaceOrigin));
if (!rtc) {
return;
}
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 3bde3de7ca..0636ed4ce4 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -118,7 +118,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredProxyTest, reporter, ctxInfo) {
kRGBA_8888_GrPixelConfig }) {
for (auto fit : { SkBackingFit::kExact, SkBackingFit::kApprox }) {
for (auto budgeted : { SkBudgeted::kYes, SkBudgeted::kNo }) {
- for (auto numSamples : {1, 4, 16, 128}) {
+ for (auto numSamples : { 0, 4, 16, 128 }) {
GrSurfaceDesc desc;
desc.fFlags = kRenderTarget_GrSurfaceFlag;
desc.fOrigin = origin;
@@ -204,10 +204,10 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }) {
for (auto config : { kAlpha_8_GrPixelConfig, kRGBA_8888_GrPixelConfig }) {
for (auto budgeted : { SkBudgeted::kYes, SkBudgeted::kNo }) {
- for (auto numSamples : {1, 4}) {
+ for (auto numSamples: { 0, 4}) {
int supportedNumSamples = caps.getSampleCount(numSamples, config);
- bool renderable = caps.isConfigRenderable(config, numSamples > 1);
+ bool renderable = caps.isConfigRenderable(config, numSamples > 0);
GrSurfaceDesc desc;
desc.fOrigin = origin;
@@ -251,7 +251,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
} else {
// Internal offscreen texture
SkASSERT(kNone_GrSurfaceFlags == desc.fFlags );
- desc.fSampleCnt = 1;
+ desc.fSampleCnt = 0;
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->createInstantiatedProxy(
desc, SkBackingFit::kExact, budgeted);
@@ -287,7 +287,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ZeroSizedProxyTest, reporter, ctxInfo) {
desc.fWidth = width;
desc.fHeight = height;
desc.fConfig = kRGBA_8888_GrPixelConfig;
- desc.fSampleCnt = 1;
+ desc.fSampleCnt = 0;
sk_sp<GrTextureProxy> proxy = provider->createProxy(desc, fit, SkBudgeted::kNo);
REPORTER_ASSERT(reporter, !proxy);
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index da2e278367..34ed4f7328 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -129,20 +129,21 @@ DEF_GPUTEST_FOR_CONTEXTS(ResourceCacheStencilBuffers, &is_rendering_and_not_angl
GrResourceProvider* resourceProvider = context->contextPriv().resourceProvider();
- sk_sp<GrRenderTarget> smallRT0 = create_RT_with_SB(resourceProvider, 4, 1, SkBudgeted::kYes);
+ sk_sp<GrRenderTarget> smallRT0 = create_RT_with_SB(resourceProvider, 4, 0, SkBudgeted::kYes);
REPORTER_ASSERT(reporter, smallRT0);
{
// Two budgeted RTs with the same desc should share a stencil buffer.
- sk_sp<GrRenderTarget> smallRT1 = create_RT_with_SB(resourceProvider, 4, 1, SkBudgeted::kYes);
- REPORTER_ASSERT(reporter, smallRT1);
+ sk_sp<GrRenderTarget> smallRT1 = create_RT_with_SB(resourceProvider, 4, 0,
+ SkBudgeted::kYes);
+ REPORTER_ASSERT(reporter, smallRT1);
- REPORTER_ASSERT(reporter, get_SB(smallRT0.get()) == get_SB(smallRT1.get()));
+ REPORTER_ASSERT(reporter, get_SB(smallRT0.get()) == get_SB(smallRT1.get()));
}
{
// An unbudgeted RT with the same desc should also share.
- sk_sp<GrRenderTarget> smallRT2 = create_RT_with_SB(resourceProvider, 4, 1, SkBudgeted::kNo);
+ sk_sp<GrRenderTarget> smallRT2 = create_RT_with_SB(resourceProvider, 4, 0, SkBudgeted::kNo);
REPORTER_ASSERT(reporter, smallRT2);
REPORTER_ASSERT(reporter, get_SB(smallRT0.get()) == get_SB(smallRT2.get()));
@@ -150,14 +151,14 @@ DEF_GPUTEST_FOR_CONTEXTS(ResourceCacheStencilBuffers, &is_rendering_and_not_angl
{
// An RT with a much larger size should not share.
- sk_sp<GrRenderTarget> bigRT = create_RT_with_SB(resourceProvider, 400, 1, SkBudgeted::kNo);
+ sk_sp<GrRenderTarget> bigRT = create_RT_with_SB(resourceProvider, 400, 0, SkBudgeted::kNo);
REPORTER_ASSERT(reporter, bigRT);
REPORTER_ASSERT(reporter, get_SB(smallRT0.get()) != get_SB(bigRT.get()));
}
- int smallSampleCount = context->caps()->getSampleCount(2, kRGBA_8888_GrPixelConfig);
- if (smallSampleCount > 1) {
+ int smallSampleCount = context->caps()->getSampleCount(4, kRGBA_8888_GrPixelConfig);
+ if (smallSampleCount > 0) {
// An RT with a different sample count should not share.
sk_sp<GrRenderTarget> smallMSAART0 = create_RT_with_SB(resourceProvider, 4,
smallSampleCount, SkBudgeted::kNo);
@@ -182,10 +183,10 @@ DEF_GPUTEST_FOR_CONTEXTS(ResourceCacheStencilBuffers, &is_rendering_and_not_angl
REPORTER_ASSERT(reporter, get_SB(smallMSAART0.get()) == get_SB(smallMSAART1.get()));
}
- // But one with a larger sample count should not. (Also check that the two requests didn't
- // rounded up to the same actual sample count or else they could share.).
- int bigSampleCount = context->caps()->getSampleCount(5, kRGBA_8888_GrPixelConfig);
- if (bigSampleCount > 0 && bigSampleCount != smallSampleCount) {
+ // But not one with a larger sample count should not. (Also check that the request for 4
+ // samples didn't get rounded up to >= 8 or else they could share.).
+ int bigSampleCount = context->caps()->getSampleCount(8, kRGBA_8888_GrPixelConfig);
+ if (bigSampleCount != smallSampleCount) {
sk_sp<GrRenderTarget> smallMSAART2 = create_RT_with_SB(resourceProvider, 4,
bigSampleCount,
SkBudgeted::kNo);
@@ -1706,7 +1707,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GPUMemorySize, reporter, ctxInfo) {
{
sk_sp<GrTexture> tex;
- tex = make_normal_texture(resourceProvider, kRenderTarget_GrSurfaceFlag, kSize, kSize, 1);
+ tex = make_normal_texture(resourceProvider, kRenderTarget_GrSurfaceFlag, kSize, kSize, 0);
size_t size = tex->gpuMemorySize();
REPORTER_ASSERT(reporter, kSize*kSize*4 == size);
@@ -1721,7 +1722,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GPUMemorySize, reporter, ctxInfo) {
kSize*kSize*4*(sampleCount+1) == size); // explicit resolve buffer
}
- tex = make_normal_texture(resourceProvider, kNone_GrSurfaceFlags, kSize, kSize, 1);
+ tex = make_normal_texture(resourceProvider, kNone_GrSurfaceFlags, kSize, kSize, 0);
size = tex->gpuMemorySize();
REPORTER_ASSERT(reporter, kSize*kSize*4 == size);
}
@@ -1731,7 +1732,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GPUMemorySize, reporter, ctxInfo) {
if (context->caps()->mipMapSupport()) {
sk_sp<GrTextureProxy> proxy;
- proxy = make_mipmap_proxy(proxyProvider, kRenderTarget_GrSurfaceFlag, kSize, kSize, 1);
+ proxy = make_mipmap_proxy(proxyProvider, kRenderTarget_GrSurfaceFlag, kSize, kSize, 0);
size_t size = proxy->gpuMemorySize();
REPORTER_ASSERT(reporter, kSize*kSize*4+(kSize*kSize*4)/3 == size);
@@ -1746,7 +1747,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GPUMemorySize, reporter, ctxInfo) {
kSize*kSize*4*(sampleCount+1)+(kSize*kSize*4)/3 == size); // explicit resolve buffer
}
- proxy = make_mipmap_proxy(proxyProvider, kNone_GrSurfaceFlags, kSize, kSize, 1);
+ proxy = make_mipmap_proxy(proxyProvider, kNone_GrSurfaceFlags, kSize, kSize, 0);
size = proxy->gpuMemorySize();
REPORTER_ASSERT(reporter, kSize*kSize*4+(kSize*kSize*4)/3 == size);
}
diff --git a/tests/SkpSkGrTest.cpp b/tests/SkpSkGrTest.cpp
index 898faf08a7..24d1b9cc3a 100644
--- a/tests/SkpSkGrTest.cpp
+++ b/tests/SkpSkGrTest.cpp
@@ -442,7 +442,7 @@ void TestResult::testOne() {
desc.fFlags = kRenderTarget_GrTextureFlagBit;
desc.fWidth = dim.fX;
desc.fHeight = dim.fY;
- desc.fSampleCnt = 1;
+ desc.fSampleCnt = 0;
sk_sp<GrTexture> texture(context->createUncachedTexture(desc, nullptr, 0));
if (!texture) {
SkDebugf("unable to allocate texture for %s (w=%d h=%d)\n", fFilename,
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index af73473fad..471953b373 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -704,7 +704,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceClear_Gpu, reporter, ctxInfo) {
for (auto& surfaceFunc : {&create_gpu_surface_backend_texture,
&create_gpu_surface_backend_texture_as_render_target}) {
GrBackendTexture backendTex;
- auto surface = surfaceFunc(context, 1, kOrigColor, &backendTex);
+ auto surface = surfaceFunc(context, 0, kOrigColor, &backendTex);
test_surface_clear(reporter, surface, grSurfaceGetter, kOrigColor);
surface.reset();
gpu->deleteTestingOnlyBackendTexture(&backendTex);
@@ -767,7 +767,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacePartialDraw_Gpu, reporter, ctxInfo) {
// preserved in pixels that aren't rendered to via the surface.
// This works only for non-multisampled case.
GrBackendTexture backendTex;
- auto surface = surfaceFunc(ctxInfo.grContext(), 1, kOrigColor, &backendTex);
+ auto surface = surfaceFunc(ctxInfo.grContext(), 0, kOrigColor, &backendTex);
if (surface) {
test_surface_draw_partially(reporter, surface, kOrigColor);
surface.reset();
@@ -791,11 +791,11 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceAttachStencil_Gpu, reporter, ctxInf
for (auto& surfaceFunc : {&create_gpu_surface_backend_texture,
&create_gpu_surface_backend_texture_as_render_target}) {
- for (int sampleCnt : {1, 4, 8}) {
+ for (int sampleCnt : {0, 4, 8}) {
GrBackendTexture backendTex;
auto surface = surfaceFunc(ctxInfo.grContext(), sampleCnt, kOrigColor, &backendTex);
- if (!surface && sampleCnt > 1) {
+ if (!surface && sampleCnt > 0) {
// Certain platforms don't support MSAA, skip these.
continue;
}
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index e24bf7a516..1eb055f53a 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -486,8 +486,13 @@ static void test_path(GrContext* ctx,
DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
GrContext* ctx = ctxInfo.grContext();
sk_sp<GrRenderTargetContext> rtc(ctx->makeDeferredRenderTargetContext(
- SkBackingFit::kApprox, 800, 800, kRGBA_8888_GrPixelConfig, nullptr, 1, GrMipMapped::kNo,
- kTopLeft_GrSurfaceOrigin));
+ SkBackingFit::kApprox,
+ 800, 800,
+ kRGBA_8888_GrPixelConfig,
+ nullptr,
+ 0,
+ GrMipMapped::kNo,
+ kTopLeft_GrSurfaceOrigin));
if (!rtc) {
return;
}
diff --git a/tests/TextureProxyTest.cpp b/tests/TextureProxyTest.cpp
index 059113033a..d422b076ad 100644
--- a/tests/TextureProxyTest.cpp
+++ b/tests/TextureProxyTest.cpp
@@ -34,7 +34,7 @@ static GrSurfaceDesc make_desc(GrSurfaceFlags flags) {
desc.fWidth = 64;
desc.fHeight = 64;
desc.fConfig = kRGBA_8888_GrPixelConfig;
- desc.fSampleCnt = 1;
+ desc.fSampleCnt = 0;
return desc;
}
diff --git a/tests/TransferPixelsTest.cpp b/tests/TransferPixelsTest.cpp
index 8f71528da6..ce8d1edc4f 100755
--- a/tests/TransferPixelsTest.cpp
+++ b/tests/TransferPixelsTest.cpp
@@ -104,7 +104,7 @@ void basic_transfer_test(skiatest::Reporter* reporter, GrContext* context, GrPix
desc.fWidth = kTextureWidth;
desc.fHeight = kTextureHeight;
desc.fConfig = config;
- desc.fSampleCnt = 1;
+ desc.fSampleCnt = 0;
sk_sp<GrTexture> tex = resourceProvider->createTexture(desc, SkBudgeted::kNo);
//////////////////////////
diff --git a/tests/VkClearTests.cpp b/tests/VkClearTests.cpp
index 0dcb446ee5..c797ef2c33 100644
--- a/tests/VkClearTests.cpp
+++ b/tests/VkClearTests.cpp
@@ -58,7 +58,7 @@ void basic_clear_test(skiatest::Reporter* reporter, GrContext* context, GrPixelC
surfDesc.fWidth = 5;
surfDesc.fHeight = 5;
surfDesc.fConfig = config;
- surfDesc.fSampleCnt = 1;
+ surfDesc.fSampleCnt = 0;
GrTexture* tex = gpu->createTexture(surfDesc, SkBudgeted::kNo);
SkASSERT(tex);
SkASSERT(tex->asRenderTarget());
@@ -114,7 +114,7 @@ void sub_clear_test(skiatest::Reporter* reporter, GrContext* context, GrPixelCon
surfDesc.fWidth = width;
surfDesc.fHeight = height;
surfDesc.fConfig = config;
- surfDesc.fSampleCnt = 1;
+ surfDesc.fSampleCnt = 0;
GrTexture* tex = gpu->createTexture(surfDesc, SkBudgeted::kNo);
SkASSERT(tex);
SkASSERT(tex->asRenderTarget());
diff --git a/tests/VkUploadPixelsTests.cpp b/tests/VkUploadPixelsTests.cpp
index f35480a6ce..3b3fecae7f 100644
--- a/tests/VkUploadPixelsTests.cpp
+++ b/tests/VkUploadPixelsTests.cpp
@@ -69,7 +69,7 @@ void basic_texture_test(skiatest::Reporter* reporter, GrContext* context, GrPixe
surfDesc.fWidth = kWidth;
surfDesc.fHeight = kHeight;
surfDesc.fConfig = config;
- surfDesc.fSampleCnt = 1;
+ surfDesc.fSampleCnt = 0;
SkColorType ct;
SkAssertResult(GrPixelConfigToColorType(config, &ct));
diff --git a/tests/VkWrapTests.cpp b/tests/VkWrapTests.cpp
index 9723d5763b..6cfbba65b6 100644
--- a/tests/VkWrapTests.cpp
+++ b/tests/VkWrapTests.cpp
@@ -83,7 +83,7 @@ void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) {
GrMipMapped::kNo);
const GrVkImageInfo* imageInfo = origBackendTex.getVkImageInfo();
- GrBackendRenderTarget origBackendRT(kW, kH, 1, 0, *imageInfo);
+ GrBackendRenderTarget origBackendRT(kW, kH, 0, 0, *imageInfo);
sk_sp<GrRenderTarget> rt = gpu->wrapBackendRenderTarget(origBackendRT);
REPORTER_ASSERT(reporter, rt);
@@ -92,7 +92,7 @@ void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) {
{
GrVkImageInfo backendCopy = *imageInfo;
backendCopy.fImage = VK_NULL_HANDLE;
- GrBackendRenderTarget backendRT(kW, kH, 1, 0, backendCopy);
+ GrBackendRenderTarget backendRT(kW, kH, 0, 0, backendCopy);
rt = gpu->wrapBackendRenderTarget(backendRT);
REPORTER_ASSERT(reporter, !rt);
}
@@ -102,7 +102,7 @@ void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) {
GrVkImageInfo backendCopy = *imageInfo;
backendCopy.fAlloc = { VK_NULL_HANDLE, 0, 0, 0 };
// can wrap null alloc
- GrBackendRenderTarget backendRT(kW, kH, 1, 0, backendCopy);
+ GrBackendRenderTarget backendRT(kW, kH, 0, 0, backendCopy);
rt = gpu->wrapBackendRenderTarget(backendRT);
REPORTER_ASSERT(reporter, rt);
}
@@ -120,8 +120,8 @@ void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) {
GrMipMapped::kNo);
const GrVkImageInfo* imageInfo = origBackendTex.getVkImageInfo();
- sk_sp<GrTexture> tex =
- gpu->wrapRenderableBackendTexture(origBackendTex, 1, kBorrow_GrWrapOwnership);
+ sk_sp<GrTexture> tex = gpu->wrapRenderableBackendTexture(origBackendTex, 0,
+ kBorrow_GrWrapOwnership);
REPORTER_ASSERT(reporter, tex);
// image is null
@@ -129,9 +129,9 @@ void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) {
GrVkImageInfo backendCopy = *imageInfo;
backendCopy.fImage = VK_NULL_HANDLE;
GrBackendTexture backendTex = GrBackendTexture(kW, kH, backendCopy);
- tex = gpu->wrapRenderableBackendTexture(backendTex, 1, kBorrow_GrWrapOwnership);
+ tex = gpu->wrapRenderableBackendTexture(backendTex, 0, kBorrow_GrWrapOwnership);
REPORTER_ASSERT(reporter, !tex);
- tex = gpu->wrapRenderableBackendTexture(backendTex, 1, kAdopt_GrWrapOwnership);
+ tex = gpu->wrapRenderableBackendTexture(backendTex, 0, kAdopt_GrWrapOwnership);
REPORTER_ASSERT(reporter, !tex);
}
@@ -140,9 +140,9 @@ void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) {
GrVkImageInfo backendCopy = *imageInfo;
backendCopy.fAlloc = { VK_NULL_HANDLE, 0, 0, 0 };
GrBackendTexture backendTex = GrBackendTexture(kW, kH, backendCopy);
- tex = gpu->wrapRenderableBackendTexture(backendTex, 1, kBorrow_GrWrapOwnership);
+ tex = gpu->wrapRenderableBackendTexture(backendTex, 0, kBorrow_GrWrapOwnership);
REPORTER_ASSERT(reporter, !tex);
- tex = gpu->wrapRenderableBackendTexture(backendTex, 1, kAdopt_GrWrapOwnership);
+ tex = gpu->wrapRenderableBackendTexture(backendTex, 0, kAdopt_GrWrapOwnership);
REPORTER_ASSERT(reporter, !tex);
}
@@ -150,7 +150,7 @@ void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) {
{
GrVkImageInfo backendCopy = *imageInfo;
GrBackendTexture backendTex = GrBackendTexture(kW, kH, backendCopy);
- tex = gpu->wrapRenderableBackendTexture(backendTex, 1, kAdopt_GrWrapOwnership);
+ tex = gpu->wrapRenderableBackendTexture(backendTex, 0, kAdopt_GrWrapOwnership);
REPORTER_ASSERT(reporter, tex);
}
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 2a2ee397ef..a16752f229 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -412,11 +412,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixels_Gpu, reporter, ctxInfo) {
const SkImageInfo ii = SkImageInfo::MakeN32Premul(DEV_W, DEV_H);
for (auto& origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) {
- for (int sampleCnt : {1, 4}) {
+ for (int sampleCnt : {0, 4}) {
sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(ctxInfo.grContext(),
SkBudgeted::kNo, ii, sampleCnt,
origin, nullptr));
- if (!surface && sampleCnt > 1) {
+ if (!surface && sampleCnt > 0) {
// Some platforms don't support MSAA
continue;
}
@@ -430,7 +430,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsNonTexture_Gpu, reporter, ctxInfo)
GrGpu* gpu = context->contextPriv().getGpu();
for (auto& origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) {
- for (int sampleCnt : {1, 4}) {
+ for (int sampleCnt : {0, 4}) {
GrBackendTexture backendTex = gpu->createTestingOnlyBackendTexture(
nullptr, DEV_W, DEV_H, kSkia8888_GrPixelConfig, true, GrMipMapped::kNo);
SkColorType colorType;