Create a separate GrStencilBuffer class apart from GrRenderTarget.
Review URL: http://codereview.appspot.com/4837046/
git-svn-id: http://skia.googlecode.com/svn/trunk@2026 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrRenderTarget.cpp b/gpu/src/GrRenderTarget.cpp
index 186fe8e..8eb9ae0 100644
--- a/gpu/src/GrRenderTarget.cpp
+++ b/gpu/src/GrRenderTarget.cpp
@@ -11,6 +11,7 @@
#include "GrContext.h"
#include "GrGpu.h"
+#include "GrStencilBuffer.h"
bool GrRenderTarget::readPixels(int left, int top, int width, int height,
GrPixelConfig config, void* buffer) {
@@ -30,7 +31,7 @@
} else {
colorBits = GrBytesPerPixel(fConfig);
}
- return fWidth * fHeight * (fStencilBits + colorBits);
+ return fWidth * fHeight * colorBits;
}
void GrRenderTarget::flagAsNeedingResolve(const GrIRect* rect) {
@@ -55,4 +56,8 @@
fResolveRect.setLargestInverted();
}
}
-}
\ No newline at end of file
+}
+
+void GrRenderTarget::setStencilBuffer(GrStencilBuffer* stencilBuffer) {
+ GrSafeAssign(fStencilBuffer, stencilBuffer);
+}