Remove GrRenderTargetContextPriv and GrSurfaceContextPriv
I think this is vestigial from some time in the past where RTC was
public.
Also just expose the methods that add ops rather than have so many
friends + testingOnly versions.
Change-Id: I60d9fdff23b2d67039a7b37815da7ff9e73d8999
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339158
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp
index f449f41..fbc04bf 100644
--- a/tools/gpu/GrTest.cpp
+++ b/tools/gpu/GrTest.cpp
@@ -20,11 +20,9 @@
#include "src/gpu/GrMemoryPool.h"
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrRenderTargetContext.h"
-#include "src/gpu/GrRenderTargetContextPriv.h"
#include "src/gpu/GrRenderTargetProxy.h"
#include "src/gpu/GrResourceCache.h"
#include "src/gpu/GrSemaphore.h"
-#include "src/gpu/GrSurfaceContextPriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/SkGr.h"
#include "src/gpu/ccpr/GrCCPathCache.h"
@@ -52,34 +50,6 @@
}
#endif
-///////////////////////////////////////////////////////////////////////////////
-
-#define ASSERT_SINGLE_OWNER GR_ASSERT_SINGLE_OWNER(fRenderTargetContext->singleOwner())
-
-uint32_t GrRenderTargetContextPriv::testingOnly_getOpsTaskID() {
- return fRenderTargetContext->getOpsTask()->uniqueID();
-}
-
-void GrRenderTargetContextPriv::testingOnly_addDrawOp(GrOp::Owner op) {
- this->testingOnly_addDrawOp(nullptr, std::move(op), {});
-}
-
-void GrRenderTargetContextPriv::testingOnly_addDrawOp(
- const GrClip* clip,
- GrOp::Owner op,
- const std::function<GrRenderTargetContext::WillAddOpFn>& willAddFn) {
- ASSERT_SINGLE_OWNER
- if (fRenderTargetContext->fContext->abandoned()) {
- return;
- }
- SkDEBUGCODE(fRenderTargetContext->validate());
- GR_AUDIT_TRAIL_AUTO_FRAME(fRenderTargetContext->auditTrail(),
- "GrRenderTargetContext::testingOnly_addDrawOp");
- fRenderTargetContext->addDrawOp(clip, std::move(op), willAddFn);
-}
-
-#undef ASSERT_SINGLE_OWNER
-
//////////////////////////////////////////////////////////////////////////////
void GrCoverageCountingPathRenderer::testingOnly_drawPathDirectly(const DrawPathArgs& args) {
@@ -168,7 +138,7 @@
DRAW_OP_TEST_EXTERN(TextureOp);
void GrDrawRandomOp(SkRandom* random, GrRenderTargetContext* renderTargetContext, GrPaint&& paint) {
- auto context = renderTargetContext->surfPriv().getContext();
+ auto context = renderTargetContext->recordingContext();
using MakeDrawOpFn = GrOp::Owner (GrPaint&&, SkRandom*,
GrRecordingContext*, int numSamples);
static constexpr MakeDrawOpFn* gFactories[] = {
@@ -203,6 +173,6 @@
// Creating a GrAtlasTextOp my not produce an op if for example, it is totally outside the
// render target context.
if (op) {
- renderTargetContext->priv().testingOnly_addDrawOp(std::move(op));
+ renderTargetContext->addDrawOp(std::move(op));
}
}