| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 REPORTER_ASSERT(reporter, tex->width() == texProxy->width()); | 68 REPORTER_ASSERT(reporter, tex->width() == texProxy->width()); |
| 69 REPORTER_ASSERT(reporter, tex->height() == texProxy->height()); | 69 REPORTER_ASSERT(reporter, tex->height() == texProxy->height()); |
| 70 } else { | 70 } else { |
| 71 REPORTER_ASSERT(reporter, tex->width() >= texProxy->width()); | 71 REPORTER_ASSERT(reporter, tex->width() >= texProxy->width()); |
| 72 REPORTER_ASSERT(reporter, tex->height() >= texProxy->height()); | 72 REPORTER_ASSERT(reporter, tex->height() >= texProxy->height()); |
| 73 } | 73 } |
| 74 REPORTER_ASSERT(reporter, tex->config() == texProxy->config()); | 74 REPORTER_ASSERT(reporter, tex->config() == texProxy->config()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 | 77 |
| 78 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(AllocedProxyTest, reporter, ctxInfo) { | 78 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(AllocedProxyTest, reporter, ctxInfo) { |
| 79 GrTextureProvider* provider = ctxInfo.grContext()->textureProvider(); | 79 GrTextureProvider* provider = ctxInfo.grContext()->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.grContext()->caps()->isCon
figRenderable( | 87 bool renderable = ctxInfo.grContext()->caps()->isCon
figRenderable( |
| 88 config, nu
mSamples > 0) && | 88 config, nu
mSamples > 0) && |
| (...skipping 26 matching lines...) Expand all Loading... |
| 115 widthHeight, widthHeight, config); | 115 widthHeight, widthHeight, config); |
| 116 check_texture(reporter, provider, texProxy.get(), fi
t); | 116 check_texture(reporter, provider, texProxy.get(), fi
t); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) { | 125 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) { |
| 126 GrTextureProvider* provider = ctxInfo.grContext()->textureProvider(); | 126 GrTextureProvider* provider = ctxInfo.grContext()->textureProvider(); |
| 127 | 127 |
| 128 static const int kWidthHeight = 100; | 128 static const int kWidthHeight = 100; |
| 129 | 129 |
| 130 for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }
) { | 130 for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }
) { |
| 131 for (auto config : { kAlpha_8_GrPixelConfig, kRGBA_8888_GrPixelConfig })
{ | 131 for (auto config : { kAlpha_8_GrPixelConfig, kRGBA_8888_GrPixelConfig })
{ |
| 132 for (auto budgeted : { SkBudgeted::kYes, SkBudgeted::kNo }) { | 132 for (auto budgeted : { SkBudgeted::kYes, SkBudgeted::kNo }) { |
| 133 for (auto numSamples: { 0, 4}) { | 133 for (auto numSamples: { 0, 4}) { |
| 134 bool renderable = ctxInfo.grContext()->caps()->isConfigRende
rable( | 134 bool renderable = ctxInfo.grContext()->caps()->isConfigRende
rable( |
| 135 config, numSampl
es > 0); | 135 config, numSampl
es > 0); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 164 check_surface(reporter, texProxy.get(), origin, | 164 check_surface(reporter, texProxy.get(), origin, |
| 165 kWidthHeight, kWidthHeight, config); | 165 kWidthHeight, kWidthHeight, config); |
| 166 check_texture(reporter, provider, texProxy.get(), SkBackingF
it::kExact); | 166 check_texture(reporter, provider, texProxy.get(), SkBackingF
it::kExact); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 #endif | 173 #endif |
| OLD | NEW |