Add makeBuffer and caps to GrOnFlushResourceProvider
Bug: skia: Change-Id: Ie3101ca20743a953621815bdae886c995d39c9e6 Reviewed-on: https://skia-review.googlesource.com/20315 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
parent
ffa8484eb0
commit
6081ebb689
@ -64,3 +64,14 @@ sk_sp<GrRenderTargetContext> GrOnFlushResourceProvider::makeRenderTargetContext(
|
|||||||
return renderTargetContext;
|
return renderTargetContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sk_sp<GrBuffer> GrOnFlushResourceProvider::makeBuffer(GrBufferType intendedType, size_t size,
|
||||||
|
const void* data) {
|
||||||
|
GrResourceProvider* rp = fDrawingMgr->getContext()->resourceProvider();
|
||||||
|
return sk_sp<GrBuffer>(rp->createBuffer(size, intendedType, kDynamic_GrAccessPattern,
|
||||||
|
GrResourceProvider::kNoPendingIO_Flag,
|
||||||
|
data));
|
||||||
|
}
|
||||||
|
|
||||||
|
const GrCaps* GrOnFlushResourceProvider::caps() const {
|
||||||
|
return fDrawingMgr->getContext()->caps();
|
||||||
|
}
|
||||||
|
@ -68,6 +68,11 @@ public:
|
|||||||
sk_sp<SkColorSpace> colorSpace,
|
sk_sp<SkColorSpace> colorSpace,
|
||||||
const SkSurfaceProps* props);
|
const SkSurfaceProps* props);
|
||||||
|
|
||||||
|
// Creates a GPU buffer with a "dynamic" access pattern.
|
||||||
|
sk_sp<GrBuffer> makeBuffer(GrBufferType, size_t, const void* data = nullptr);
|
||||||
|
|
||||||
|
const GrCaps* caps() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit GrOnFlushResourceProvider(GrDrawingManager* drawingMgr) : fDrawingMgr(drawingMgr) {}
|
explicit GrOnFlushResourceProvider(GrDrawingManager* drawingMgr) : fDrawingMgr(drawingMgr) {}
|
||||||
GrOnFlushResourceProvider(const GrOnFlushResourceProvider&) = delete;
|
GrOnFlushResourceProvider(const GrOnFlushResourceProvider&) = delete;
|
||||||
|
Loading…
Reference in New Issue
Block a user