From: Brian Salomon Date: Mon, 15 May 2017 17:48:50 +0000 (-0400) Subject: Remove kCheckAllocation_GrSurfaceFlags. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~36^2~233 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ec981ba493e4a1f8d7aad513f3ae9e1f2c14711;p=platform%2Fupstream%2FlibSkiaSharp.git Remove kCheckAllocation_GrSurfaceFlags. This flags was only specified in one place (per backend). However, it was specified when no allocations occur. Change-Id: Ic892d3064598519a07fb6773ba626fe022ef2f78 Reviewed-on: https://skia-review.googlesource.com/16904 Reviewed-by: Greg Daniel Commit-Queue: Brian Salomon --- diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h index 654febd..f52af3a 100644 --- a/include/gpu/GrTypes.h +++ b/include/gpu/GrTypes.h @@ -589,11 +589,6 @@ enum GrSurfaceFlags { * Placeholder for managing zero-copy textures */ kZeroCopy_GrSurfaceFlag = 0x2, - /** - * Indicates that all allocations (color buffer, FBO completeness, etc) - * should be verified. - */ - kCheckAllocation_GrSurfaceFlag = 0x4, }; GR_MAKE_BITFIELD_OPS(GrSurfaceFlags) diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp index ea0ed76..6609fa6 100644 --- a/src/gpu/GrTexture.cpp +++ b/src/gpu/GrTexture.cpp @@ -95,7 +95,7 @@ void GrTexturePriv::ComputeScratchKey(const GrSurfaceDesc& desc, GrScratchKey* k static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType(); GrSurfaceOrigin origin = resolve_origin(desc); - uint32_t flags = desc.fFlags & ~kCheckAllocation_GrSurfaceFlag; + uint32_t flags = desc.fFlags; // make sure desc.fConfig fits in 5 bits SkASSERT(sk_float_log2(kLast_GrPixelConfig) <= 5); diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 5a8809b..842e229 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -604,7 +604,7 @@ sk_sp GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTa GrSurfaceDesc desc; desc.fConfig = backendRT.config(); - desc.fFlags = kCheckAllocation_GrSurfaceFlag | kRenderTarget_GrSurfaceFlag; + desc.fFlags = kRenderTarget_GrSurfaceFlag; desc.fWidth = backendRT.width(); desc.fHeight = backendRT.height(); desc.fSampleCnt = SkTMin(backendRT.sampleCnt(), this->caps()->maxSampleCount()); @@ -841,15 +841,6 @@ static inline GrGLint config_alignment(GrPixelConfig config) { return 0; } -static inline GrGLenum check_alloc_error(const GrSurfaceDesc& desc, - const GrGLInterface* interface) { - if (SkToBool(desc.fFlags & kCheckAllocation_GrSurfaceFlag)) { - return GR_GL_GET_ERROR(interface); - } else { - return CHECK_ALLOC_ERROR(interface); - } -} - /** * Creates storage space for the texture and fills it with texels. * @@ -893,7 +884,7 @@ static bool allocate_and_populate_uncompressed_texture(const GrSurfaceDesc& desc SkTMax(texels.count(), 1), internalFormatForTexStorage, desc.fWidth, desc.fHeight)); - GrGLenum error = check_alloc_error(desc, &interface); + GrGLenum error = CHECK_ALLOC_ERROR(&interface); if (error != GR_GL_NO_ERROR) { return false; } else { @@ -929,7 +920,7 @@ static bool allocate_and_populate_uncompressed_texture(const GrSurfaceDesc& desc 0, // border externalFormat, externalType, nullptr)); - GrGLenum error = check_alloc_error(desc, &interface); + GrGLenum error = CHECK_ALLOC_ERROR(&interface); if (error != GR_GL_NO_ERROR) { return false; } @@ -950,7 +941,7 @@ static bool allocate_and_populate_uncompressed_texture(const GrSurfaceDesc& desc 0, // border externalFormat, externalType, currentMipData)); - GrGLenum error = check_alloc_error(desc, &interface); + GrGLenum error = CHECK_ALLOC_ERROR(&interface); if (error != GR_GL_NO_ERROR) { return false; } @@ -992,7 +983,7 @@ static bool allocate_and_populate_compressed_texture(const GrSurfaceDesc& desc, texels.count(), internalFormat, baseWidth, baseHeight)); - GrGLenum error = check_alloc_error(desc, &interface); + GrGLenum error = CHECK_ALLOC_ERROR(&interface); if (error != GR_GL_NO_ERROR) { return false; } else { @@ -1041,7 +1032,7 @@ static bool allocate_and_populate_compressed_texture(const GrSurfaceDesc& desc, SkToInt(dataSize), texels[currentMipLevel].fPixels)); - GrGLenum error = check_alloc_error(desc, &interface); + GrGLenum error = CHECK_ALLOC_ERROR(&interface); if (error != GR_GL_NO_ERROR) { return false; } @@ -1435,8 +1426,7 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, GR_GL_COLOR_ATTACHMENT0, GR_GL_RENDERBUFFER, idDesc->fMSColorRenderbufferID)); - if ((desc.fFlags & kCheckAllocation_GrSurfaceFlag) || - !this->glCaps().isConfigVerifiedColorAttachment(desc.fConfig)) { + if (!this->glCaps().isConfigVerifiedColorAttachment(desc.fConfig)) { GL_CALL_RET(status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); if (status != GR_GL_FRAMEBUFFER_COMPLETE) { goto FAILED; @@ -1458,8 +1448,7 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, texInfo.fTarget, texInfo.fID, 0)); } - if ((desc.fFlags & kCheckAllocation_GrSurfaceFlag) || - !this->glCaps().isConfigVerifiedColorAttachment(desc.fConfig)) { + if (!this->glCaps().isConfigVerifiedColorAttachment(desc.fConfig)) { GL_CALL_RET(status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); if (status != GR_GL_FRAMEBUFFER_COMPLETE) { goto FAILED; @@ -1816,7 +1805,7 @@ GrStencilAttachment* GrGLGpu::createStencilAttachmentForRenderTarget(const GrRen GL_ALLOC_CALL(this->glInterface(), RenderbufferStorage(GR_GL_RENDERBUFFER, sFmt.fInternalFormat, width, height)); - SkASSERT(GR_GL_NO_ERROR == check_alloc_error(rt->desc(), this->glInterface())); + SkASSERT(GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(this->glInterface())); } fStats.incStencilAttachmentCreates(); // After sized formats we attempt an unsized format and take diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 48e2e69..e6a69b7 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -881,7 +881,7 @@ sk_sp GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTa GrSurfaceDesc desc; desc.fConfig = backendRT.config(); - desc.fFlags = kCheckAllocation_GrSurfaceFlag | kRenderTarget_GrSurfaceFlag; + desc.fFlags = kRenderTarget_GrSurfaceFlag; desc.fWidth = backendRT.width(); desc.fHeight = backendRT.height(); desc.fSampleCnt = 0;