Add sizeInBytes to GrResource, make GrRenderTarget aware of its pixel config
Review URL: http://codereview.appspot.com/4802058/
git-svn-id: http://skia.googlecode.com/svn/trunk@1951 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGLTexture.cpp b/gpu/src/GrGLTexture.cpp
index bbca5ed..c5375c9 100644
--- a/gpu/src/GrGLTexture.cpp
+++ b/gpu/src/GrGLTexture.cpp
@@ -23,12 +23,14 @@
GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu,
const GLRenderTargetIDs& ids,
GrGLTexID* texID,
+ GrPixelConfig config,
GrGLuint stencilBits,
bool isMultisampled,
const GrGLIRect& viewport,
GrGLTexture* texture)
: INHERITED(gpu, texture, viewport.fWidth,
- viewport.fHeight, stencilBits, isMultisampled) {
+ viewport.fHeight, config,
+ stencilBits, isMultisampled) {
fRTFBOID = ids.fRTFBOID;
fTexFBOID = ids.fTexFBOID;
fStencilRenderbufferID = ids.fStencilRenderbufferID;
@@ -131,6 +133,7 @@
vp.fBottom = textureDesc.fAllocHeight - textureDesc.fContentHeight;
fRenderTarget = new GrGLRenderTarget(gpu, rtIDs, fTexIDObj,
+ textureDesc.fFormat,
textureDesc.fStencilBits,
rtIDs.fRTFBOID != rtIDs.fTexFBOID,
vp, this);
@@ -226,7 +229,7 @@
}
}
-intptr_t GrGLTexture::getTextureHandle() {
+intptr_t GrGLTexture::getTextureHandle() const {
return fTexIDObj->id();
}