Revert "Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend.""""""
This reverts commit 3a2cc2c2ec124de36d2544b2a523ef1dd317ca32.
Fix code with samplecnt=0 that slipped in between trybots/CQ and landing of previous version
Change-Id: Iab19f2e8d1e9901601c8c76244d7a88c5d707fab
Reviewed-on: https://skia-review.googlesource.com/103181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index 3e246cc..32ac0c7 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -33,7 +33,7 @@
desc.fWidth = 256;
desc.fHeight = 256;
desc.fConfig = kRGBA_8888_GrPixelConfig;
- desc.fSampleCnt = 0;
+ desc.fSampleCnt = 1;
sk_sp<GrSurface> texRT1 = resourceProvider->createTexture(desc, SkBudgeted::kNo);
REPORTER_ASSERT(reporter, texRT1.get() == texRT1->asRenderTarget());
@@ -55,8 +55,8 @@
GrBackendTexture backendTex = gpu->createTestingOnlyBackendTexture(
nullptr, 256, 256, kRGBA_8888_GrPixelConfig, false, GrMipMapped::kNo);
- sk_sp<GrSurface> texRT2 = resourceProvider->wrapRenderableBackendTexture(
- backendTex, 0, kBorrow_GrWrapOwnership);
+ sk_sp<GrSurface> texRT2 =
+ resourceProvider->wrapRenderableBackendTexture(backendTex, 1, kBorrow_GrWrapOwnership);
REPORTER_ASSERT(reporter, texRT2.get() == texRT2->asRenderTarget());
REPORTER_ASSERT(reporter, texRT2.get() == texRT2->asTexture());
@@ -120,7 +120,7 @@
desc.fFlags = kNone_GrSurfaceFlags;
desc.fOrigin = origin;
desc.fConfig = config;
- desc.fSampleCnt = 0;
+ desc.fSampleCnt = 1;
sk_sp<GrSurface> tex = resourceProvider->createTexture(desc, SkBudgeted::kNo);
bool ict = caps->isConfigTexturable(desc.fConfig);
@@ -143,17 +143,17 @@
desc.fFlags = kRenderTarget_GrSurfaceFlag;
tex = resourceProvider->createTexture(desc, SkBudgeted::kNo);
- bool icr = caps->isConfigRenderable(config, false);
- REPORTER_ASSERT(reporter, SkToBool(tex) == icr,
- "config:%d, tex:%d, isConfigRenderable(false):%d", config,
- SkToBool(tex), icr);
+ bool isRenderable = caps->isConfigRenderable(config);
+ REPORTER_ASSERT(reporter, SkToBool(tex) == isRenderable,
+ "config:%d, tex:%d, isRenderable:%d", config, SkToBool(tex),
+ isRenderable);
- desc.fSampleCnt = 4;
+ desc.fSampleCnt = 2;
tex = resourceProvider->createTexture(desc, SkBudgeted::kNo);
- icr = caps->isConfigRenderable(config, true);
- REPORTER_ASSERT(reporter, SkToBool(tex) == icr,
- "config:%d, tex:%d, isConfigRenderable(true):%d", config, SkToBool(tex),
- icr);
+ isRenderable = SkToBool(caps->getRenderTargetSampleCount(2, config));
+ REPORTER_ASSERT(reporter, SkToBool(tex) == isRenderable,
+ "config:%d, tex:%d, isRenderable:%d", config, SkToBool(tex),
+ isRenderable);
}
}
}
@@ -178,7 +178,7 @@
}
desc.fFlags = kPerformInitialClear_GrSurfaceFlag;
for (bool rt : {false, true}) {
- if (rt && !context->caps()->isConfigRenderable(desc.fConfig, false)) {
+ if (rt && !context->caps()->isConfigRenderable(desc.fConfig)) {
continue;
}
desc.fFlags |= rt ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfaceFlags;