Double down on abandoned being publicly accessible on contexts
abandoned() is publicly accessible on GrContext. Since
GrRecordingContext is taking its place in many locations, make its
abandoned() call also publicly accessible.
This CL also removes abandoned() from GrContextPriv since it is
publicly accessible.
Change-Id: I72bdae369d06e34ec3f99a18a0feb72e2ae67666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299876
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index 655eab4..c9dc239 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -27,7 +27,7 @@
#include "src/gpu/effects/generated/GrColorMatrixFragmentProcessor.h"
#define ASSERT_SINGLE_OWNER GR_ASSERT_SINGLE_OWNER(this->singleOwner())
-#define RETURN_FALSE_IF_ABANDONED if (this->fContext->priv().abandoned()) { return false; }
+#define RETURN_FALSE_IF_ABANDONED if (this->fContext->abandoned()) { return false; }
std::unique_ptr<GrSurfaceContext> GrSurfaceContext::Make(GrRecordingContext* context,
GrSurfaceProxyView readView,
@@ -38,7 +38,7 @@
// GrSurfaceContext which need the context will mostly likely fail later on without an issue.
// However having this hear adds some reassurance in case there is a path doesn't handle an
// abandoned context correctly. It also lets us early out of some extra work.
- if (context->priv().abandoned()) {
+ if (context->abandoned()) {
return nullptr;
}
GrSurfaceProxy* proxy = readView.proxy();
@@ -108,7 +108,7 @@
: fContext(context)
, fReadView(std::move(readView))
, fColorInfo(colorType, alphaType, std::move(colorSpace)) {
- SkASSERT(!context->priv().abandoned());
+ SkASSERT(!context->abandoned());
}
const GrCaps* GrSurfaceContext::caps() const { return fContext->priv().caps(); }
@@ -1151,7 +1151,7 @@
const GrFlushInfo& info,
const GrBackendSurfaceMutableState* newState) {
ASSERT_SINGLE_OWNER
- if (fContext->priv().abandoned()) {
+ if (fContext->abandoned()) {
if (info.fSubmittedProc) {
info.fSubmittedProc(info.fSubmittedContext, false);
}