diff options
author | mtklein <mtklein@chromium.org> | 2015-02-02 18:26:03 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-02 18:26:03 -0800 |
commit | b9eb4ac0f1c29d6fe10ad7ff81ed8326ac1ea043 (patch) | |
tree | aeef8aa338e315c71e75d7e45f0dc970ef1111ed /src/gpu/gl | |
parent | cb3f50468dcd6e838628b425828b8f4386a48109 (diff) |
patch from issue 886233004 at patchset 40001 (http://crrev.com/886233004#ps40001)
... with changes proposed in the review.
BUG=skia:
Review URL: https://codereview.chromium.org/894013002
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 20 | ||||
-rw-r--r-- | src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/builders/GrGLShaderStringBuilder.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/builders/GrGLShaderStringBuilder.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp | 5 |
6 files changed, 18 insertions, 19 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 6d14e7e6c5..e32b2e6b8f 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -850,7 +850,7 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, bool budgeted desc.fWidth, desc.fHeight)) { goto FAILED; } - fGPUStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, idDesc->fRTFBOID)); GL_CALL(FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, GR_GL_COLOR_ATTACHMENT0, @@ -865,7 +865,7 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, bool budgeted fGLContext.caps()->markConfigAsValidColorAttachment(desc.fConfig); } } - fGPUStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, idDesc->fTexFBOID)); if (this->glCaps().usesImplicitMSAAResolve() && desc.fSampleCnt > 0) { @@ -1209,7 +1209,7 @@ bool GrGLGpu::attachStencilBufferToRenderTarget(GrStencilBuffer* sb, GrRenderTar GrGLuint rb = glsb->renderbufferID(); fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; - fGPUStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, fbo)); GL_CALL(FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, GR_GL_STENCIL_ATTACHMENT, @@ -1509,7 +1509,7 @@ void GrGLGpu::discard(GrRenderTarget* renderTarget) { GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(renderTarget); if (renderTarget->getUniqueID() != fHWBoundRenderTargetUniqueID) { fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; - fGPUStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, glRT->renderFBOID())); } switch (this->glCaps().invalidateFBType()) { @@ -1670,7 +1670,7 @@ bool GrGLGpu::onReadPixels(GrRenderTarget* target, case GrGLRenderTarget::kCanResolve_ResolveType: this->onResolveRenderTarget(tgt); // we don't track the state of the READ FBO ID. - fGPUStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); GL_CALL(BindFramebuffer(GR_GL_READ_FRAMEBUFFER, tgt->textureFBOID())); break; @@ -1768,7 +1768,7 @@ void GrGLGpu::flushRenderTarget(GrGLRenderTarget* target, const SkIRect* bound) uint32_t rtID = target->getUniqueID(); if (fHWBoundRenderTargetUniqueID != rtID) { - fGPUStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, target->renderFBOID())); #ifdef SK_DEBUG // don't do this check in Chromium -- this is causing @@ -1912,8 +1912,8 @@ void GrGLGpu::onResolveRenderTarget(GrRenderTarget* target) { // Some extensions automatically resolves the texture when it is read. if (this->glCaps().usesMSAARenderBuffers()) { SkASSERT(rt->textureFBOID() != rt->renderFBOID()); - fGPUStats.incRenderTargetBinds(); - fGPUStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); GL_CALL(BindFramebuffer(GR_GL_READ_FRAMEBUFFER, rt->renderFBOID())); GL_CALL(BindFramebuffer(GR_GL_DRAW_FRAMEBUFFER, rt->textureFBOID())); // make sure we go through flushRenderTarget() since we've modified @@ -2519,7 +2519,7 @@ GrGLuint GrGLGpu::bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLI SkASSERT(surface->asTexture()); GrGLuint texID = static_cast<GrGLTexture*>(surface->asTexture())->textureID(); GR_GL_CALL(this->glInterface(), GenFramebuffers(1, &tempFBOID)); - fGPUStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); GR_GL_CALL(this->glInterface(), BindFramebuffer(fboTarget, tempFBOID)); GR_GL_CALL(this->glInterface(), FramebufferTexture2D(fboTarget, GR_GL_COLOR_ATTACHMENT0, @@ -2532,7 +2532,7 @@ GrGLuint GrGLGpu::bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLI viewport->fHeight = surface->height(); } else { tempFBOID = 0; - fGPUStats.incRenderTargetBinds(); + fStats.incRenderTargetBinds(); GR_GL_CALL(this->glInterface(), BindFramebuffer(fboTarget, rt->renderFBOID())); *viewport = rt->getViewport(); } diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp index 46433f01c2..61932f3084 100644 --- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp +++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp @@ -276,7 +276,7 @@ bool GrGLFragmentShaderBuilder::compileAndAttachShaders(GrGLuint programId, GrGLuint fragShaderId = GrGLCompileAndAttachShader(gpu->glContext(), programId, GR_GL_FRAGMENT_SHADER, fragShaderSrc, - gpu->gpuStats()); + gpu->stats()); if (!fragShaderId) { return false; } diff --git a/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp b/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp index 573c553fa6..8be2531c96 100644 --- a/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp +++ b/src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp @@ -62,7 +62,7 @@ bool GrGLGeometryBuilder::compileAndAttachShaders(GrGLuint programId, GrGLuint geomShaderId = GrGLCompileAndAttachShader(glCtx, programId, GR_GL_GEOMETRY_SHADER, geomShaderSrc, - fProgramBuilder->gpu()->gpuStats()); + fProgramBuilder->gpu()->stats()); if (!geomShaderId) { return false; } diff --git a/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp b/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp index 4a0fee56b1..5265d203a5 100644 --- a/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp +++ b/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp @@ -21,7 +21,7 @@ GrGLuint GrGLCompileAndAttachShader(const GrGLContext& glCtx, GrGLuint programId, GrGLenum type, const SkString& shaderSrc, - GrContext::GPUStats* gpuStats) { + GrGpu::Stats* stats) { const GrGLInterface* gli = glCtx.interface(); GrGLuint shaderId; @@ -39,7 +39,7 @@ GrGLuint GrGLCompileAndAttachShader(const GrGLContext& glCtx, const GrGLchar* sourceStr = shaderSrc.c_str(); #endif GR_GL_CALL(gli, ShaderSource(shaderId, 1, &sourceStr, &sourceLength)); - gpuStats->incShaderCompilations(); + stats->incShaderCompilations(); GR_GL_CALL(gli, CompileShader(shaderId)); // Calling GetShaderiv in Chromium is quite expensive. Assume success in release builds. diff --git a/src/gpu/gl/builders/GrGLShaderStringBuilder.h b/src/gpu/gl/builders/GrGLShaderStringBuilder.h index ab8734f7c6..cf54253e80 100644 --- a/src/gpu/gl/builders/GrGLShaderStringBuilder.h +++ b/src/gpu/gl/builders/GrGLShaderStringBuilder.h @@ -9,7 +9,7 @@ #define GrGLShaderStringBuilder_DEFINED #include "GrAllocator.h" -#include "GrContext.h" +#include "GrGpu.h" #include "gl/GrGLContext.h" #include "SkTypes.h" @@ -17,6 +17,6 @@ GrGLuint GrGLCompileAndAttachShader(const GrGLContext& glCtx, GrGLuint programId, GrGLenum type, const SkString& shaderSrc, - GrContext::GPUStats* gpuStats); + GrGpu::Stats*); #endif diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp index f17e741169..f1671af54c 100644 --- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp +++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp @@ -85,9 +85,8 @@ bool GrGLVertexBuilder::compileAndAttachShaders(GrGLuint programId, vertShaderSrc.append("void main() {"); vertShaderSrc.append(fCode); vertShaderSrc.append("}\n"); - GrGLuint vertShaderId = GrGLCompileAndAttachShader(glCtx, programId, - GR_GL_VERTEX_SHADER, vertShaderSrc, - gpu->gpuStats()); + GrGLuint vertShaderId = GrGLCompileAndAttachShader(glCtx, programId, GR_GL_VERTEX_SHADER, + vertShaderSrc, gpu->stats()); if (!vertShaderId) { return false; } |