aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-04-06 09:27:20 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-06 14:42:23 +0000
commit9ca3065ca5bac6cc45c0ea5de23aebab92282227 (patch)
treef0cb50532b33281d2cccf414403f1a837cf52891 /include/gpu
parenta39991ebd70f4aaf1290dd516467d729811e45ee (diff)
Don't use GrPixelConfig value as proxy for valid on GrBackendSurface.
Bug: skia: Change-Id: I275b74b915240c9918bb2efa6a9708341f3bb189 Reviewed-on: https://skia-review.googlesource.com/119004 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrBackendSurface.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h
index 8d7886ee14..f0d716cad0 100644
--- a/include/gpu/GrBackendSurface.h
+++ b/include/gpu/GrBackendSurface.h
@@ -100,7 +100,7 @@ private:
class SK_API GrBackendTexture {
public:
// Creates an invalid backend texture.
- GrBackendTexture() : fConfig(kUnknown_GrPixelConfig) {}
+ GrBackendTexture() : fIsValid(false) {}
#if GR_TEST_UTILS
// GrGLTextureInfo::fFormat is ignored
@@ -156,7 +156,7 @@ public:
const GrMockTextureInfo* getMockTextureInfo() const;
// Returns true if the backend texture has been initialized.
- bool isValid() const { return fConfig != kUnknown_GrPixelConfig; }
+ bool isValid() const { return fIsValid; }
/**
* Create a GrBackendFormat object that matches this texture
@@ -182,6 +182,7 @@ private:
GrPixelConfig config() const { return fConfig; }
+ bool fIsValid;
int fWidth; //<! width in pixels
int fHeight; //<! height in pixels
GrPixelConfig fConfig;
@@ -200,7 +201,7 @@ private:
class SK_API GrBackendRenderTarget {
public:
// Creates an invalid backend texture.
- GrBackendRenderTarget() : fConfig(kUnknown_GrPixelConfig) {}
+ GrBackendRenderTarget() : fIsValid(false) {}
#if GR_TEST_UTILS
// GrGLTextureInfo::fFormat is ignored
@@ -255,7 +256,7 @@ public:
const GrMockRenderTargetInfo* getMockRenderTargetInfo() const;
// Returns true if the backend texture has been initialized.
- bool isValid() const { return fConfig != kUnknown_GrPixelConfig; }
+ bool isValid() const { return fIsValid; }
#if GR_TEST_UTILS
@@ -274,6 +275,7 @@ private:
friend class GrVkGpu;
GrPixelConfig config() const { return fConfig; }
+ bool fIsValid;
int fWidth; //<! width in pixels
int fHeight; //<! height in pixels