cleanup GrGLTexture / GrGLRenderTarget cons. Make GrRenderTarget aware of its msaa sample count.
Review URL: http://codereview.appspot.com/4833045/
git-svn-id: http://skia.googlecode.com/svn/trunk@1996 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrRenderTarget.h b/gpu/include/GrRenderTarget.h
index b6f4b62..a5616b9 100644
--- a/gpu/include/GrRenderTarget.h
+++ b/gpu/include/GrRenderTarget.h
@@ -77,7 +77,12 @@
/**
* @return true if the render target is multisampled, false otherwise
*/
- bool isMultisampled() { return fIsMultisampled; }
+ bool isMultisampled() const { return 0 != fSampleCnt; }
+
+ /**
+ * @return the number of samples-per-pixel or zero if non-MSAA.
+ */
+ int numSamples() const { return fSampleCnt; }
/**
* Call to indicate the multisample contents were modified such that the
@@ -147,14 +152,14 @@
int height,
GrPixelConfig config,
int stencilBits,
- bool isMultisampled)
+ int sampleCnt)
: INHERITED(gpu)
, fTexture(texture)
, fWidth(width)
, fHeight(height)
, fConfig(config)
, fStencilBits(stencilBits)
- , fIsMultisampled(isMultisampled)
+ , fSampleCnt(sampleCnt)
{
fResolveRect.setLargestInverted();
}
@@ -176,7 +181,7 @@
int fHeight;
GrPixelConfig fConfig;
int fStencilBits;
- bool fIsMultisampled;
+ int fSampleCnt;
GrIRect fResolveRect;
// GrGpu keeps a cached clip in the render target to avoid redundantly