aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-03 19:49:13 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-03 19:49:13 +0000
commitd02e8803e910b762e47a955162292c8b5eee15dc (patch)
tree22bcf3769d2014c7dcb91994ba0a6a4fce0717ee /src/gpu
parent52da917814156af924589154bc8021ff34648eb4 (diff)
Remove GrTexture::releaseRenderTarget() and add GrSurface::isSameAs().
Review URL: https://codereview.chromium.org/13414006 git-svn-id: http://skia.googlecode.com/svn/trunk@8525 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrContext.cpp1
-rw-r--r--src/gpu/GrGpu.h3
-rw-r--r--src/gpu/GrTexture.cpp20
3 files changed, 2 insertions, 22 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 1b62062cc1..071183bc1c 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -373,7 +373,6 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc,
verts[1].setIRectFan(0, 0, 1, 1, 2 * sizeof(GrPoint));
fGpu->drawNonIndexed(kTriangleFan_GrPrimitiveType, 0, 4);
}
- texture->releaseRenderTarget();
} else {
// TODO: Our CPU stretch doesn't filter. But we create separate
// stretched textures when the texture params is either filtered or
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index d4e4e6b2fb..f55c6ada29 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -78,8 +78,7 @@ public:
*
* If kRenderTarget_TextureFlag is specified the GrRenderTarget is
* accessible via GrTexture::asRenderTarget(). The texture will hold a ref
- * on the render target until its releaseRenderTarget() is called or it is
- * destroyed.
+ * on the render target until the texture is destroyed.
*
* @param desc describes the texture to be created.
* @param srcData texel data to load texture. Begins with full-size
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 44a1442b3b..87df1470e9 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -67,33 +67,15 @@ void GrTexture::writePixels(int left, int top, int width, int height,
pixelOpsFlags);
}
-void GrTexture::releaseRenderTarget() {
- if (NULL != fRenderTarget) {
- GrAssert(fRenderTarget->asTexture() == this);
- GrAssert(fDesc.fFlags & kRenderTarget_GrTextureFlagBit);
-
- fRenderTarget->onTextureReleaseRenderTarget();
- fRenderTarget->unref();
- fRenderTarget = NULL;
-
- fDesc.fFlags = fDesc.fFlags &
- ~(kRenderTarget_GrTextureFlagBit|kNoStencil_GrTextureFlagBit);
- fDesc.fSampleCnt = 0;
- }
-}
-
void GrTexture::onRelease() {
GrAssert(!this->isSetFlag((GrTextureFlags) kReturnToCache_FlagBit));
- this->releaseRenderTarget();
-
INHERITED::onRelease();
}
void GrTexture::onAbandon() {
- if (NULL != fRenderTarget) {
+ if (NULL != fRenderTarget.get()) {
fRenderTarget->abandon();
}
-
INHERITED::onAbandon();
}