/** True in environments that will issue errors if memory uploaded to buffers
is not initialized (even if not read by draw calls). */
bool mustClearUploadedBufferData() const { return fMustClearUploadedBufferData; }
+ /** True when there is a performance cost to using an atlas that has not been cleared. */
+ bool mustClearAtlases() const { return fMustClearAtlases; }
bool wireframeMode() const { return fWireframeMode; }
bool fPreferClientSideDynamicBuffers : 1;
bool fFullClearIsFree : 1;
bool fMustClearUploadedBufferData : 1;
+ bool fMustClearAtlases : 1;
// Driver workaround
bool fUseDrawInsteadOfClear : 1;
fPreferClientSideDynamicBuffers = false;
fFullClearIsFree = false;
fMustClearUploadedBufferData = false;
+ fMustClearAtlases = false;
fSampleShadingSupport = false;
fFenceSyncSupport = false;
fCrossContextTextureSupport = false;
desc.fHeight = height;
desc.fConfig = config;
+ if (ctx->caps()->mustClearAtlases()) {
+ desc.fFlags |= kPerformInitialClear_GrSurfaceFlag;
+ }
+
// We don't want to flush the context so we claim we're in the middle of flushing so as to
// guarantee we do not recieve a texture with pending IO
// TODO: Determine how to avoid having to do this. (https://bug.skia.org/4156)
if (kChromium_GrGLDriver == ctxInfo.driver()) {
fMustClearUploadedBufferData = true;
+ fMustClearAtlases = true;
}
if (kGL_GrGLStandard == standard) {