Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | // This is a GPU-backend specific test. It relies on static intializers to work |
| 9 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 10 | #include "include/core/SkTypes.h" |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 11 | |
| 12 | #if SK_SUPPORT_GPU && defined(SK_VULKAN) |
| 13 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 14 | #include "include/gpu/vk/GrVkVulkan.h" |
Greg Daniel | 54bfb18 | 2018-11-20 17:12:36 -0500 | [diff] [blame] | 15 | |
Mike Reed | ac9f0c9 | 2020-12-23 10:11:33 -0500 | [diff] [blame] | 16 | #include "include/core/SkBitmap.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 17 | #include "include/core/SkDrawable.h" |
| 18 | #include "include/core/SkSurface.h" |
| 19 | #include "include/gpu/GrBackendDrawableInfo.h" |
Robert Phillips | 6d344c3 | 2020-07-06 10:56:46 -0400 | [diff] [blame] | 20 | #include "include/gpu/GrDirectContext.h" |
Adlai Holler | a069304 | 2020-10-14 11:23:11 -0400 | [diff] [blame] | 21 | #include "src/gpu/GrDirectContextPriv.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 22 | #include "src/gpu/vk/GrVkGpu.h" |
| 23 | #include "src/gpu/vk/GrVkInterface.h" |
| 24 | #include "src/gpu/vk/GrVkMemory.h" |
| 25 | #include "src/gpu/vk/GrVkSecondaryCBDrawContext.h" |
| 26 | #include "src/gpu/vk/GrVkUtil.h" |
| 27 | #include "tests/Test.h" |
| 28 | #include "tools/gpu/GrContextFactory.h" |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 29 | |
| 30 | using sk_gpu_test::GrContextFactory; |
| 31 | |
| 32 | static const int DEV_W = 16, DEV_H = 16; |
| 33 | |
| 34 | class TestDrawable : public SkDrawable { |
| 35 | public: |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 36 | TestDrawable(const GrVkInterface* interface, GrDirectContext* dContext, |
| 37 | int32_t width, int32_t height) |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 38 | : INHERITED() |
| 39 | , fInterface(interface) |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 40 | , fDContext(dContext) |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 41 | , fWidth(width) |
| 42 | , fHeight(height) {} |
| 43 | |
| 44 | ~TestDrawable() override {} |
| 45 | |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 46 | class DrawHandlerBasic : public GpuDrawHandler { |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 47 | public: |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 48 | DrawHandlerBasic(const GrVkInterface* interface, int32_t width, int32_t height) |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 49 | : INHERITED() |
| 50 | , fInterface(interface) |
| 51 | , fWidth(width) |
| 52 | , fHeight(height) {} |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 53 | ~DrawHandlerBasic() override {} |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 54 | |
| 55 | void draw(const GrBackendDrawableInfo& info) override { |
| 56 | GrVkDrawableInfo vkInfo; |
| 57 | SkAssertResult(info.getVkDrawableInfo(&vkInfo)); |
| 58 | |
| 59 | // Clear to Red |
| 60 | VkClearColorValue vkColor; |
| 61 | vkColor.float32[0] = 1.0f; // r |
| 62 | vkColor.float32[1] = 0.0f; // g |
| 63 | vkColor.float32[2] = 0.0f; // b |
| 64 | vkColor.float32[3] = 1.0f; // a |
| 65 | |
| 66 | // Clear right half of render target |
| 67 | VkClearRect clearRect; |
| 68 | clearRect.rect.offset = { fWidth / 2, 0 }; |
| 69 | clearRect.rect.extent = { (uint32_t)fWidth / 2, (uint32_t)fHeight }; |
| 70 | clearRect.baseArrayLayer = 0; |
| 71 | clearRect.layerCount = 1; |
| 72 | |
| 73 | VkClearAttachment attachment; |
| 74 | attachment.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
Greg Daniel | b353eeb | 2018-12-05 11:01:58 -0500 | [diff] [blame] | 75 | attachment.colorAttachment = vkInfo.fColorAttachmentIndex; |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 76 | attachment.clearValue.color = vkColor; |
| 77 | |
| 78 | GR_VK_CALL(fInterface, CmdClearAttachments(vkInfo.fSecondaryCommandBuffer, |
| 79 | 1, |
| 80 | &attachment, |
| 81 | 1, |
| 82 | &clearRect)); |
| 83 | vkInfo.fDrawBounds->offset = { fWidth / 2, 0 }; |
| 84 | vkInfo.fDrawBounds->extent = { (uint32_t)fWidth / 2, (uint32_t)fHeight }; |
| 85 | } |
| 86 | private: |
| 87 | const GrVkInterface* fInterface; |
| 88 | int32_t fWidth; |
| 89 | int32_t fHeight; |
| 90 | |
John Stiles | 7571f9e | 2020-09-02 22:42:33 -0400 | [diff] [blame] | 91 | using INHERITED = GpuDrawHandler; |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 92 | }; |
| 93 | |
Derek Sollenberger | e6fb76b | 2019-01-10 13:19:06 -0500 | [diff] [blame] | 94 | typedef void (*DrawProc)(TestDrawable*, const SkMatrix&, const SkIRect&, |
| 95 | const SkImageInfo&, const GrVkDrawableInfo&); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 96 | typedef void (*SubmitProc)(TestDrawable*); |
| 97 | |
Robert Phillips | e94b4e1 | 2020-07-23 13:54:35 -0400 | [diff] [blame] | 98 | // Exercises the exporting of a secondary command buffer from one context and then importing |
| 99 | // it into a second context. We then draw to the secondary command buffer from the second |
| 100 | // context. |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 101 | class DrawHandlerImport : public GpuDrawHandler { |
| 102 | public: |
Derek Sollenberger | e6fb76b | 2019-01-10 13:19:06 -0500 | [diff] [blame] | 103 | DrawHandlerImport(TestDrawable* td, DrawProc drawProc, SubmitProc submitProc, |
| 104 | const SkMatrix& matrix, |
| 105 | const SkIRect& clipBounds, |
| 106 | const SkImageInfo& bufferInfo) |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 107 | : INHERITED() |
| 108 | , fTestDrawable(td) |
| 109 | , fDrawProc(drawProc) |
Derek Sollenberger | e6fb76b | 2019-01-10 13:19:06 -0500 | [diff] [blame] | 110 | , fSubmitProc(submitProc) |
| 111 | , fMatrix(matrix) |
| 112 | , fClipBounds(clipBounds) |
| 113 | , fBufferInfo(bufferInfo) {} |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 114 | ~DrawHandlerImport() override { |
| 115 | fSubmitProc(fTestDrawable); |
| 116 | } |
| 117 | |
| 118 | void draw(const GrBackendDrawableInfo& info) override { |
| 119 | GrVkDrawableInfo vkInfo; |
| 120 | SkAssertResult(info.getVkDrawableInfo(&vkInfo)); |
| 121 | |
Derek Sollenberger | e6fb76b | 2019-01-10 13:19:06 -0500 | [diff] [blame] | 122 | fDrawProc(fTestDrawable, fMatrix, fClipBounds, fBufferInfo, vkInfo); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 123 | } |
| 124 | private: |
Derek Sollenberger | e6fb76b | 2019-01-10 13:19:06 -0500 | [diff] [blame] | 125 | TestDrawable* fTestDrawable; |
| 126 | DrawProc fDrawProc; |
| 127 | SubmitProc fSubmitProc; |
| 128 | const SkMatrix fMatrix; |
| 129 | const SkIRect fClipBounds; |
| 130 | const SkImageInfo fBufferInfo; |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 131 | |
John Stiles | 7571f9e | 2020-09-02 22:42:33 -0400 | [diff] [blame] | 132 | using INHERITED = GpuDrawHandler; |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 133 | }; |
| 134 | |
| 135 | // Helper function to test drawing to a secondary command buffer that we imported into the |
Robert Phillips | e94b4e1 | 2020-07-23 13:54:35 -0400 | [diff] [blame] | 136 | // context using a GrVkSecondaryCBDrawContext. |
Derek Sollenberger | e6fb76b | 2019-01-10 13:19:06 -0500 | [diff] [blame] | 137 | static void ImportDraw(TestDrawable* td, const SkMatrix& matrix, const SkIRect& clipBounds, |
| 138 | const SkImageInfo& bufferInfo, const GrVkDrawableInfo& info) { |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 139 | td->fDrawContext = GrVkSecondaryCBDrawContext::Make(td->fDContext, bufferInfo, |
| 140 | info, nullptr); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 141 | if (!td->fDrawContext) { |
| 142 | return; |
| 143 | } |
| 144 | |
| 145 | SkCanvas* canvas = td->fDrawContext->getCanvas(); |
Derek Sollenberger | e6fb76b | 2019-01-10 13:19:06 -0500 | [diff] [blame] | 146 | canvas->clipRect(SkRect::Make(clipBounds)); |
| 147 | canvas->setMatrix(matrix); |
| 148 | |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 149 | SkIRect rect = SkIRect::MakeXYWH(td->fWidth/2, 0, td->fWidth/4, td->fHeight); |
| 150 | SkPaint paint; |
| 151 | paint.setColor(SK_ColorRED); |
| 152 | canvas->drawIRect(rect, paint); |
| 153 | |
| 154 | // Draw to an offscreen target so that we end up with a mix of "real" secondary command |
| 155 | // buffers and the imported secondary command buffer. |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 156 | sk_sp<SkSurface> surf = SkSurface::MakeRenderTarget(td->fDContext, SkBudgeted::kYes, |
Derek Sollenberger | e6fb76b | 2019-01-10 13:19:06 -0500 | [diff] [blame] | 157 | bufferInfo); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 158 | surf->getCanvas()->clear(SK_ColorRED); |
| 159 | |
| 160 | SkRect dstRect = SkRect::MakeXYWH(3*td->fWidth/4, 0, td->fWidth/4, td->fHeight); |
Mike Reed | 99da77a | 2021-01-29 12:27:49 -0500 | [diff] [blame] | 161 | SkRect srcRect = SkRect::MakeIWH(td->fWidth/4, td->fHeight); |
| 162 | canvas->drawImageRect(surf->makeImageSnapshot(), srcRect, dstRect, SkSamplingOptions(), |
| 163 | &paint, SkCanvas::kStrict_SrcRectConstraint); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 164 | |
| 165 | td->fDrawContext->flush(); |
| 166 | } |
| 167 | |
| 168 | // Helper function to test waiting for the imported secondary command buffer to be submitted on |
Robert Phillips | e94b4e1 | 2020-07-23 13:54:35 -0400 | [diff] [blame] | 169 | // its original context and then cleaning up the GrVkSecondaryCBDrawContext from this context. |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 170 | static void ImportSubmitted(TestDrawable* td) { |
| 171 | // Typical use case here would be to create a fence that we submit to the gpu and then wait |
| 172 | // on before releasing the GrVkSecondaryCBDrawContext resources. To simulate that for this |
| 173 | // test (and since we are running single threaded anyways), we will just force a sync of |
| 174 | // the gpu and cpu here. |
Brian Salomon | 725f158 | 2021-02-12 12:10:43 -0500 | [diff] [blame] | 175 | td->fDContext->submit(true); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 176 | |
| 177 | td->fDrawContext->releaseResources(); |
Robert Phillips | e94b4e1 | 2020-07-23 13:54:35 -0400 | [diff] [blame] | 178 | // We release the context here manually to test that we waited long enough before |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 179 | // releasing the GrVkSecondaryCBDrawContext. This simulates when a client is able to delete |
Robert Phillips | e94b4e1 | 2020-07-23 13:54:35 -0400 | [diff] [blame] | 180 | // the context it used to imported the secondary command buffer. If we had released the |
| 181 | // context's resources earlier (before waiting on the gpu above), we would get vulkan |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 182 | // validation layer errors saying we freed some vulkan objects while they were still in use |
| 183 | // on the GPU. |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 184 | td->fDContext->releaseResourcesAndAbandonContext(); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 188 | std::unique_ptr<GpuDrawHandler> onSnapGpuDrawHandler(GrBackendApi backendApi, |
Greg Daniel | b2a259c | 2018-12-17 10:28:47 -0500 | [diff] [blame] | 189 | const SkMatrix& matrix, |
Derek Sollenberger | e6fb76b | 2019-01-10 13:19:06 -0500 | [diff] [blame] | 190 | const SkIRect& clipBounds, |
| 191 | const SkImageInfo& bufferInfo) override { |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 192 | if (backendApi != GrBackendApi::kVulkan) { |
| 193 | return nullptr; |
| 194 | } |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 195 | std::unique_ptr<GpuDrawHandler> draw; |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 196 | if (fDContext) { |
John Stiles | fbd050b | 2020-08-03 13:21:46 -0400 | [diff] [blame] | 197 | draw = std::make_unique<DrawHandlerImport>(this, ImportDraw, ImportSubmitted, matrix, |
| 198 | clipBounds, bufferInfo); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 199 | } else { |
John Stiles | fbd050b | 2020-08-03 13:21:46 -0400 | [diff] [blame] | 200 | draw = std::make_unique<DrawHandlerBasic>(fInterface, fWidth, fHeight); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 201 | } |
| 202 | return draw; |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | SkRect onGetBounds() override { |
| 206 | return SkRect::MakeLTRB(fWidth / 2, 0, fWidth, fHeight); |
| 207 | } |
| 208 | |
| 209 | void onDraw(SkCanvas*) override { |
| 210 | SkASSERT(false); |
| 211 | } |
| 212 | |
| 213 | private: |
| 214 | const GrVkInterface* fInterface; |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 215 | GrDirectContext* fDContext; |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 216 | sk_sp<GrVkSecondaryCBDrawContext> fDrawContext; |
| 217 | int32_t fWidth; |
| 218 | int32_t fHeight; |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 219 | |
John Stiles | 7571f9e | 2020-09-02 22:42:33 -0400 | [diff] [blame] | 220 | using INHERITED = SkDrawable; |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 221 | }; |
| 222 | |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 223 | void draw_drawable_test(skiatest::Reporter* reporter, |
| 224 | GrDirectContext* dContext, |
| 225 | GrDirectContext* childDContext) { |
| 226 | GrVkGpu* gpu = static_cast<GrVkGpu*>(dContext->priv().getGpu()); |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 227 | |
| 228 | const SkImageInfo ii = SkImageInfo::Make(DEV_W, DEV_H, kRGBA_8888_SkColorType, |
| 229 | kPremul_SkAlphaType); |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 230 | sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(dContext, SkBudgeted::kNo, |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 231 | ii, 0, kTopLeft_GrSurfaceOrigin, nullptr)); |
| 232 | SkCanvas* canvas = surface->getCanvas(); |
| 233 | canvas->clear(SK_ColorBLUE); |
| 234 | |
Robert Phillips | b25e065 | 2020-07-22 09:35:49 -0400 | [diff] [blame] | 235 | sk_sp<TestDrawable> drawable(new TestDrawable(gpu->vkInterface(), childDContext, DEV_W, DEV_H)); |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 236 | canvas->drawDrawable(drawable.get()); |
| 237 | |
| 238 | SkPaint paint; |
| 239 | paint.setColor(SK_ColorGREEN); |
| 240 | SkIRect rect = SkIRect::MakeLTRB(0, DEV_H/2, DEV_W, DEV_H); |
| 241 | canvas->drawIRect(rect, paint); |
| 242 | |
| 243 | // read pixels |
| 244 | SkBitmap bitmap; |
| 245 | bitmap.allocPixels(ii); |
| 246 | canvas->readPixels(bitmap, 0, 0); |
| 247 | |
| 248 | const uint32_t* canvasPixels = static_cast<const uint32_t*>(bitmap.getPixels()); |
| 249 | bool failureFound = false; |
| 250 | SkPMColor expectedPixel; |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 251 | for (int cy = 0; cy < DEV_H && !failureFound; ++cy) { |
| 252 | for (int cx = 0; cx < DEV_W && !failureFound; ++cx) { |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 253 | SkPMColor canvasPixel = canvasPixels[cy * DEV_W + cx]; |
| 254 | if (cy < DEV_H / 2) { |
| 255 | if (cx < DEV_W / 2) { |
| 256 | expectedPixel = 0xFFFF0000; // Blue |
| 257 | } else { |
| 258 | expectedPixel = 0xFF0000FF; // Red |
| 259 | } |
| 260 | } else { |
| 261 | expectedPixel = 0xFF00FF00; // Green |
| 262 | } |
| 263 | if (expectedPixel != canvasPixel) { |
| 264 | failureFound = true; |
| 265 | ERRORF(reporter, "Wrong color at %d, %d. Got 0x%08x when we expected 0x%08x", |
| 266 | cx, cy, canvasPixel, expectedPixel); |
| 267 | } |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 272 | DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkDrawableTest, reporter, ctxInfo) { |
Robert Phillips | 6d344c3 | 2020-07-06 10:56:46 -0400 | [diff] [blame] | 273 | draw_drawable_test(reporter, ctxInfo.directContext(), nullptr); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 274 | } |
| 275 | |
| 276 | DEF_GPUTEST(VkDrawableImportTest, reporter, options) { |
| 277 | for (int typeInt = 0; typeInt < sk_gpu_test::GrContextFactory::kContextTypeCnt; ++typeInt) { |
| 278 | sk_gpu_test::GrContextFactory::ContextType contextType = |
| 279 | (sk_gpu_test::GrContextFactory::ContextType) typeInt; |
| 280 | if (contextType != sk_gpu_test::GrContextFactory::kVulkan_ContextType) { |
| 281 | continue; |
| 282 | } |
| 283 | sk_gpu_test::GrContextFactory factory(options); |
Chris Dalton | b3c9745 | 2019-06-25 20:07:56 -0600 | [diff] [blame] | 284 | sk_gpu_test::ContextInfo ctxInfo = factory.getContextInfo(contextType); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 285 | skiatest::ReporterContext ctx( |
| 286 | reporter, SkString(sk_gpu_test::GrContextFactory::ContextTypeName(contextType))); |
Robert Phillips | 6d344c3 | 2020-07-06 10:56:46 -0400 | [diff] [blame] | 287 | if (ctxInfo.directContext()) { |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 288 | sk_gpu_test::ContextInfo child = |
Robert Phillips | 00f78de | 2020-07-01 16:09:43 -0400 | [diff] [blame] | 289 | factory.getSharedContextInfo(ctxInfo.directContext(), 0); |
Robert Phillips | 6d344c3 | 2020-07-06 10:56:46 -0400 | [diff] [blame] | 290 | if (!child.directContext()) { |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 291 | continue; |
| 292 | } |
| 293 | |
Robert Phillips | 6d344c3 | 2020-07-06 10:56:46 -0400 | [diff] [blame] | 294 | draw_drawable_test(reporter, ctxInfo.directContext(), child.directContext()); |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 295 | } |
| 296 | } |
Greg Daniel | 64cc9aa | 2018-10-19 13:54:56 -0400 | [diff] [blame] | 297 | } |
| 298 | |
| 299 | #endif |