Chromium Code Reviews| Index: src/gpu/GrGpu.h |
| diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h |
| index ba9e85b54f12924df4a78b85f998b3cdf7f72f6c..ef0be280b1facbe6e2b5c90f57e98e2a13944066 100644 |
| --- a/src/gpu/GrGpu.h |
| +++ b/src/gpu/GrGpu.h |
| @@ -374,7 +374,17 @@ public: |
| virtual void deleteTestingOnlyBackendTexture(GrBackendObject id) const = 0; |
| // Given a rt, find or create a stencil buffer and attach it |
| - bool attachStencilAttachmentToRenderTarget(GrRenderTarget* target); |
| +// bool attachStencilAttachmentToRenderTarget(GrRenderTarget* target); |
| + |
| + // Given the input GrRenderTarget, this function sets GrStencilAttachment* either |
| + // from a cached stencil attachment or by creating a new one. If the GrStencilAttachment* |
| + // that is returned is non-null, the caller will own the ref on the GrStencilAttachment. |
| + // This function returns true if the returned GrStencilAttachment was newly created in case |
| + // the caller wants to do any special thing with the stencil (e.g. clearning it). |
| + bool getStencilAttachment(const GrRenderTarget*, GrStencilAttachment**); |
| + |
| + // clears target's entire stencil buffer to 0 |
| + virtual void clearStencil(GrRenderTarget* target) = 0; |
|
egdaniel
2015/09/11 17:59:49
Since we are not letting the RT handle the attachi
|
| // This is only to be used in GL-specific tests. |
| virtual const GrGLContext* glContextForTesting() const { return nullptr; } |
| @@ -471,15 +481,10 @@ private: |
| const SkIPoint& dstPoint) = 0; |
| // width and height may be larger than rt (if underlying API allows it). |
| - // Should attach the SB to the RT. Returns false if compatible sb could |
| - // not be created. |
| - virtual bool createStencilAttachmentForRenderTarget(GrRenderTarget*, int width, int height) = 0; |
| - |
| - // attaches an existing SB to an existing RT. |
| - virtual bool attachStencilAttachmentToRenderTarget(GrStencilAttachment*, GrRenderTarget*) = 0; |
| - |
| - // clears target's entire stencil buffer to 0 |
| - virtual void clearStencil(GrRenderTarget* target) = 0; |
| + // Returns nullptr if compatible sb could not be created. |
| + virtual GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTarget*, |
| + int width, |
| + int height) = 0; |
| void resetContext() { |
| this->onResetContext(fResetBits); |