aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLRenderTarget.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-03-13 16:44:48 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-14 14:12:42 +0000
commit7d2b16ad13fd3262c776ae75ae35da4ad69df690 (patch)
tree768403578659fe038f155a8a78bd0244faa3b51a /src/gpu/gl/GrGLRenderTarget.cpp
parentb78dd5d01eb16ae3cb9104ce8c0fa7e861431259 (diff)
Improve handling of GrPixelConfig in GrBackendTex/RT ctors
Make sure that no client facing code was relying on what we set as the default value for fConfig by making in kUnkown. Bug: skia: Change-Id: Ie52ff08ba8deeacc16fe06eb0dd0c7292b2edf91 Reviewed-on: https://skia-review.googlesource.com/114261 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLRenderTarget.cpp')
-rw-r--r--src/gpu/gl/GrGLRenderTarget.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index de7399bd92..73c5fdf4b3 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -91,8 +91,16 @@ GrBackendRenderTarget GrGLRenderTarget::getBackendRenderTarget() const {
numStencilBits = stencil->bits();
}
- return GrBackendRenderTarget(this->width(), this->height(), this->numColorSamples(),
- numStencilBits, fbi);
+ GrBackendRenderTarget beRT = GrBackendRenderTarget(this->width(), this->height(),
+ this->numColorSamples(), numStencilBits,
+ fbi);
+#if GR_TEST_UTILS
+ // We shouldn't have to set this since the client can't access it and we will handle the config
+ // correctly if we go through our public SkSurface APIs. However, some of our tests bypass the
+ // public APIs so we need to set this manually here.
+ beRT.setPixelConfig(this->config());
+#endif
+ return beRT;
}
size_t GrGLRenderTarget::onGpuMemorySize() const {