aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-11-25 07:41:12 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-25 07:41:12 -0800
commita2c2323005fb22e564426f4ed86adaa6d213aba1 (patch)
tree03872273e7a1eb533a311746a6dc43c928295009 /src
parent821e3522380ee8995da15f9c9bec9e8b21f4a809 (diff)
Remove GrSurface::isSameAs
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrDrawTarget.cpp2
-rw-r--r--src/gpu/GrSurface.cpp11
-rw-r--r--src/gpu/GrSurfacePriv.h7
-rw-r--r--src/gpu/gl/GrGpuGL.cpp4
4 files changed, 3 insertions, 21 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 2f395e666d..688a7445a1 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -971,7 +971,7 @@ bool GrDrawTarget::canCopySurface(const GrSurface* dst,
SkASSERT(clippedDstPoint.fX + clippedSrcRect.width() <= dst->width() &&
clippedDstPoint.fY + clippedSrcRect.height() <= dst->height());
- return !dst->surfacePriv().isSameAs(src) && dst->asRenderTarget() && src->asTexture();
+ return (dst != src) && dst->asRenderTarget() && src->asTexture();
}
void GrDrawTarget::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) {
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index 1779f2441b..1ca305b5a1 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -123,14 +123,3 @@ bool GrSurface::hasPendingIO() const {
}
return false;
}
-
-bool GrSurface::isSameAs(const GrSurface* other) const {
- const GrRenderTarget* thisRT = this->asRenderTarget();
- if (thisRT) {
- return thisRT == other->asRenderTarget();
- } else {
- const GrTexture* thisTex = this->asTexture();
- SkASSERT(thisTex); // We must be one or the other
- return thisTex == other->asTexture();
- }
-}
diff --git a/src/gpu/GrSurfacePriv.h b/src/gpu/GrSurfacePriv.h
index 3203671fad..3c1e9c1e95 100644
--- a/src/gpu/GrSurfacePriv.h
+++ b/src/gpu/GrSurfacePriv.h
@@ -24,13 +24,6 @@ public:
SkImageInfo info() const { return fSurface->info(); }
/**
- * Checks whether this GrSurface refers to the same GPU object as other. This
- * catches the case where a GrTexture and GrRenderTarget refer to the same
- * GPU memory.
- */
- bool isSameAs(const GrSurface* other) const { return fSurface->isSameAs(other); }
-
- /**
* Write the contents of the surface to a PNG. Returns true if successful.
* @param filename Full path to desired file
*/
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index bb40839f48..8bf35c1690 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2429,7 +2429,7 @@ bool GrGpuGL::copySurface(GrSurface* dst,
SkIRect dstRect = SkIRect::MakeXYWH(dstPoint.fX, dstPoint.fY,
srcRect.width(), srcRect.height());
bool selfOverlap = false;
- if (dst->surfacePriv().isSameAs(src)) {
+ if (dst == src) {
selfOverlap = SkIRect::IntersectsNoEmptyCheck(dstRect, srcRect);
}
@@ -2503,7 +2503,7 @@ bool GrGpuGL::canCopySurface(const GrSurface* dst,
return true;
}
if (can_blit_framebuffer(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTempFBO) {
- if (dst->surfacePriv().isSameAs(src)) {
+ if (dst == src) {
SkIRect dstRect = SkIRect::MakeXYWH(dstPoint.fX, dstPoint.fY,
srcRect.width(), srcRect.height());
if(!SkIRect::IntersectsNoEmptyCheck(dstRect, srcRect)) {