Clean up some GrContext uses in the GMs
This is part of the effort to replace GrContext with the GrDirectContext/GrRecordingContext pair.
It also tries out, a bit, the context naming proposal (i.e., rContext and dContext).
Change-Id: Ib4d9881f820a7f8a8c525eba7448b1015526400c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303627
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/tools/gpu/YUVUtils.cpp b/tools/gpu/YUVUtils.cpp
index 4b57f4c..bae564d 100644
--- a/tools/gpu/YUVUtils.cpp
+++ b/tools/gpu/YUVUtils.cpp
@@ -8,7 +8,7 @@
#include "tools/gpu/YUVUtils.h"
#include "include/core/SkData.h"
-#include "include/gpu/GrContext.h"
+#include "include/gpu/GrDirectContext.h"
#include "src/codec/SkCodecImageGenerator.h"
#include "src/gpu/GrContextPriv.h"
@@ -86,7 +86,8 @@
}
///////////////////////////////////////////////////////////////////////////////////////////////////
-void YUVABackendReleaseContext::Unwind(GrContext* context, YUVABackendReleaseContext* beContext,
+void YUVABackendReleaseContext::Unwind(GrDirectContext* dContext,
+ YUVABackendReleaseContext* beContext,
bool fullFlush) {
// Some backends (e.g., Vulkan) require that all work associated w/ texture
@@ -94,29 +95,28 @@
if (fullFlush) {
// If the release context client performed some operations other than backend texture
// creation then we may require a full flush to ensure that all the work is completed.
- context->flush();
- context->submit(true);
+ dContext->flush();
+ dContext->submit(true);
} else {
- context->submit();
+ dContext->submit();
while (!beContext->creationCompleted()) {
- context->checkAsyncWorkCompletion();
+ dContext->checkAsyncWorkCompletion();
}
}
delete beContext;
}
-YUVABackendReleaseContext::YUVABackendReleaseContext(GrContext* context) : fContext(context) {
- SkASSERT(context->priv().getGpu());
- SkASSERT(context->asDirectContext());
+YUVABackendReleaseContext::YUVABackendReleaseContext(GrDirectContext* dContext)
+ : fDContext(dContext) {
}
YUVABackendReleaseContext::~YUVABackendReleaseContext() {
for (int i = 0; i < 4; ++i) {
if (fBETextures[i].isValid()) {
SkASSERT(fCreationComplete[i]);
- fContext->deleteBackendTexture(fBETextures[i]);
+ fDContext->deleteBackendTexture(fBETextures[i]);
}
}
}