aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrTypes.h5
-rw-r--r--src/gpu/GrTexture.cpp2
-rw-r--r--src/gpu/gl/GrGLGpu.cpp29
-rw-r--r--src/gpu/vk/GrVkGpu.cpp2
4 files changed, 11 insertions, 27 deletions
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 654febd3ca..f52af3a089 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 ea0ed76517..6609fa61e3 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 5a8809bf06..842e22980b 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -604,7 +604,7 @@ sk_sp<GrRenderTarget> 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 48e2e694fe..e6a69b727d 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -881,7 +881,7 @@ sk_sp<GrRenderTarget> 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;