diff options
Diffstat (limited to 'src/gpu/GrGpuGL.cpp')
-rw-r--r-- | src/gpu/GrGpuGL.cpp | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/gpu/GrGpuGL.cpp b/src/gpu/GrGpuGL.cpp index f1bc63dac4..83087f4694 100644 --- a/src/gpu/GrGpuGL.cpp +++ b/src/gpu/GrGpuGL.cpp @@ -643,79 +643,6 @@ GrRenderTarget* GrGpuGL::onCreatePlatformRenderTarget(const GrPlatformRenderTarg return tgt; } -GrResource* GrGpuGL::onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc) { - - bool isTexture = kTexture_GrPlatformSurfaceType == desc.fSurfaceType || - kTextureRenderTarget_GrPlatformSurfaceType == desc.fSurfaceType; - bool isRenderTarget = kRenderTarget_GrPlatformSurfaceType == desc.fSurfaceType || - kTextureRenderTarget_GrPlatformSurfaceType == desc.fSurfaceType; - - GrGLRenderTarget::Desc rtDesc; - SkAutoTUnref<GrGLStencilBuffer> sb; - - if (isRenderTarget) { - rtDesc.fRTFBOID = desc.fPlatformRenderTarget; - rtDesc.fConfig = desc.fConfig; - if (desc.fSampleCnt) { - if (kGrCanResolve_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags) { - rtDesc.fTexFBOID = desc.fPlatformResolveDestination; - } else { - GrAssert(!isTexture); // this should have been filtered by GrContext - rtDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; - } - } else { - rtDesc.fTexFBOID = desc.fPlatformRenderTarget; - } - // we don't know what the RB ids are without glGets and we don't care - // since we aren't responsible for deleting them. - rtDesc.fMSColorRenderbufferID = 0; - rtDesc.fSampleCnt = desc.fSampleCnt; - if (desc.fStencilBits) { - GrGLStencilBuffer::Format format; - format.fInternalFormat = GrGLStencilBuffer::kUnknownInternalFormat; - format.fPacked = false; - format.fStencilBits = desc.fStencilBits; - format.fTotalBits = desc.fStencilBits; - sb.reset(new GrGLStencilBuffer(this, 0, desc.fWidth, desc.fHeight, - rtDesc.fSampleCnt, format)); - } - rtDesc.fOwnIDs = false; - } - - if (isTexture) { - GrGLTexture::Desc texDesc; - if (!this->configToGLFormats(desc.fConfig, false, NULL, NULL, NULL)) { - return NULL; - } - texDesc.fWidth = desc.fWidth; - texDesc.fHeight = desc.fHeight; - - texDesc.fConfig = desc.fConfig; - texDesc.fOrientation = GrGLTexture::kBottomUp_Orientation; - texDesc.fTextureID = desc.fPlatformTexture; - texDesc.fOwnsID = false; - - if (isRenderTarget) { - GrTexture* tex = new GrGLTexture(this, texDesc, rtDesc); - tex->asRenderTarget()->setStencilBuffer(sb.get()); - return tex; - } else { - return new GrGLTexture(this, texDesc); - } - } else { - GrGLIRect viewport; - viewport.fLeft = 0; - viewport.fBottom = 0; - viewport.fWidth = desc.fWidth; - viewport.fHeight = desc.fHeight; - - GrGLRenderTarget* rt = new GrGLRenderTarget(this, rtDesc, viewport); - rt->setStencilBuffer(sb.get()); - return rt; - } -} - - //////////////////////////////////////////////////////////////////////////////// void GrGpuGL::onWriteTexturePixels(GrTexture* texture, |