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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 texHandles[1] = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH, kRGBA_
8888_GrPixelConfig); | 214 texHandles[1] = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH, kRGBA_
8888_GrPixelConfig); |
215 | 215 |
216 context->resetContext(); | 216 context->resetContext(); |
217 | 217 |
218 GrBackendTextureDesc desc; | 218 GrBackendTextureDesc desc; |
219 desc.fConfig = kBGRA_8888_GrPixelConfig; | 219 desc.fConfig = kBGRA_8888_GrPixelConfig; |
220 desc.fWidth = kW; | 220 desc.fWidth = kW; |
221 desc.fHeight = kH; | 221 desc.fHeight = kH; |
222 | 222 |
223 desc.fTextureHandle = texHandles[0]; | 223 desc.fTextureHandle = texHandles[0]; |
224 SkAutoTUnref<GrTexture> borrowed(context->textureProvider()->wrapBackendText
ure( | 224 sk_sp<GrTexture> borrowed(context->textureProvider()->wrapBackendTexture( |
225 desc, kBorrow_GrWrapOwnership)); | 225 desc, kBorrow_GrWrapOwnership)); |
226 | 226 |
227 desc.fTextureHandle = texHandles[1]; | 227 desc.fTextureHandle = texHandles[1]; |
228 SkAutoTUnref<GrTexture> adopted(context->textureProvider()->wrapBackendTextu
re( | 228 sk_sp<GrTexture> adopted(context->textureProvider()->wrapBackendTexture( |
229 desc, kAdopt_GrWrapOwnership)); | 229 desc, kAdopt_GrWrapOwnership)); |
230 | 230 |
| 231 printf("\nborrowed: %p, adopted: %p\n", borrowed.get(), adopted.get()); |
231 REPORTER_ASSERT(reporter, borrowed != nullptr && adopted != nullptr); | 232 REPORTER_ASSERT(reporter, borrowed != nullptr && adopted != nullptr); |
232 if (!borrowed || !adopted) { | 233 if (!borrowed || !adopted) { |
233 return; | 234 return; |
234 } | 235 } |
235 | 236 |
236 borrowed.reset(nullptr); | 237 borrowed.reset(nullptr); |
237 adopted.reset(nullptr); | 238 adopted.reset(nullptr); |
238 | 239 |
239 context->flush(); | 240 context->flush(); |
240 | 241 |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 test_cache_chained_purge(reporter); | 1338 test_cache_chained_purge(reporter); |
1338 test_resource_size_changed(reporter); | 1339 test_resource_size_changed(reporter); |
1339 test_timestamp_wrap(reporter); | 1340 test_timestamp_wrap(reporter); |
1340 test_flush(reporter); | 1341 test_flush(reporter); |
1341 test_large_resource_count(reporter); | 1342 test_large_resource_count(reporter); |
1342 test_custom_data(reporter); | 1343 test_custom_data(reporter); |
1343 test_abandoned(reporter); | 1344 test_abandoned(reporter); |
1344 } | 1345 } |
1345 | 1346 |
1346 #endif | 1347 #endif |
OLD | NEW |