OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkXfermode.h" | 8 #include "SkXfermode.h" |
9 #include "Test.h" | 9 #include "Test.h" |
10 | 10 |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 return; | 1154 return; |
1155 } | 1155 } |
1156 | 1156 |
1157 const GrCaps& caps = *ctx->caps(); | 1157 const GrCaps& caps = *ctx->caps(); |
1158 if (caps.shaderCaps()->dualSourceBlendingSupport()) { | 1158 if (caps.shaderCaps()->dualSourceBlendingSupport()) { |
1159 SkFAIL("Null context failed to honor request for no ARB_blend_func_exten
ded."); | 1159 SkFAIL("Null context failed to honor request for no ARB_blend_func_exten
ded."); |
1160 return; | 1160 return; |
1161 } | 1161 } |
1162 | 1162 |
1163 GrBackendObject backendTex = | 1163 GrBackendObject backendTex = |
1164 ctx->getGpu()->createTestingOnlyBackendTexture(nullptr, 100, 100, | 1164 ctx->getGpu()->createTestingOnlyBackendTexture(nullptr, 100, 100, kRGBA_
8888_GrPixelConfig); |
1165 kRGBA_8888_GrPixelCon
fig); | |
1166 GrBackendTextureDesc fakeDesc; | 1165 GrBackendTextureDesc fakeDesc; |
1167 fakeDesc.fConfig = kRGBA_8888_GrPixelConfig; | 1166 fakeDesc.fConfig = kRGBA_8888_GrPixelConfig; |
1168 fakeDesc.fWidth = fakeDesc.fHeight = 100; | 1167 fakeDesc.fWidth = fakeDesc.fHeight = 100; |
1169 fakeDesc.fTextureHandle = backendTex; | 1168 fakeDesc.fTextureHandle = backendTex; |
1170 SkAutoTUnref<GrTexture> fakeTexture(ctx->textureProvider()->wrapBackendTextu
re(fakeDesc, | |
1171 kBorrow_GrWrapOwnership)); | |
1172 GrXferProcessor::DstTexture fakeDstTexture; | 1169 GrXferProcessor::DstTexture fakeDstTexture; |
1173 fakeDstTexture.setTexture(fakeTexture); | 1170 fakeDstTexture.setTexture( |
| 1171 ctx->textureProvider()->wrapBackendTexture(fakeDesc, kBorrow_GrWrapOwner
ship)); |
1174 | 1172 |
1175 static const GrColor testColors[] = { | 1173 static const GrColor testColors[] = { |
1176 0, | 1174 0, |
1177 GrColorPackRGBA(0, 82, 0, 255), | 1175 GrColorPackRGBA(0, 82, 0, 255), |
1178 GrColorPackA4(255) | 1176 GrColorPackA4(255) |
1179 }; | 1177 }; |
1180 static const GrColorComponentFlags testColorFlags[] = { | 1178 static const GrColorComponentFlags testColorFlags[] = { |
1181 kNone_GrColorComponentFlags, | 1179 kNone_GrColorComponentFlags, |
1182 kG_GrColorComponentFlag | kA_GrColorComponentFlag, | 1180 kG_GrColorComponentFlag | kA_GrColorComponentFlag, |
1183 kRGBA_GrColorComponentFlags | 1181 kRGBA_GrColorComponentFlags |
(...skipping 26 matching lines...) Expand all Loading... |
1210 TEST_ASSERT(!xp->hasSecondaryOutput()); | 1208 TEST_ASSERT(!xp->hasSecondaryOutput()); |
1211 xp->getOptimizations(optimizations, false, 0, caps); | 1209 xp->getOptimizations(optimizations, false, 0, caps); |
1212 TEST_ASSERT(!xp->hasSecondaryOutput()); | 1210 TEST_ASSERT(!xp->hasSecondaryOutput()); |
1213 } | 1211 } |
1214 } | 1212 } |
1215 } | 1213 } |
1216 ctx->getGpu()->deleteTestingOnlyBackendTexture(backendTex); | 1214 ctx->getGpu()->deleteTestingOnlyBackendTexture(backendTex); |
1217 } | 1215 } |
1218 | 1216 |
1219 #endif | 1217 #endif |
OLD | NEW |