Update Dawn backend to accommodate recent Skia API changes.

Change-Id: Ib0667fbff9a16fe796378134a17008ece6267d06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240508
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2019-09-10 12:35:02 -04:00 committed by Skia Commit-Bot
parent 78be3ebee7
commit 2adbf9ce1c
4 changed files with 16 additions and 6 deletions

View File

@ -119,7 +119,8 @@ void GrDawnGpu::disconnect(DisconnectType type) {
GrOpsRenderPass* GrDawnGpu::getOpsRenderPass(
GrRenderTarget* rt, GrSurfaceOrigin origin, const SkRect& bounds,
const GrOpsRenderPass::LoadAndStoreInfo& colorInfo,
const GrOpsRenderPass::StencilLoadAndStoreInfo& stencilInfo) {
const GrOpsRenderPass::StencilLoadAndStoreInfo& stencilInfo,
const SkTArray<GrTextureProxy*, true>& sampledProxies) {
fOpsRenderPass.reset(new GrDawnOpsRenderPass(this, rt, origin, colorInfo, stencilInfo));
return fOpsRenderPass.get();
}
@ -136,8 +137,9 @@ sk_sp<GrGpuBuffer> GrDawnGpu::onCreateBuffer(size_t size, GrGpuBufferType type,
////////////////////////////////////////////////////////////////////////////////
bool GrDawnGpu::onWritePixels(GrSurface* surface, int left, int top, int width, int height,
GrColorType textureColorType, GrColorType bufferColorType,
const GrMipLevel texels[], int mipLevelCount) {
GrColorType surfaceColorType, GrColorType srcColorType,
const GrMipLevel texels[], int mipLevelCount,
bool prepForTexSampling) {
GrDawnTexture* texture = static_cast<GrDawnTexture*>(surface->asTexture());
if (!texture) {
SkASSERT(!"uploading to non-texture unimplemented");

View File

@ -62,7 +62,8 @@ public:
GrOpsRenderPass* getOpsRenderPass(
GrRenderTarget*, GrSurfaceOrigin, const SkRect& bounds,
const GrOpsRenderPass::LoadAndStoreInfo&,
const GrOpsRenderPass::StencilLoadAndStoreInfo&) override;
const GrOpsRenderPass::StencilLoadAndStoreInfo&,
const SkTArray<GrTextureProxy*, true>& sampledProxies) override;
SkSL::Compiler* shaderCompiler() const {
return fCompiler.get();
@ -134,8 +135,9 @@ private:
size_t rowBytes) override;
bool onWritePixels(GrSurface* surface, int left, int top, int width, int height,
GrColorType surfaceColorType, GrColorType dstColorType,
const GrMipLevel texels[], int mipLevelCount) override;
GrColorType surfaceColorType, GrColorType srcColorType,
const GrMipLevel texels[], int mipLevelCount,
bool prepForTexSampling) override;
bool onTransferPixelsTo(GrTexture*, int left, int top, int width, int height,
GrColorType textureColorType, GrColorType bufferColorType,

View File

@ -233,6 +233,10 @@ GrGLSLUniformHandler::UniformHandle GrDawnUniformHandler::internalAddUniformArra
return GrGLSLUniformHandler::UniformHandle(fUniforms.count() - 1);
}
void GrDawnUniformHandler::updateUniformVisibility(UniformHandle u, uint32_t visibility) {
fUniforms[u.toIndex()].fVisibility |= visibility;
}
GrGLSLUniformHandler::SamplerHandle GrDawnUniformHandler::addSampler(const GrTexture* texture,
const GrSamplerState&,
const GrSwizzle& swizzle,

View File

@ -47,6 +47,8 @@ private:
int arrayCount,
const char** outName) override;
void updateUniformVisibility(UniformHandle u, uint32_t visibility) override;
UniformInfoArray fUniforms;
UniformInfoArray fSamplers;
UniformInfoArray fTextures;