[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:
parent
672a540b00
commit
b21c4af0f6
@ -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.");
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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>);
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user