Remove unused SkGpuDevice functions, add GrRenderTarget handle getters

Code Review: http://codereview.appspot.com/4718041/



git-svn-id: http://skia.googlecode.com/svn/trunk@1854 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2011-07-13 21:53:49 +00:00
parent 0fb2125814
commit 0b96a84ca1
4 changed files with 20 additions and 20 deletions

View File

@ -86,6 +86,12 @@ public:
GrGLuint textureFBOID() const { return fTexFBOID; }
// override of GrRenderTarget
virtual intptr_t getRenderTargetHandle() const {
return this->renderFBOID();
}
virtual intptr_t getRenderTargetResolvedHandle() const {
return this->textureFBOID();
}
virtual ResolveType getResolveType() const {
if (fRTFBOID == fTexFBOID) {
// catches FBO 0 and non MSAA case

View File

@ -53,6 +53,20 @@ public:
*/
GrTexture* asTexture() {return fTexture;}
/**
* If this RT is multisampled, this is the multisample buffer
* @return the 3D API's handle to this object (e.g. FBO ID in OpenGL)
*/
virtual intptr_t getRenderTargetHandle() const = 0;
/**
* If this RT is multisampled, this is the buffer it is resolved to.
* Otherwise, same as getRenderTargetHandle().
* (In GL a separate FBO ID is used for the msaa and resolved buffers)
* @return the 3D API's handle to this object (e.g. FBO ID in OpenGL)
*/
virtual intptr_t getRenderTargetResolvedHandle() const = 0;
/**
* @return true if the render target is multisampled, false otherwise
*/

View File

@ -67,18 +67,6 @@ public:
GrContext* context() const { return fContext; }
/**
* If this device was built for rendering as a layer (i.e. offscreen),
* then this will return the platform-specific handle to that GPU resource.
* For example, in OpenGL, this will return the FBO's texture ID.
* If this device was not built for rendering as a layer, then 0
* is returned.
*/
intptr_t getLayerTextureHandle() const;
// call to set the clip to the specified rect
void scissor(const SkIRect&);
/**
* Override from SkGpuDevice, so we can set our FBO to be the render target
* The canvas parameter must be a SkGpuCanvas

View File

@ -258,14 +258,6 @@ SkGpuDevice::~SkGpuDevice() {
fContext->unref();
}
intptr_t SkGpuDevice::getLayerTextureHandle() const {
if (fTexture) {
return fTexture->getTextureHandle();
} else {
return 0;
}
}
///////////////////////////////////////////////////////////////////////////////
void SkGpuDevice::makeRenderTargetCurrent() {