aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ProxyTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-02-03 00:25:12 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-03 00:25:20 +0000
commit3a2cc2c2ec124de36d2544b2a523ef1dd317ca32 (patch)
treedf3154eabde3275c5a6b88f66233b9a3984bd04f /tests/ProxyTest.cpp
parent5bb82cbecd740d21b92e8d2944280ab6eb6af7a6 (diff)
Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""""
This reverts commit 5bb82cbecd740d21b92e8d2944280ab6eb6af7a6. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""" > > This reverts commit 18c52a7b52211de5d0dcd86dc048adef758c6c75. > > Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types" > > > Bug: skia: > Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947 > Reviewed-on: https://skia-review.googlesource.com/102940 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Idee23be2f1719f0bdc9305043e95a2d589bee8d1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/103220 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/ProxyTest.cpp')
-rw-r--r--tests/ProxyTest.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index dff230c9bb..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;
@@ -149,8 +149,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredProxyTest, reporter, ctxInfo) {
check_surface(reporter, proxy.get(), origin,
widthHeight, widthHeight, config, budgeted);
- int supportedSamples =
- caps.getRenderTargetSampleCount(numSamples, config);
+ int supportedSamples = caps.getSampleCount(numSamples, config);
check_rendertarget(reporter, caps, resourceProvider,
proxy->asRenderTargetProxy(),
supportedSamples,
@@ -205,8 +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}) {
- int supportedNumSamples = caps.getRenderTargetSampleCount(numSamples, config);
+ for (auto numSamples: { 0, 4}) {
+ int supportedNumSamples = caps.getSampleCount(numSamples, config);
+
+ bool renderable = caps.isConfigRenderable(config, numSamples > 0);
GrSurfaceDesc desc;
desc.fOrigin = origin;
@@ -216,7 +217,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
desc.fSampleCnt = supportedNumSamples;
// External on-screen render target.
- if (supportedNumSamples && kOpenGL_GrBackend == ctxInfo.backend()) {
+ if (renderable && kOpenGL_GrBackend == ctxInfo.backend()) {
GrGLFramebufferInfo fboInfo;
fboInfo.fFBOID = 0;
GrBackendRenderTarget backendRT(kWidthHeight, kWidthHeight, numSamples, 8,
@@ -231,7 +232,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
supportedNumSamples, SkBackingFit::kExact, 0, true);
}
- if (supportedNumSamples) {
+ if (renderable) {
// Internal offscreen render target.
desc.fFlags = kRenderTarget_GrSurfaceFlag;
@@ -250,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);
@@ -286,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);