[graphite] Remove ref counting from Recorder.

Bug: skia:12794
Change-Id: Iefdc2d84991a542533d13c227051c372459564db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494241
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2022-01-13 09:51:23 -05:00 committed by SkCQ
parent 672a540b00
commit b21c4af0f6
7 changed files with 9 additions and 9 deletions

View File

@ -2164,7 +2164,7 @@ Result GraphiteSink::draw(const Src& src,
precompile(context.get());
}
sk_sp<skgpu::Recorder> recorder = context->createRecorder();
std::unique_ptr<skgpu::Recorder> recorder = context->makeRecorder();
if (!recorder) {
return Result::Fatal("Could not create a recorder.");
}

View File

@ -63,7 +63,7 @@ public:
BackendApi backend() const { return fBackend; }
sk_sp<Recorder> createRecorder();
std::unique_ptr<Recorder> makeRecorder();
void insertRecording(std::unique_ptr<Recording>);
void submit(SyncToCpu = SyncToCpu::kNo);

View File

@ -19,9 +19,9 @@ class DrawBufferManager;
class Recording;
class UniformCache;
class Recorder final : public SkRefCnt {
class Recorder final {
public:
~Recorder() override;
~Recorder();
void add(sk_sp<Task>);

View File

@ -45,8 +45,8 @@ sk_sp<Context> Context::MakeMetal(const mtl::BackendContext& backendContext) {
}
#endif
sk_sp<Recorder> Context::createRecorder() {
return sk_sp<Recorder>(new Recorder(sk_ref_sp(this)));
std::unique_ptr<Recorder> Context::makeRecorder() {
return std::unique_ptr<Recorder>(new Recorder(sk_ref_sp(this)));
}
void Context::insertRecording(std::unique_ptr<Recording> recording) {

View File

@ -73,7 +73,7 @@ DEF_GRAPHITE_TEST_FOR_CONTEXTS(SurfaceBackendTextureTest, reporter, context) {
// formats, color types, etc.
auto caps = context->priv().gpu()->caps();
sk_sp<Recorder> recorder = context->createRecorder();
std::unique_ptr<Recorder> recorder = context->makeRecorder();
TextureInfo info = caps->getDefaultSampledTextureInfo(kRGBA_8888_SkColorType,
/*levelCount=*/1,

View File

@ -15,7 +15,7 @@ using namespace skgpu;
// Tests to make sure the managing of back pointers between Recorder and Device all work properly.
DEF_GRAPHITE_TEST_FOR_CONTEXTS(RecorderDevicePtrTest, reporter, context) {
sk_sp<Recorder> recorder = context->createRecorder();
std::unique_ptr<Recorder> recorder = context->makeRecorder();
SkImageInfo info = SkImageInfo::Make({16, 16}, kRGBA_8888_SkColorType, kPremul_SkAlphaType);

View File

@ -41,7 +41,7 @@ sk_sp<UniformData> make_ud(int numUniforms, int dataSize) {
} // anonymous namespace
DEF_GRAPHITE_TEST_FOR_CONTEXTS(UniformCacheTest, reporter, context) {
sk_sp<Recorder> recorder = context->createRecorder();
std::unique_ptr<Recorder> recorder = context->makeRecorder();
auto cache = recorder->uniformCache();