aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-24 10:07:30 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-24 16:04:45 +0000
commit8785df15fe5a57651597d138d3c5aea0ffe3f661 (patch)
tree0770ceaa9b46105235a19ab3dfa2d608cce3d6eb /src
parent5458cf8ec62c548480d5bb142afa71e4269ddac9 (diff)
Clear atlas textures at creation in Chrome
Bug: chromium:656320 Change-Id: Ia65274aa733f199be188579821e745920493aefc Reviewed-on: https://skia-review.googlesource.com/17824 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrCaps.cpp1
-rw-r--r--src/gpu/GrDrawOpAtlas.cpp4
-rw-r--r--src/gpu/gl/GrGLCaps.cpp1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index 5c04d190c5..e12af689c3 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -47,6 +47,7 @@ GrCaps::GrCaps(const GrContextOptions& options) {
fPreferClientSideDynamicBuffers = false;
fFullClearIsFree = false;
fMustClearUploadedBufferData = false;
+ fMustClearAtlases = false;
fSampleShadingSupport = false;
fFenceSyncSupport = false;
fCrossContextTextureSupport = false;
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index be8258ab51..235bc87a00 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -24,6 +24,10 @@ std::unique_ptr<GrDrawOpAtlas> GrDrawOpAtlas::Make(GrContext* ctx, GrPixelConfig
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)
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 8c4330312d..9fb8db42e5 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -495,6 +495,7 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
if (kChromium_GrGLDriver == ctxInfo.driver()) {
fMustClearUploadedBufferData = true;
+ fMustClearAtlases = true;
}
if (kGL_GrGLStandard == standard) {