Make GrStencilAttachment derive from GrSurface.
This is the start of trying to have all our different types of "surface"
allocations share a common class. we will soon follow up with also having
an msaa attachment class derivie from GrSurface.
Bug: skia:10727
Change-Id: I50e78d232a454b1dd35cf9606791390ce5a6396b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317392
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 39689df..19cf88e 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -499,8 +499,6 @@
if (!rt->wasDestroyed() && rt->canAttemptStencilAttachment()) {
GrUniqueKey sbKey;
- int width = rt->width();
- int height = rt->height();
#if 0
if (this->caps()->oversizedStencilSupport()) {
width = SkNextPow2(width);
@@ -508,12 +506,12 @@
}
#endif
GrStencilAttachment::ComputeSharedStencilAttachmentKey(
- width, height, numStencilSamples, &sbKey);
+ rt->dimensions(), numStencilSamples, &sbKey);
auto stencil = this->findByUniqueKey<GrStencilAttachment>(sbKey);
if (!stencil) {
// Need to try and create a new stencil
stencil.reset(this->gpu()->createStencilAttachmentForRenderTarget(
- rt, width, height, numStencilSamples));
+ rt, rt->dimensions(), numStencilSamples));
if (!stencil) {
return false;
}