Revert of Temporary fix to remove drawrect call from GpuGL (patchset #6 id:90005...
authorjoshualitt <joshualitt@google.com>
Fri, 31 Oct 2014 23:32:22 +0000 (16:32 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 31 Oct 2014 23:32:22 +0000 (16:32 -0700)
Reason for revert:
patch breaks angle bots and K1

Original issue's description:
> Temporary fix to remove drawrect call from GpuGL
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d4a5c2028117c100ccf44263c0118a0b4745f627

TBR=bsalomon@google.com,joshualitt@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/693223002

src/gpu/GrDrawTarget.h
src/gpu/GrInOrderDrawBuffer.cpp
src/gpu/gl/GrGpuGL.cpp

index 1b1137d2d5232f4a49122a993ce6b1d3d708ad83..4545f74d256c6c7849d8e2f636295030c12ef508 100644 (file)
@@ -925,7 +925,7 @@ private:
 
     // Check to see if this set of draw commands has been sent out
     virtual bool       isIssued(uint32_t drawID) { return true; }
-    virtual GrClipMaskManager* clipMaskManager() = 0;
+    virtual GrClipMaskManager* getClipMaskManager() = 0;
 
     enum {
         kPreallocGeoSrcStateStackCnt = 4,
@@ -981,7 +981,7 @@ protected:
     GrClipMaskManager           fClipMaskManager;
 
 private:
-    GrClipMaskManager* clipMaskManager() { return &fClipMaskManager; }
+    GrClipMaskManager* getClipMaskManager() { return &fClipMaskManager; }
 
     typedef GrDrawTarget INHERITED;
 };
index 59b31f4f705a5b7529e5e9bcada87192d022c548..b671742309f862783f77b07a53b18795305f36cb 100644 (file)
@@ -595,9 +595,6 @@ bool GrInOrderDrawBuffer::onCopySurface(GrSurface* dst,
         cs->fDstPoint = dstPoint;
         this->recordTraceMarkersIfNecessary();
         return true;
-    } else if (this->canCopySurface(dst, src, srcRect, dstPoint)) {
-        this->GrDrawTarget::onCopySurface(dst, src, srcRect, dstPoint);
-        return true;
     } else {
         return false;
     }
index 76547760c9bf25216012ababfee672c81a54deee..9d08f641eb7d8f4322d7615388fe032710e52ef1 100644 (file)
@@ -2403,8 +2403,11 @@ bool GrGpuGL::onCopySurface(GrSurface* dst,
                             GrSurface* src,
                             const SkIRect& srcRect,
                             const SkIPoint& dstPoint) {
+    bool inheritedCouldCopy = INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint);
     bool copied = false;
-    if (can_copy_texsubimage(dst, src, this)) {
+    bool wouldNeedTempFBO = false;
+    if (can_copy_texsubimage(dst, src, this, &wouldNeedTempFBO) &&
+        (!wouldNeedTempFBO || !inheritedCouldCopy)) {
         GrGLuint srcFBO;
         GrGLIRect srcVP;
         srcFBO = this->bindSurfaceAsFBO(src, GR_GL_FRAMEBUFFER, &srcVP);
@@ -2436,7 +2439,8 @@ bool GrGpuGL::onCopySurface(GrSurface* dst,
         if (srcFBO) {
             GL_CALL(DeleteFramebuffers(1, &srcFBO));
         }
-    } else if (can_blit_framebuffer(dst, src, this)) {
+    } else if (can_blit_framebuffer(dst, src, this, &wouldNeedTempFBO) &&
+               (!wouldNeedTempFBO || !inheritedCouldCopy)) {
         SkIRect dstRect = SkIRect::MakeXYWH(dstPoint.fX, dstPoint.fY,
                                             srcRect.width(), srcRect.height());
         bool selfOverlap = false;
@@ -2499,6 +2503,10 @@ bool GrGpuGL::onCopySurface(GrSurface* dst,
             copied = true;
         }
     }
+    if (!copied && inheritedCouldCopy) {
+        copied = INHERITED::onCopySurface(dst, src, srcRect, dstPoint);
+        SkASSERT(copied);
+    }
     return copied;
 }
 
@@ -2506,14 +2514,11 @@ bool GrGpuGL::onCanCopySurface(GrSurface* dst,
                                GrSurface* src,
                                const SkIRect& srcRect,
                                const SkIPoint& dstPoint) {
-    // This mirrors the logic in onCopySurface.  We prefer our base makes the copy if we need to
-    // create a temp fbo
-    // TODO verify this assumption, it may not be true at all
-    bool wouldNeedTempFBO = false;
-    if (can_copy_texsubimage(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTempFBO) {
+    // This mirrors the logic in onCopySurface.
+    if (can_copy_texsubimage(dst, src, this)) {
         return true;
     }
-    if (can_blit_framebuffer(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTempFBO) {
+    if (can_blit_framebuffer(dst, src, this)) {
         if (dst->surfacePriv().isSameAs(src)) {
             SkIRect dstRect = SkIRect::MakeXYWH(dstPoint.fX, dstPoint.fY,
                                                 srcRect.width(), srcRect.height());
@@ -2524,7 +2529,7 @@ bool GrGpuGL::onCanCopySurface(GrSurface* dst,
             return true;
         }
     }
-    return false;
+    return INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint);
 }
 
 void GrGpuGL::didAddGpuTraceMarker() {