Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: src/gpu/GrGpu.h

Issue 1333383002: Move some of the adding stencil attachment logic of Gpu and into Render Target. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« no previous file with comments | « include/gpu/GrRenderTarget.h ('k') | src/gpu/GrGpu.cpp » ('j') | src/gpu/gl/GrGLGpu.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698