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:
parent
f2fb26d162
commit
2045b981fb
18
experimental/graphite/src/Pipeline.cpp
Normal file
18
experimental/graphite/src/Pipeline.cpp
Normal 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
|
26
experimental/graphite/src/Pipeline.h
Normal file
26
experimental/graphite/src/Pipeline.h
Normal 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
|
18
experimental/graphite/src/PipelineDesc.cpp
Normal file
18
experimental/graphite/src/PipelineDesc.cpp
Normal 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
|
23
experimental/graphite/src/PipelineDesc.h
Normal file
23
experimental/graphite/src/PipelineDesc.h
Normal 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
|
@ -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
|
||||
|
@ -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:
|
||||
};
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user