Remove special handling of stencil formats and just use GrBackendFormts.
Before this change each backend had its own special stencil format
struct that contained information like the actual format, stencil bits,
etc. This change removes all of that and instead reliess on static
helper functions that can return all this information based on the
backend format.
Besides being cleaner, this change helps move towards being able to
combine all surface attachment classes into a unified class.
Bug: skia:10727
Change-Id: I26003e44f55ce32293e9092bafce5baef6f938d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322958
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 00b6164..5fe7a42 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -9,6 +9,7 @@
#include "src/gpu/GrRenderTarget.h"
#include "src/core/SkRectPriv.h"
+#include "src/gpu/GrBackendUtils.h"
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrSamplePatternDictionary.h"
@@ -68,7 +69,7 @@
int GrRenderTarget::numStencilBits() const {
SkASSERT(this->getStencilAttachment());
- return this->getStencilAttachment()->bits();
+ return GrBackendFormatStencilBits(this->getStencilAttachment()->backendFormat());
}
int GrRenderTarget::getSamplePatternKey() {