| 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 <functional> | 8 #include <functional> |
| 9 #include <initializer_list> | 9 #include <initializer_list> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 } | 468 } |
| 469 if (image->width() != texImage->width() || image->height() != texImage->
height()) { | 469 if (image->width() != texImage->width() || image->height() != texImage->
height()) { |
| 470 ERRORF(reporter, "newTextureImage changed the image size."); | 470 ERRORF(reporter, "newTextureImage changed the image size."); |
| 471 } | 471 } |
| 472 if (image->isOpaque() != texImage->isOpaque()) { | 472 if (image->isOpaque() != texImage->isOpaque()) { |
| 473 ERRORF(reporter, "newTextureImage changed image opaqueness."); | 473 ERRORF(reporter, "newTextureImage changed image opaqueness."); |
| 474 } | 474 } |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 | 477 |
| 478 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_drawAbandonedGpuImage, reporter, cont
extInfo) { | 478 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkImage_drawAbandonedGpuImage, reporter, c
ontextInfo) { |
| 479 auto context = contextInfo.grContext(); | 479 auto context = contextInfo.grContext(); |
| 480 auto image = create_gpu_image(context); | 480 auto image = create_gpu_image(context); |
| 481 auto info = SkImageInfo::MakeN32(20, 20, kOpaque_SkAlphaType); | 481 auto info = SkImageInfo::MakeN32(20, 20, kOpaque_SkAlphaType); |
| 482 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info)); | 482 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info)); |
| 483 as_IB(image)->peekTexture()->abandon(); | 483 as_IB(image)->peekTexture()->abandon(); |
| 484 surface->getCanvas()->drawImage(image, 0, 0); | 484 surface->getCanvas()->drawImage(image, 0, 0); |
| 485 } | 485 } |
| 486 | 486 |
| 487 #endif | 487 #endif |
| 488 | 488 |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 otherContextInfo.grContext(), buffer, budgeted)); | 936 otherContextInfo.grContext(), buffer, budgeted)); |
| 937 REPORTER_ASSERT(reporter, !newImage2); | 937 REPORTER_ASSERT(reporter, !newImage2); |
| 938 testContext->makeCurrent(); | 938 testContext->makeCurrent(); |
| 939 } | 939 } |
| 940 } | 940 } |
| 941 sk_free(buffer); | 941 sk_free(buffer); |
| 942 } | 942 } |
| 943 } | 943 } |
| 944 } | 944 } |
| 945 #endif | 945 #endif |
| OLD | NEW |