blob: 9c26f5a3e0ddb738c239a47a9fd187d6dad0b0cb [file] [log] [blame]
/*
* Copyright 2022 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "src/gpu/graphite/RecorderPriv.h"
#include "src/gpu/graphite/Device.h"
#include "src/gpu/graphite/Gpu.h"
#include "src/gpu/graphite/TaskGraph.h"
namespace skgpu::graphite {
#define ASSERT_SINGLE_OWNER SKGPU_ASSERT_SINGLE_OWNER(fRecorder->singleOwner())
ResourceProvider* RecorderPriv::resourceProvider() const {
return fRecorder->fResourceProvider.get();
}
UniformDataCache* RecorderPriv::uniformDataCache() const {
return fRecorder->fUniformDataCache.get();
}
TextureDataCache* RecorderPriv::textureDataCache() const {
return fRecorder->fTextureDataCache.get();
}
const Caps* RecorderPriv::caps() const {
return fRecorder->fGpu->caps();
}
DrawBufferManager* RecorderPriv::drawBufferManager() const {
return fRecorder->fDrawBufferManager.get();
}
UploadBufferManager* RecorderPriv::uploadBufferManager() const {
return fRecorder->fUploadBufferManager.get();
}
void RecorderPriv::add(sk_sp<Task> task) {
ASSERT_SINGLE_OWNER
fRecorder->fGraph->add(std::move(task));
}
void RecorderPriv::flushTrackedDevices() {
ASSERT_SINGLE_OWNER
for (Device* device : fRecorder->fTrackedDevices) {
device->flushPendingWorkToRecorder();
}
}
} // namespace skgpu::graphite