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());
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.
*
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 {
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;
}
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;
}
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 {
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;
}
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;
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;
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