OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 // This is a GPU-backend specific test. | 8 // This is a GPU-backend specific test. |
9 | 9 |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(AllocedProxyTest, reporter, ctxInfo) { | 78 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(AllocedProxyTest, reporter, ctxInfo) { |
79 GrTextureProvider* provider = ctxInfo.fGrContext->textureProvider(); | 79 GrTextureProvider* provider = ctxInfo.fGrContext->textureProvider(); |
80 | 80 |
81 for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }
) { | 81 for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }
) { |
82 for (auto widthHeight : { 100, 128 }) { | 82 for (auto widthHeight : { 100, 128 }) { |
83 for (auto config : { kAlpha_8_GrPixelConfig, kRGBA_8888_GrPixelConfi
g }) { | 83 for (auto config : { kAlpha_8_GrPixelConfig, kRGBA_8888_GrPixelConfi
g }) { |
84 for (auto fit : { SkBackingFit::kExact, SkBackingFit::kApprox })
{ | 84 for (auto fit : { SkBackingFit::kExact, SkBackingFit::kApprox })
{ |
85 for (auto budgeted : { SkBudgeted::kYes, SkBudgeted::kNo })
{ | 85 for (auto budgeted : { SkBudgeted::kYes, SkBudgeted::kNo })
{ |
86 for (auto numSamples : { 0, 4}) { | 86 for (auto numSamples : { 0, 4}) { |
87 bool renderable = ctxInfo.fGrContext->caps()->isConf
igRenderable( | 87 bool renderable = ctxInfo.fGrContext->caps()->isConf
igRenderable( |
88 config, nu
mSamples > 0); | 88 config, nu
mSamples > 0) && |
| 89 numSamples <= ctxInfo.fGrContext->caps()->maxC
olorSampleCount(); |
89 | 90 |
90 GrSurfaceDesc desc; | 91 GrSurfaceDesc desc; |
91 desc.fOrigin = origin; | 92 desc.fOrigin = origin; |
92 desc.fWidth = widthHeight; | 93 desc.fWidth = widthHeight; |
93 desc.fHeight = widthHeight; | 94 desc.fHeight = widthHeight; |
94 desc.fConfig = config; | 95 desc.fConfig = config; |
95 desc.fSampleCnt = numSamples; | 96 desc.fSampleCnt = numSamples; |
96 | 97 |
97 if (renderable) { | 98 if (renderable) { |
98 sk_sp<GrRenderTargetProxy> rtProxy(GrRenderTarge
tProxy::Make( | 99 sk_sp<GrRenderTargetProxy> rtProxy(GrRenderTarge
tProxy::Make( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 check_surface(reporter, texProxy.get(), origin, | 164 check_surface(reporter, texProxy.get(), origin, |
164 kWidthHeight, kWidthHeight, config); | 165 kWidthHeight, kWidthHeight, config); |
165 check_texture(reporter, provider, texProxy.get(), SkBackingF
it::kExact); | 166 check_texture(reporter, provider, texProxy.get(), SkBackingF
it::kExact); |
166 } | 167 } |
167 } | 168 } |
168 } | 169 } |
169 } | 170 } |
170 } | 171 } |
171 | 172 |
172 #endif | 173 #endif |
OLD | NEW |