Move some of the adding stencil attachment logic of Gpu and into Render Target.
The new flow of calls for attaching a Stencil looks like:
Client
rt->attachStencilAttachment()
gpu->getStencilAttachment()
glgpu->createStencilAttachment()
glrt->completeStencilAttachment() //actually attaches
BUG=skia:
Review URL: https://codereview.chromium.org/1333383002
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index 72efab1..33a9f3b 100644
--- a/src/gpu/GrResourceProvider.h
+++ b/src/gpu/GrResourceProvider.h
@@ -16,6 +16,8 @@
class GrBatchAtlas;
class GrIndexBuffer;
class GrPath;
+class GrRenderTarget;
+class GrStencilAttachment;
class GrStrokeInfo;
class GrVertexBuffer;
class SkDescriptor;
@@ -134,6 +136,12 @@
GrBatchAtlas* createAtlas(GrPixelConfig, int width, int height, int numPlotsX, int numPlotsY,
GrBatchAtlas::EvictionFunc func, void* data);
+ /**
+ * If passed in render target already has a stencil buffer, return it. Otherwise attempt to
+ * attach one.
+ */
+ GrStencilAttachment* attachStencilAttachment(GrRenderTarget* rt);
+
private:
const GrIndexBuffer* createInstancedIndexBuffer(const uint16_t* pattern,
int patternSize,