Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Unified Diff: src/gpu/gl/GrGpuGL.cpp

Issue 694933002: Temporary fix to remove drawrect call from GpuGL (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanupcontext
Patch Set: cleanup Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 9c0860a2d4c31e282b7e914a0f0fdbc7676e21c8..9c3efdf134610ee52e0a83aab0269a52b20be674 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2405,11 +2405,8 @@ bool GrGpuGL::onCopySurface(GrSurface* dst,
GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) {
- bool inheritedCouldCopy = INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint);
bool copied = false;
- bool wouldNeedTempFBO = false;
- if (can_copy_texsubimage(dst, src, this, &wouldNeedTempFBO) &&
- (!wouldNeedTempFBO || !inheritedCouldCopy)) {
+ if (can_copy_texsubimage(dst, src, this)) {
GrGLuint srcFBO;
GrGLIRect srcVP;
srcFBO = this->bindSurfaceAsFBO(src, GR_GL_FRAMEBUFFER, &srcVP);
@@ -2441,8 +2438,7 @@ bool GrGpuGL::onCopySurface(GrSurface* dst,
if (srcFBO) {
GL_CALL(DeleteFramebuffers(1, &srcFBO));
}
- } else if (can_blit_framebuffer(dst, src, this, &wouldNeedTempFBO) &&
- (!wouldNeedTempFBO || !inheritedCouldCopy)) {
+ } else if (can_blit_framebuffer(dst, src, this)) {
SkIRect dstRect = SkIRect::MakeXYWH(dstPoint.fX, dstPoint.fY,
srcRect.width(), srcRect.height());
bool selfOverlap = false;
@@ -2505,10 +2501,6 @@ bool GrGpuGL::onCopySurface(GrSurface* dst,
copied = true;
}
}
- if (!copied && inheritedCouldCopy) {
- copied = INHERITED::onCopySurface(dst, src, srcRect, dstPoint);
- SkASSERT(copied);
- }
return copied;
}
@@ -2516,11 +2508,13 @@ bool GrGpuGL::onCanCopySurface(GrSurface* dst,
GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) {
- // This mirrors the logic in onCopySurface.
- if (can_copy_texsubimage(dst, src, this)) {
+ // This mirrors the logic in onCopySurface. We prefer our base makes the copy if we need to
bsalomon 2014/10/31 19:43:01 Is this preference known to be valid?
+ // create a temp fbo
+ bool wouldNeedTempFBO = false;
+ if (can_copy_texsubimage(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTempFBO) {
return true;
}
- if (can_blit_framebuffer(dst, src, this)) {
+ if (can_blit_framebuffer(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTempFBO) {
if (dst->surfacePriv().isSameAs(src)) {
SkIRect dstRect = SkIRect::MakeXYWH(dstPoint.fX, dstPoint.fY,
srcRect.width(), srcRect.height());
@@ -2531,7 +2525,7 @@ bool GrGpuGL::onCanCopySurface(GrSurface* dst,
return true;
}
}
- return INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint);
+ return false;
}
void GrGpuGL::didAddGpuTraceMarker() {
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698