Make RT & TEX base classes aware of NPOT/min-RT bloated size
Review URL: http://codereview.appspot.com/4849045/
git-svn-id: http://skia.googlecode.com/svn/trunk@2057 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGLRenderTarget.cpp b/gpu/src/GrGLRenderTarget.cpp
index 38b9eb7..39aa332 100644
--- a/gpu/src/GrGLRenderTarget.cpp
+++ b/gpu/src/GrGLRenderTarget.cpp
@@ -30,8 +30,14 @@
const GrGLIRect& viewport,
GrGLTexID* texID,
GrGLTexture* texture)
- : INHERITED(gpu, texture, viewport.fWidth,
- viewport.fHeight, desc.fConfig, desc.fSampleCnt) {
+ : INHERITED(gpu,
+ texture,
+ viewport.fWidth,
+ viewport.fHeight,
+ texture->allocatedWidth(),
+ texture->allocatedHeight(),
+ desc.fConfig,
+ desc.fSampleCnt) {
GrAssert(NULL != texID);
GrAssert(NULL != texture);
// FBO 0 can't also be a texture, right?
@@ -43,8 +49,14 @@
GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu,
const Desc& desc,
const GrGLIRect& viewport)
- : INHERITED(gpu, NULL, viewport.fWidth,
- viewport.fHeight, desc.fConfig, desc.fSampleCnt) {
+ : INHERITED(gpu,
+ NULL,
+ viewport.fWidth,
+ viewport.fHeight,
+ viewport.fWidth, // don't really need separate alloc w/h for
+ viewport.fHeight, // non-texture RTs, repeat viewport values
+ desc.fConfig,
+ desc.fSampleCnt) {
this->init(desc, viewport, NULL);
}