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/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 3d3be74..94fcee0 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -63,7 +63,8 @@
if (fContext->caps()->shaderCaps()->pathRenderingSupport() &&
renderTarget->isStencilBufferMultisampled() &&
fSurfaceProps.isUseDeviceIndependentFonts()) {
- GrStencilAttachment* sb = renderTarget->renderTargetPriv().attachStencilAttachment();
+ GrStencilAttachment* sb =
+ fContext->resourceProvider()->attachStencilAttachment(renderTarget);
if (sb) {
return GrStencilAndCoverTextContext::Create(fContext, surfaceProps);
}