From 5254ccc1815e1b1bfa066a1ce193ddfdfcf16a55 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Mon, 13 Nov 2017 11:05:52 -0500 Subject: Move pixel config getter to private in GrBackendSurface We eventually want to remove pixel config from GrBackendSurface so this helps to insure that clients don't rely on it. Bug: skia: Change-Id: I6b8435d12347fab62c0f9032addea1211aa703ca Reviewed-on: https://skia-review.googlesource.com/70642 Reviewed-by: Brian Salomon Commit-Queue: Greg Daniel --- include/gpu/GrBackendSurface.h | 16 ++++++++++++++-- src/gpu/vk/GrVkGpu.cpp | 9 +++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h index bf1e52c959..c9d326bc36 100644 --- a/include/gpu/GrBackendSurface.h +++ b/include/gpu/GrBackendSurface.h @@ -51,7 +51,6 @@ public: int width() const { return fWidth; } int height() const { return fHeight; } - GrPixelConfig config() const { return fConfig; } bool hasMipMaps() const { return GrMipMapped::kYes == fMipMapped; } GrBackend backend() const {return fBackend; } @@ -73,6 +72,13 @@ public: bool isValid() const { return fConfig != kUnknown_GrPixelConfig; } private: + // Friending for access to the GrPixelConfig + friend class SkSurface; + friend class GrGpu; + friend class GrGLGpu; + friend class GrVkGpu; + GrPixelConfig config() const { return fConfig; } + int fWidth; //fFormat)); + SkASSERT(config == GrVkFormatToPixelConfig(info->fFormat)); return true; } sk_sp GrVkGpu::onWrapBackendTexture(const GrBackendTexture& backendTex, GrWrapOwnership ownership) { - if (!check_backend_texture(backendTex)) { + if (!check_backend_texture(backendTex, backendTex.config())) { return nullptr; } @@ -922,7 +923,7 @@ sk_sp GrVkGpu::onWrapBackendTexture(const GrBackendTexture& backendTe sk_sp GrVkGpu::onWrapRenderableBackendTexture(const GrBackendTexture& backendTex, int sampleCnt, GrWrapOwnership ownership) { - if (!check_backend_texture(backendTex)) { + if (!check_backend_texture(backendTex, backendTex.config())) { return nullptr; } -- cgit v1.2.3