OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 // Include here to ensure SK_SUPPORT_GPU is set correctly before it is examined. | 8 // Include here to ensure SK_SUPPORT_GPU is set correctly before it is examined. |
9 #include "SkTypes.h" | 9 #include "SkTypes.h" |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 SkAutoTUnref<GrTexture> bigRT(cache->createTexture(bigDesc, false)); | 115 SkAutoTUnref<GrTexture> bigRT(cache->createTexture(bigDesc, false)); |
116 if (bigRT && bigRT->asRenderTarget()) { | 116 if (bigRT && bigRT->asRenderTarget()) { |
117 bigRT->asRenderTarget()->renderTargetPriv().attachStencilAttachment(); | 117 bigRT->asRenderTarget()->renderTargetPriv().attachStencilAttachment(); |
118 } | 118 } |
119 REPORTER_ASSERT(reporter, | 119 REPORTER_ASSERT(reporter, |
120 smallRT0 && bigRT && | 120 smallRT0 && bigRT && |
121 smallRT0->asRenderTarget() && bigRT->asRenderTarget() && | 121 smallRT0->asRenderTarget() && bigRT->asRenderTarget() && |
122 smallRT0->asRenderTarget()->renderTargetPriv().getStencilAtt
achment() != | 122 smallRT0->asRenderTarget()->renderTargetPriv().getStencilAtt
achment() != |
123 bigRT->asRenderTarget()->renderTargetPriv().getStencilAttach
ment()); | 123 bigRT->asRenderTarget()->renderTargetPriv().getStencilAttach
ment()); |
124 | 124 |
125 if (context->caps()->maxSampleCount() >= 4) { | 125 if (context->getMaxSampleCount() >= 4) { |
126 // An RT with a different sample count should not share. | 126 // An RT with a different sample count should not share. |
127 GrSurfaceDesc smallMSAADesc = smallDesc; | 127 GrSurfaceDesc smallMSAADesc = smallDesc; |
128 smallMSAADesc.fSampleCnt = 4; | 128 smallMSAADesc.fSampleCnt = 4; |
129 SkAutoTUnref<GrTexture> smallMSAART0(cache->createTexture(smallMSAADesc,
false)); | 129 SkAutoTUnref<GrTexture> smallMSAART0(cache->createTexture(smallMSAADesc,
false)); |
130 if (smallMSAART0 && smallMSAART0->asRenderTarget()) { | 130 if (smallMSAART0 && smallMSAART0->asRenderTarget()) { |
131 smallMSAART0->asRenderTarget()->renderTargetPriv().attachStencilAtta
chment(); | 131 smallMSAART0->asRenderTarget()->renderTargetPriv().attachStencilAtta
chment(); |
132 } | 132 } |
133 #ifdef SK_BUILD_FOR_ANDROID | 133 #ifdef SK_BUILD_FOR_ANDROID |
134 if (!smallMSAART0) { | 134 if (!smallMSAART0) { |
135 // The nexus player seems to fail to create MSAA textures. | 135 // The nexus player seems to fail to create MSAA textures. |
(...skipping 11 matching lines...) Expand all Loading... |
147 smallMSAART1->asRenderTarget()->renderTargetPriv().attachStencilAtta
chment(); | 147 smallMSAART1->asRenderTarget()->renderTargetPriv().attachStencilAtta
chment(); |
148 } | 148 } |
149 REPORTER_ASSERT(reporter, | 149 REPORTER_ASSERT(reporter, |
150 smallMSAART0 && smallMSAART1 && | 150 smallMSAART0 && smallMSAART1 && |
151 smallMSAART0->asRenderTarget() && | 151 smallMSAART0->asRenderTarget() && |
152 smallMSAART1->asRenderTarget() && | 152 smallMSAART1->asRenderTarget() && |
153 smallMSAART0->asRenderTarget()->renderTargetPriv().getSt
encilAttachment() == | 153 smallMSAART0->asRenderTarget()->renderTargetPriv().getSt
encilAttachment() == |
154 smallMSAART1->asRenderTarget()->renderTargetPriv().getSt
encilAttachment()); | 154 smallMSAART1->asRenderTarget()->renderTargetPriv().getSt
encilAttachment()); |
155 // But not one with a larger sample count should not. (Also check that t
he request for 4 | 155 // But not one with a larger sample count should not. (Also check that t
he request for 4 |
156 // samples didn't get rounded up to >= 8 or else they could share.). | 156 // samples didn't get rounded up to >= 8 or else they could share.). |
157 if (context->caps()->maxSampleCount() >= 8 && | 157 if (context->getMaxSampleCount() >= 8 && smallMSAART0 && smallMSAART0->a
sRenderTarget() && |
158 smallMSAART0 && smallMSAART0->asRenderTarget() && | |
159 smallMSAART0->asRenderTarget()->numSamples() < 8) { | 158 smallMSAART0->asRenderTarget()->numSamples() < 8) { |
160 smallMSAADesc.fSampleCnt = 8; | 159 smallMSAADesc.fSampleCnt = 8; |
161 smallMSAART1.reset(cache->createTexture(smallMSAADesc, false)); | 160 smallMSAART1.reset(cache->createTexture(smallMSAADesc, false)); |
162 SkAutoTUnref<GrTexture> smallMSAART1(cache->createTexture(smallMSAAD
esc, false)); | 161 SkAutoTUnref<GrTexture> smallMSAART1(cache->createTexture(smallMSAAD
esc, false)); |
163 if (smallMSAART1 && smallMSAART1->asRenderTarget()) { | 162 if (smallMSAART1 && smallMSAART1->asRenderTarget()) { |
164 smallMSAART1->asRenderTarget()->renderTargetPriv().attachStencil
Attachment(); | 163 smallMSAART1->asRenderTarget()->renderTargetPriv().attachStencil
Attachment(); |
165 } | 164 } |
166 REPORTER_ASSERT(reporter, | 165 REPORTER_ASSERT(reporter, |
167 smallMSAART0 && smallMSAART1 && | 166 smallMSAART0 && smallMSAART1 && |
168 smallMSAART0->asRenderTarget() && | 167 smallMSAART0->asRenderTarget() && |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 test_scratch_key_consistency(reporter); | 1205 test_scratch_key_consistency(reporter); |
1207 test_purge_invalidated(reporter); | 1206 test_purge_invalidated(reporter); |
1208 test_cache_chained_purge(reporter); | 1207 test_cache_chained_purge(reporter); |
1209 test_resource_size_changed(reporter); | 1208 test_resource_size_changed(reporter); |
1210 test_timestamp_wrap(reporter); | 1209 test_timestamp_wrap(reporter); |
1211 test_flush(reporter); | 1210 test_flush(reporter); |
1212 test_large_resource_count(reporter); | 1211 test_large_resource_count(reporter); |
1213 } | 1212 } |
1214 | 1213 |
1215 #endif | 1214 #endif |
OLD | NEW |