Make GrResource know whether 3D objects' lifetimes are managed by Skia or not.
Review URL: https://codereview.appspot.com/7201046
git-svn-id: http://skia.googlecode.com/svn/trunk@7348 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index bb727e2..dc41fbb 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -498,7 +498,7 @@
glTexDesc.fConfig = desc.fConfig;
glTexDesc.fSampleCnt = desc.fSampleCnt;
glTexDesc.fTextureID = static_cast<GrGLuint>(desc.fTextureHandle);
- glTexDesc.fOwnsID = false;
+ glTexDesc.fIsWrapped = true;
glTexDesc.fOrigin = GrSurface::kBottomLeft_Origin;
GrGLTexture* texture = NULL;
@@ -507,7 +507,7 @@
glRTDesc.fRTFBOID = 0;
glRTDesc.fTexFBOID = 0;
glRTDesc.fMSColorRenderbufferID = 0;
- glRTDesc.fOwnIDs = true;
+ glRTDesc.fIsWrapped = false;
glRTDesc.fConfig = desc.fConfig;
glRTDesc.fSampleCnt = desc.fSampleCnt;
if (!this->createRenderTargetObjects(glTexDesc.fWidth,
@@ -535,7 +535,7 @@
glDesc.fMSColorRenderbufferID = 0;
glDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID;
glDesc.fSampleCnt = desc.fSampleCnt;
- glDesc.fOwnIDs = false;
+ glDesc.fIsWrapped = true;
GrGLIRect viewport;
viewport.fLeft = 0;
viewport.fBottom = 0;
@@ -550,8 +550,10 @@
format.fPacked = false;
format.fStencilBits = desc.fStencilBits;
format.fTotalBits = desc.fStencilBits;
+ static const bool kIsWrapped = false;
GrGLStencilBuffer* sb = SkNEW_ARGS(GrGLStencilBuffer,
(this,
+ kIsWrapped,
0,
desc.fWidth,
desc.fHeight,
@@ -827,7 +829,7 @@
desc->fMSColorRenderbufferID = 0;
desc->fRTFBOID = 0;
desc->fTexFBOID = 0;
- desc->fOwnIDs = true;
+ desc->fIsWrapped = false;
GrGLenum status;
@@ -942,12 +944,12 @@
glTexDesc.fConfig = desc.fConfig;
glTexDesc.fSampleCnt = desc.fSampleCnt;
- glTexDesc.fOwnsID = true;
+ glTexDesc.fIsWrapped = false;
glRTDesc.fMSColorRenderbufferID = 0;
glRTDesc.fRTFBOID = 0;
glRTDesc.fTexFBOID = 0;
- glRTDesc.fOwnIDs = true;
+ glRTDesc.fIsWrapped = false;
glRTDesc.fConfig = glTexDesc.fConfig;
bool renderTarget = 0 != (desc.fFlags & kRenderTarget_GrTextureFlagBit);
@@ -1112,8 +1114,9 @@
// whatever sizes GL gives us. In that case we query for the size.
GrGLStencilBuffer::Format format = sFmt;
get_stencil_rb_sizes(this->glInterface(), sbID, &format);
+ static const bool kIsWrapped = false;
SkAutoTUnref<GrStencilBuffer> sb(SkNEW_ARGS(GrGLStencilBuffer,
- (this, sbID, width, height,
+ (this, kIsWrapped, sbID, width, height,
samples, format)));
if (this->attachStencilBufferToRenderTarget(sb, rt)) {
fLastSuccessfulStencilFmtIdx = sIdx;
@@ -1214,8 +1217,9 @@
fHWGeometryState.fVertexBuffer = NULL;
return NULL;
}
+ static const bool kIsWrapped = false;
GrGLVertexBuffer* vertexBuffer = SkNEW_ARGS(GrGLVertexBuffer,
- (this, id,
+ (this, kIsWrapped, id,
size, dynamic));
fHWGeometryState.fVertexBuffer = vertexBuffer;
return vertexBuffer;
@@ -1242,8 +1246,9 @@
fHWGeometryState.fIndexBuffer = NULL;
return NULL;
}
+ static const bool kIsWrapped = false;
GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer,
- (this, id, size, dynamic));
+ (this, kIsWrapped, id, size, dynamic));
fHWGeometryState.fIndexBuffer = indexBuffer;
return indexBuffer;
}
@@ -2363,4 +2368,3 @@
}
}
}
-