Index: tests/SurfaceTest.cpp |
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp |
index 3996ab74296ee3e4da6d62892d161acc37286200..16db3e3c4e2d6f984e8b79d1d85db38a0c9ae444 100644 |
--- a/tests/SurfaceTest.cpp |
+++ b/tests/SurfaceTest.cpp |
@@ -128,38 +128,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCanvasPeek_Gpu, reporter, ctxInfo) { |
} |
#endif |
-// For compatibility with clients that still call accessBitmap(), we need to ensure that we bump |
-// the bitmap's genID when we draw to it, else they won't know it has new values. When they are |
-// exclusively using surface/image, and we can hide accessBitmap from device, we can remove this |
-// test. |
-void test_access_pixels(skiatest::Reporter* reporter, const sk_sp<SkSurface>& surface) { |
- SkCanvas* canvas = surface->getCanvas(); |
- canvas->clear(0); |
- |
- SkBaseDevice* device = canvas->getDevice_just_for_deprecated_compatibility_testing(); |
- SkBitmap bm = device->accessBitmap(false); |
- uint32_t genID0 = bm.getGenerationID(); |
- // Now we draw something, which needs to "dirty" the genID (sorta like copy-on-write) |
- canvas->drawColor(SK_ColorBLUE); |
- // Now check that we get a different genID |
- uint32_t genID1 = bm.getGenerationID(); |
- REPORTER_ASSERT(reporter, genID0 != genID1); |
-} |
-DEF_TEST(SurfaceAccessPixels, reporter) { |
- for (auto& surface_func : { &create_surface, &create_direct_surface }) { |
- auto surface(surface_func(kPremul_SkAlphaType, nullptr)); |
- test_access_pixels(reporter, surface); |
- } |
-} |
-#if SK_SUPPORT_GPU |
-DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceAccessPixels_Gpu, reporter, ctxInfo) { |
- for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { |
- auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr)); |
- test_access_pixels(reporter, surface); |
- } |
-} |
-#endif |
- |
static void test_snapshot_alphatype(skiatest::Reporter* reporter, const sk_sp<SkSurface>& surface, |
bool expectOpaque) { |
REPORTER_ASSERT(reporter, surface); |
@@ -380,36 +348,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(UniqueImageSnapshot_Gpu, reporter, ctxInfo) { |
#endif |
#if SK_SUPPORT_GPU |
-// May we (soon) eliminate the need to keep testing this, by hiding the bloody device! |
-static uint32_t get_legacy_gen_id(SkSurface* surface) { |
- SkBaseDevice* device = |
- surface->getCanvas()->getDevice_just_for_deprecated_compatibility_testing(); |
- return device->accessBitmap(false).getGenerationID(); |
-} |
-/* |
- * Test legacy behavor of bumping the surface's device's bitmap's genID when we access its |
- * texture handle for writing. |
- * |
- * Note: this needs to be tested separately from checking makeImageSnapshot, as calling that |
- * can also incidentally bump the genID (when a new backing surface is created). |
- */ |
-static void test_backend_handle_gen_id( |
- skiatest::Reporter* reporter, SkSurface* surface, |
- GrBackendObject (*func)(SkSurface*, SkSurface::BackendHandleAccess)) { |
- const uint32_t gen0 = get_legacy_gen_id(surface); |
- func(surface, SkSurface::kFlushRead_BackendHandleAccess); |
- const uint32_t gen1 = get_legacy_gen_id(surface); |
- REPORTER_ASSERT(reporter, gen0 == gen1); |
- func(surface, SkSurface::kFlushWrite_BackendHandleAccess); |
- const uint32_t gen2 = get_legacy_gen_id(surface); |
- REPORTER_ASSERT(reporter, gen0 != gen2); |
- |
- func(surface, SkSurface::kDiscardWrite_BackendHandleAccess); |
- const uint32_t gen3 = get_legacy_gen_id(surface); |
- REPORTER_ASSERT(reporter, gen0 != gen3); |
- REPORTER_ASSERT(reporter, gen2 != gen3); |
-} |
static void test_backend_handle_unique_id( |
skiatest::Reporter* reporter, SkSurface* surface, |
GrBackendObject (*func)(SkSurface*, SkSurface::BackendHandleAccess)) { |
@@ -436,7 +375,7 @@ static void test_backend_handle_unique_id( |
// No CPU test. |
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBackendHandleAccessIDs_Gpu, reporter, ctxInfo) { |
for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { |
- for (auto& test_func : { &test_backend_handle_unique_id, &test_backend_handle_gen_id }) { |
+ for (auto& test_func : { &test_backend_handle_unique_id }) { |
for (auto& handle_access_func : |
{ &get_surface_backend_texture_handle, &get_surface_backend_render_target_handle}) { |
auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr)); |