aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-07-03 16:18:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-03 20:46:27 +0000
commit108bb232775c0b768ce1beca929ed31a97b46ed3 (patch)
treeff882d51dac3e7dfd66ae79a0be0883d6b379c25 /src/gpu/gl
parent58a1605d2b9bab077f53b6a223f9e7ce1891d3ea (diff)
Reland "Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors."
This reverts commit 34aa059c1502d67c9a5f4db449667a8709b69fb9. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors." > > This reverts commit ff2181e62e79ffd2ce628fc8c05b5457d4f54163. > > Reason for revert: suspect it's behind Chrome roll failure > > Original change's description: > > Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors. > > > > Bug: skia: > > Change-Id: I1466668e3502cd1e6e1f6aed4105e0f626d293dd > > Reviewed-on: https://skia-review.googlesource.com/138987 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com > > Change-Id: I4cba44858aafffbadc45e18349b93c741d7cfc66 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/139220 > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Bug: skia: Change-Id: Ib1fd10c126862824f3e31c420c697ac749c637f5 Reviewed-on: https://skia-review.googlesource.com/139221 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp12
-rw-r--r--src/gpu/gl/GrGLUtil.cpp37
-rw-r--r--src/gpu/gl/GrGLUtil.h2
3 files changed, 10 insertions, 41 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index d5c3cc3de2..58aad4d18e 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -3975,7 +3975,11 @@ GrBackendTexture GrGLGpu::createTestingOnlyBackendTexture(const void* pixels, in
// unbind the texture from the texture unit to avoid asserts
GL_CALL(BindTexture(info.fTarget, 0));
- return GrBackendTexture(w, h, mipMapped, info);
+ GrBackendTexture beTex = GrBackendTexture(w, h, mipMapped, info);
+ // Lots of tests don't go through Skia's public interface which will set the config so for
+ // testing we make sure we set a config here.
+ beTex.setPixelConfig(config);
+ return beTex;
}
bool GrGLGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const {
@@ -4069,7 +4073,11 @@ GrBackendRenderTarget GrGLGpu::createTestingOnlyBackendRenderTarget(int w, int h
return {};
}
auto stencilBits = SkToInt(this->glCaps().stencilFormats()[sFormatIdx].fStencilBits);
- return {w, h, 1, stencilBits, config, info};
+ GrBackendRenderTarget beRT = GrBackendRenderTarget(w, h, 1, stencilBits, info);
+ // Lots of tests don't go through Skia's public interface which will set the config so for
+ // testing we make sure we set a config here.
+ beRT.setPixelConfig(config);
+ return beRT;
}
void GrGLGpu::deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget& backendRT) {
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index e785c1e2f6..3732b481a9 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -532,40 +532,3 @@ GrGLenum GrToGLStencilFunc(GrStencilTest test) {
return gTable[(int)test];
}
-GrPixelConfig GrGLSizedFormatToPixelConfig(GrGLenum sizedFormat) {
- switch (sizedFormat) {
- case GR_GL_R8:
- return kAlpha_8_as_Red_GrPixelConfig;
- case GR_GL_ALPHA8:
- return kAlpha_8_as_Alpha_GrPixelConfig;
- case GR_GL_RGBA8:
- return kRGBA_8888_GrPixelConfig;
- case GR_GL_RGB8:
- return kRGB_888_GrPixelConfig;
- case GR_GL_BGRA8:
- return kBGRA_8888_GrPixelConfig;
- case GR_GL_SRGB8_ALPHA8:
- return kSRGBA_8888_GrPixelConfig;
- case GR_GL_RGB565:
- return kRGB_565_GrPixelConfig;
- case GR_GL_RGB5:
- return kRGB_565_GrPixelConfig;
- case GR_GL_RGBA4:
- return kRGBA_4444_GrPixelConfig;
- case GR_GL_RGB10_A2:
- return kRGBA_1010102_GrPixelConfig;
- case GR_GL_LUMINANCE8:
- return kGray_8_GrPixelConfig;
- case GR_GL_RGBA32F:
- return kRGBA_float_GrPixelConfig;
- case GR_GL_RG32F:
- return kRG_float_GrPixelConfig;
- case GR_GL_R16F:
- return kAlpha_half_as_Red_GrPixelConfig;
- case GR_GL_RGBA16F:
- return kRGBA_half_GrPixelConfig;
- default:
- return kUnknown_GrPixelConfig;
- }
-}
-
diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h
index 039c1eea78..909c8fd7d5 100644
--- a/src/gpu/gl/GrGLUtil.h
+++ b/src/gpu/gl/GrGLUtil.h
@@ -256,6 +256,4 @@ void GrGLClearErr(const GrGLInterface* gl);
GrGLenum GrToGLStencilFunc(GrStencilTest test);
-GrPixelConfig GrGLSizedFormatToPixelConfig(GrGLenum sizedFormat);
-
#endif