38 int*
count = (
int*)ctx;
45 auto begin = std::chrono::steady_clock::now();
49 end = std::chrono::steady_clock::now();
50 }
while (*
count != expectedValue && (
end -
begin) < std::chrono::seconds(1));
51 if (*
count != expectedValue) {
52 ERRORF(
reporter,
"Expected count failed to reach %d within 1 second of busy waiting.",
61 auto dContext = ctxInfo.directContext();
80 dContext->flush(
surface.get(), flushInfoFinishedProc);
88 dContext->flush(
surface.get(), flushInfoFinishedProc);
91 bool expectAsyncCallback = dContext->priv().caps()->finishedProcAsyncCallbackSupport();
92 if (expectAsyncCallback) {
105 dContext->flush(
image, flushInfoFinishedProc);
107 if (expectAsyncCallback) {
120 dContext->flush(flushInfoFinishedProc);
122 if (expectAsyncCallback) {
134 dContext->flush(flushInfoFinishedProc);
142 dContext->flush(
surface.get(), flushInfoFinishedProc);
147 dContext->flush(flushInfoFinishedProc);
176 auto dContext = ctxInfo.directContext();
181 auto mbet = sk_gpu_test::ManagedBackendTexture::MakeFromInfo(
194 sk_gpu_test::ManagedBackendTexture::ReleaseProc,
195 mbet->releaseContext(
nullptr,
nullptr));
210 dContext->flush(flushInfo);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static void async_callback(void *c, std::unique_ptr< const SkImage::AsyncReadResult > result)
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
static void abandon_context(void *context)
static void testing_finished_proc(void *ctx)
static void busy_wait_for_callback(int *count, int expectedValue, GrDirectContext *dContext, skiatest::Reporter *reporter)
@ kTopLeft_GrSurfaceOrigin
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
#define REPORTER_ASSERT(r, cond,...)
void checkAsyncWorkCompletion()
void clear(SkColor color)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static const char * begin(const StringSlice &s)
sk_sp< const SkImage > image
SK_API sk_sp< SkSurface > WrapBackendTexture(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, int sampleCnt, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
GrGpuFinishedContext fFinishedContext
GrGpuFinishedProc fFinishedProc
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)