-void GrGLTexture::init(GrGpuGL* gpu,
- const Desc& textureDesc,
- const GrGLRenderTarget::Desc* rtDesc) {
-
- SkASSERT(0 != textureDesc.fTextureID);
-
- fTexParams.invalidate();
- fTexParamsTimestamp = GrGpu::kExpiredTimestamp;
- fTexIDObj.reset(SkNEW_ARGS(GrGLTexID, (GPUGL->glInterface(),
- textureDesc.fTextureID,
- textureDesc.fIsWrapped)));
-
- if (rtDesc) {
- GrGLIRect vp;
- vp.fLeft = 0;
- vp.fWidth = textureDesc.fWidth;
- vp.fBottom = 0;
- vp.fHeight = textureDesc.fHeight;
-
- fRenderTarget.reset(SkNEW_ARGS(GrGLRenderTarget, (gpu, *rtDesc, vp, fTexIDObj, this)));
- }
+// Because this class is virtually derived from GrSurface we must explicitly call its constructor.
+GrGLTexture::GrGLTexture(GrGpuGL* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc)
+ : GrSurface(gpu, idDesc.fIsWrapped, desc)
+ , INHERITED(gpu, idDesc.fIsWrapped, desc) {
+ this->init(desc, idDesc);