aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBackendSurface.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2018-07-03 16:38:32 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-03 16:38:45 +0000
commit34aa059c1502d67c9a5f4db449667a8709b69fb9 (patch)
tree0fc7a5e33d505ae119b56cc58b4fd55f96654073 /src/gpu/GrBackendSurface.cpp
parentb6307340e8a6a9d3a7517def7f5eaaadffd07d14 (diff)
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>
Diffstat (limited to 'src/gpu/GrBackendSurface.cpp')
-rw-r--r--src/gpu/GrBackendSurface.cpp48
1 files changed, 44 insertions, 4 deletions
diff --git a/src/gpu/GrBackendSurface.cpp b/src/gpu/GrBackendSurface.cpp
index 7e10cb20a2..9977555093 100644
--- a/src/gpu/GrBackendSurface.cpp
+++ b/src/gpu/GrBackendSurface.cpp
@@ -96,7 +96,7 @@ GrBackendTexture::GrBackendTexture(int width,
: fIsValid(true)
, fWidth(width)
, fHeight(height)
- , fConfig(kUnknown_GrPixelConfig)
+ , fConfig(GrVkFormatToPixelConfig(vkInfo.fFormat))
, fMipMapped(GrMipMapped(vkInfo.fLevelCount > 1))
, fBackend(kVulkan_GrBackend)
, fVkInfo(vkInfo, layout.release()) {
@@ -117,6 +117,28 @@ GrBackendTexture::GrBackendTexture(int width,
, fMtlInfo(mtlInfo) {}
#endif
+#if GR_TEST_UTILS
+
+GrBackendTexture::GrBackendTexture(int width,
+ int height,
+ GrPixelConfig config,
+ const GrGLTextureInfo& glInfo)
+ : GrBackendTexture(width, height, config, GrMipMapped::kNo, glInfo) {}
+
+GrBackendTexture::GrBackendTexture(int width,
+ int height,
+ GrPixelConfig config,
+ GrMipMapped mipMapped,
+ const GrGLTextureInfo& glInfo)
+ : fIsValid(true)
+ , fWidth(width)
+ , fHeight(height)
+ , fConfig(config)
+ , fMipMapped(mipMapped)
+ , fBackend(kOpenGL_GrBackend)
+ , fGLInfo(glInfo) {}
+#endif
+
GrBackendTexture::GrBackendTexture(int width,
int height,
GrMipMapped mipMapped,
@@ -124,7 +146,7 @@ GrBackendTexture::GrBackendTexture(int width,
: fIsValid(true)
, fWidth(width)
, fHeight(height)
- , fConfig(kUnknown_GrPixelConfig)
+ , fConfig(GrGLSizedFormatToPixelConfig(glInfo.fFormat))
, fMipMapped(mipMapped)
, fBackend(kOpenGL_GrBackend)
, fGLInfo(glInfo) {}
@@ -312,7 +334,7 @@ GrBackendRenderTarget::GrBackendRenderTarget(int width,
, fHeight(height)
, fSampleCnt(SkTMax(1, sampleCnt))
, fStencilBits(0) // We always create stencil buffers internally for vulkan
- , fConfig(kUnknown_GrPixelConfig)
+ , fConfig(GrVkFormatToPixelConfig(vkInfo.fFormat))
, fBackend(kVulkan_GrBackend)
, fVkInfo(vkInfo, layout.release()) {}
#endif
@@ -332,6 +354,24 @@ GrBackendRenderTarget::GrBackendRenderTarget(int width,
, fMtlInfo(mtlInfo) {}
#endif
+#if GR_TEST_UTILS
+
+GrBackendRenderTarget::GrBackendRenderTarget(int width,
+ int height,
+ int sampleCnt,
+ int stencilBits,
+ GrPixelConfig config,
+ const GrGLFramebufferInfo& glInfo)
+ : fIsValid(true)
+ , fWidth(width)
+ , fHeight(height)
+ , fSampleCnt(SkTMax(1, sampleCnt))
+ , fStencilBits(stencilBits)
+ , fConfig(config)
+ , fBackend(kOpenGL_GrBackend)
+ , fGLInfo(glInfo) {}
+#endif
+
GrBackendRenderTarget::GrBackendRenderTarget(int width,
int height,
int sampleCnt,
@@ -342,7 +382,7 @@ GrBackendRenderTarget::GrBackendRenderTarget(int width,
, fHeight(height)
, fSampleCnt(SkTMax(1, sampleCnt))
, fStencilBits(stencilBits)
- , fConfig(kUnknown_GrPixelConfig)
+ , fConfig(GrGLSizedFormatToPixelConfig(glInfo.fFormat))
, fBackend(kOpenGL_GrBackend)
, fGLInfo(glInfo) {}