Implement initCopySurfaceDstDesc for Vulkan

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1880613002

Review URL: https://codereview.chromium.org/1880613002
This commit is contained in:
egdaniel 2016-04-12 07:31:49 -07:00 committed by Commit bot
parent a9322c2d86
commit 37798fbd82
2 changed files with 15 additions and 3 deletions

View File

@ -1304,6 +1304,20 @@ bool GrVkGpu::onCopySurface(GrSurface* dst,
return false;
}
bool GrVkGpu::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const {
// Currently we don't support msaa
if (src->asRenderTarget() && src->asRenderTarget()->numColorSamples() > 1) {
return false;
}
// This will support copying the dst as CopyImage since all of our surfaces require transferSrc
// and transferDst usage flags in Vulkan.
desc->fOrigin = src->origin();
desc->fConfig = src->config();
desc->fFlags = kNone_GrSurfaceFlags;
return true;
}
void GrVkGpu::onGetMultisampleSpecs(GrRenderTarget* rt, const GrStencilSettings&,
int* effectiveSampleCnt, SkAutoTDeleteArray<SkPoint>*) {
// TODO: stub.

View File

@ -75,9 +75,7 @@ public:
int* effectiveSampleCnt,
SkAutoTDeleteArray<SkPoint>*);
bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const override {
return false;
}
bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const override;
void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {}