diff options
author | Greg Daniel <egdaniel@google.com> | 2018-03-13 16:44:48 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-14 14:12:42 +0000 |
commit | 7d2b16ad13fd3262c776ae75ae35da4ad69df690 (patch) | |
tree | 768403578659fe038f155a8a78bd0244faa3b51a /include | |
parent | b78dd5d01eb16ae3cb9104ce8c0fa7e861431259 (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 'include')
-rw-r--r-- | include/gpu/GrBackendSurface.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h index 0145dc44c0..7bab31d0dd 100644 --- a/include/gpu/GrBackendSurface.h +++ b/include/gpu/GrBackendSurface.h @@ -138,7 +138,10 @@ public: // Returns true if the backend texture has been initialized. bool isValid() const { return fConfig != kUnknown_GrPixelConfig; } - GrPixelConfig testingOnly_getPixelConfig() const; +#if GR_TEST_UTILS + GrPixelConfig getPixelConfig() const { return fConfig; } + void setPixelConfig(GrPixelConfig config) { fConfig = config; } +#endif private: // Friending for access to the GrPixelConfig @@ -149,6 +152,7 @@ private: friend class GrGpu; friend class GrGLGpu; friend class GrVkGpu; + friend class PromiseImageHelper; GrPixelConfig config() const { return fConfig; } int fWidth; //<! width in pixels @@ -224,7 +228,10 @@ public: // Returns true if the backend texture has been initialized. bool isValid() const { return fConfig != kUnknown_GrPixelConfig; } - GrPixelConfig testingOnly_getPixelConfig() const; +#if GR_TEST_UTILS + GrPixelConfig getPixelConfig() const { return fConfig; } + void setPixelConfig(GrPixelConfig config) { fConfig = config; } +#endif private: // Friending for access to the GrPixelConfig |