diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-27 18:13:17 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-27 18:13:17 +0000 |
commit | a50418f65e857ff05b3a71d3e03db44c1f232977 (patch) | |
tree | 9dd1f7bb236215a15ef8744c86fc7a41a10d3e7f /src/gpu/gl | |
parent | dbe7f52412f55561dcc3a51fa3df2779c9a368bf (diff) |
Don't check the framebuffer status every time we flush when we're on Chromium;
this reduces the number of unnecessary command buffer flushes by about 50%
for page loads when doing Ganesh rendering, since we do a flush on clear.
BUG=
R=bsalomon@google.com
Author: humper@google.com
Review URL: https://codereview.chromium.org/92103002
git-svn-id: http://skia.googlecode.com/svn/trunk@12421 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 9cf39b6534..140b4d7c0c 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -1276,6 +1276,7 @@ void GrGpuGL::onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect) { return; } } + this->flushRenderTarget(rect); GrAutoTRestore<ScissorState> asr(&fScissorState); fScissorState.fEnabled = (NULL != rect); @@ -1522,10 +1523,16 @@ void GrGpuGL::flushRenderTarget(const SkIRect* bound) { if (fHWBoundRenderTarget != rt) { GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, rt->renderFBOID())); #ifdef SK_DEBUG - GrGLenum status; - GL_CALL_RET(status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); - if (status != GR_GL_FRAMEBUFFER_COMPLETE) { - GrPrintf("GrGpuGL::flushRenderTarget glCheckFramebufferStatus %x\n", status); + // don't do this check in Chromium -- this is causing + // lots of repeated command buffer flushes when the compositor is + // rendering with Ganesh, which is really slow; even too slow for + // Debug mode. + if (!this->glContext().info().isChromium()) { + GrGLenum status; + GL_CALL_RET(status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); + if (status != GR_GL_FRAMEBUFFER_COMPLETE) { + GrPrintf("GrGpuGL::flushRenderTarget glCheckFramebufferStatus %x\n", status); + } } #endif fHWBoundRenderTarget = rt; |