Graphite: Add stubs for Pipeline and PipelineDesc

Bug: skia:12466
Change-Id: Ie949a17166b3ab5c529b74a6762c8a6f8ca8052f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453061
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Jim Van Verth 2021-09-27 15:59:26 -04:00 committed by SkCQ
parent f2fb26d162
commit 2045b981fb
7 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,18 @@
/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "experimental/graphite/src/Pipeline.h"
namespace skgpu {
Pipeline::Pipeline() {
}
Pipeline::~Pipeline() {
}
} // namespace skgpu

View File

@ -0,0 +1,26 @@
/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef skgpu_Pipeline_DEFINED
#define skgpu_Pipeline_DEFINED
namespace skgpu {
// TODO: derive this from something like GrManagedResource
class Pipeline {
public:
~Pipeline();
protected:
Pipeline();
private:
};
} // namespace skgpu
#endif // skgpu_Pipeline_DEFINED

View File

@ -0,0 +1,18 @@
/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "experimental/graphite/src/PipelineDesc.h"
namespace skgpu {
PipelineDesc::PipelineDesc() {
}
PipelineDesc::~PipelineDesc() {
}
} // namespace skgpu

View File

@ -0,0 +1,23 @@
/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef skgpu_PipelineDesc_DEFINED
#define skgpu_PipelineDesc_DEFINED
namespace skgpu {
class PipelineDesc {
public:
PipelineDesc();
~PipelineDesc();
private:
};
} // namespace skgpu
#endif // skgpu_PipelineDesc_DEFINED

View File

@ -8,6 +8,7 @@
#include "experimental/graphite/src/ResourceProvider.h"
#include "experimental/graphite/src/CommandBuffer.h"
#include "experimental/graphite/src/Pipeline.h"
namespace skgpu {
@ -23,4 +24,14 @@ std::unique_ptr<CommandBuffer> ResourceProvider::createCommandBuffer() {
return cb;
}
Pipeline* ResourceProvider::findOrCreatePipeline(const PipelineDesc& desc) {
// TODO: look through cache for matching pipeline
auto pso = this->onCreatePipeline();
// TODO: cache new pipeline
return pso;
}
} // namespace skgpu

View File

@ -13,17 +13,21 @@
namespace skgpu {
class CommandBuffer;
class Pipeline;
class PipelineDesc;
class ResourceProvider {
public:
virtual ~ResourceProvider();
std::unique_ptr<CommandBuffer> createCommandBuffer();
Pipeline* findOrCreatePipeline(const PipelineDesc&);
protected:
ResourceProvider();
virtual std::unique_ptr<CommandBuffer> onCreateCommandBuffer() { return nullptr; }
virtual Pipeline* onCreatePipeline() { return nullptr; }
private:
};

View File

@ -25,6 +25,10 @@ skia_graphite_sources = [
"$_src/Gpu.h",
"$_src/Image_Graphite.cpp",
"$_src/Image_Graphite.h",
"$_src/Pipeline.cpp",
"$_src/Pipeline.h",
"$_src/PipelineDesc.cpp",
"$_src/PipelineDesc.h",
"$_src/RenderPassTask.cpp",
"$_src/RenderPassTask.h",
"$_src/ResourceProvider.cpp",