Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: tests/GrPorterDuffTest.cpp

Issue 1429863009: Use a struct for client GL texture handles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 SkFAIL("Failed to create null context without ARB_blend_func_extended.") ; 1157 SkFAIL("Failed to create null context without ARB_blend_func_extended.") ;
1158 return; 1158 return;
1159 } 1159 }
1160 1160
1161 const GrCaps& caps = *ctx->caps(); 1161 const GrCaps& caps = *ctx->caps();
1162 if (caps.shaderCaps()->dualSourceBlendingSupport()) { 1162 if (caps.shaderCaps()->dualSourceBlendingSupport()) {
1163 SkFAIL("Null context failed to honor request for no ARB_blend_func_exten ded."); 1163 SkFAIL("Null context failed to honor request for no ARB_blend_func_exten ded.");
1164 return; 1164 return;
1165 } 1165 }
1166 1166
1167 GrBackendObject backendTex =
1168 ctx->getGpu()->createTestingOnlyBackendTexture(nullptr, 100, 100, kRGBA_ 8888_GrPixelConfig);
1167 GrBackendTextureDesc fakeDesc; 1169 GrBackendTextureDesc fakeDesc;
1168 fakeDesc.fConfig = kRGBA_8888_GrPixelConfig; 1170 fakeDesc.fConfig = kRGBA_8888_GrPixelConfig;
1169 fakeDesc.fWidth = fakeDesc.fHeight = 100; 1171 fakeDesc.fWidth = fakeDesc.fHeight = 100;
1170 fakeDesc.fTextureHandle = 1; 1172 fakeDesc.fTextureHandle = backendTex;
1171 SkAutoTUnref<GrTexture> fakeTexture(ctx->textureProvider()->wrapBackendTextu re(fakeDesc, 1173 SkAutoTUnref<GrTexture> fakeTexture(ctx->textureProvider()->wrapBackendTextu re(fakeDesc,
1172 kBorrow_GrWrapOwnership)); 1174 kBorrow_GrWrapOwnership));
1173 GrXferProcessor::DstTexture fakeDstTexture; 1175 GrXferProcessor::DstTexture fakeDstTexture;
1174 fakeDstTexture.setTexture(fakeTexture); 1176 fakeDstTexture.setTexture(fakeTexture);
1175 1177
1176 static const GrColor testColors[] = { 1178 static const GrColor testColors[] = {
1177 0, 1179 0,
1178 GrColorPackRGBA(0, 82, 0, 255), 1180 GrColorPackRGBA(0, 82, 0, 255),
1179 GrColorPackA4(255) 1181 GrColorPackA4(255)
1180 }; 1182 };
(...skipping 25 matching lines...) Expand all
1206 if (!xp) { 1208 if (!xp) {
1207 ERRORF(reporter, "Failed to create an XP without dual source blending."); 1209 ERRORF(reporter, "Failed to create an XP without dual source blending.");
1208 return; 1210 return;
1209 } 1211 }
1210 TEST_ASSERT(!xp->hasSecondaryOutput()); 1212 TEST_ASSERT(!xp->hasSecondaryOutput());
1211 xp->getOptimizations(colorPOI, covPOI, false, 0, caps); 1213 xp->getOptimizations(colorPOI, covPOI, false, 0, caps);
1212 TEST_ASSERT(!xp->hasSecondaryOutput()); 1214 TEST_ASSERT(!xp->hasSecondaryOutput());
1213 } 1215 }
1214 } 1216 }
1215 } 1217 }
1218 ctx->getGpu()->deleteTestingOnlyBackendTexture(backendTex);
1216 } 1219 }
1217 1220
1218 #endif 1221 #endif
1219 1222
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698