diff options
Diffstat (limited to 'gpu/gl')
-rw-r--r-- | gpu/gl/GrGLCaps.cpp | 2 | ||||
-rw-r--r-- | gpu/gl/GrGLEffect.h | 1 | ||||
-rw-r--r-- | gpu/gl/GrGLInterface.cpp | 2 | ||||
-rw-r--r-- | gpu/gl/GrGLProgram.cpp | 2 | ||||
-rw-r--r-- | gpu/gl/GrGLShaderBuilder.h | 19 | ||||
-rw-r--r-- | gpu/gl/GrGLTexture.cpp | 2 | ||||
-rw-r--r-- | gpu/gl/GrGpuGL.cpp | 25 | ||||
-rw-r--r-- | gpu/gl/GrGpuGL_program.cpp | 2 | ||||
-rw-r--r-- | gpu/gl/SkGLContextHelper.cpp | 2 | ||||
-rw-r--r-- | gpu/gl/debug/GrGLCreateDebugInterface.cpp | 2 | ||||
-rw-r--r-- | gpu/gl/win/GrGLCreateNativeInterface_win.cpp | 2 | ||||
-rw-r--r-- | gpu/gl/win/SkNativeGLContext_win.cpp | 2 |
12 files changed, 40 insertions, 23 deletions
diff --git a/gpu/gl/GrGLCaps.cpp b/gpu/gl/GrGLCaps.cpp index 1a39ba59..8d8c0225 100644 --- a/gpu/gl/GrGLCaps.cpp +++ b/gpu/gl/GrGLCaps.cpp @@ -11,8 +11,6 @@ #include "SkTSearch.h" #include "SkTSort.h" -SK_DEFINE_INST_COUNT(GrGLCaps) - GrGLCaps::GrGLCaps() { this->reset(); } diff --git a/gpu/gl/GrGLEffect.h b/gpu/gl/GrGLEffect.h index b6807383..1cc3df24 100644 --- a/gpu/gl/GrGLEffect.h +++ b/gpu/gl/GrGLEffect.h @@ -40,6 +40,7 @@ class GrGLEffect { public: typedef GrBackendEffectFactory::EffectKey EffectKey; typedef GrGLProgramEffects::TransformedCoordsArray TransformedCoordsArray; + typedef GrGLProgramEffects::TextureSampler TextureSampler; typedef GrGLProgramEffects::TextureSamplerArray TextureSamplerArray; enum { diff --git a/gpu/gl/GrGLInterface.cpp b/gpu/gl/GrGLInterface.cpp index 09f6a65e..e1c69e18 100644 --- a/gpu/gl/GrGLInterface.cpp +++ b/gpu/gl/GrGLInterface.cpp @@ -12,8 +12,6 @@ #include <stdio.h> -SK_DEFINE_INST_COUNT(GrGLInterface) - #if GR_GL_PER_GL_FUNC_CALLBACK namespace { void GrGLDefaultInterfaceCallback(const GrGLInterface*) {} diff --git a/gpu/gl/GrGLProgram.cpp b/gpu/gl/GrGLProgram.cpp index 5b030fa3..cac38b4b 100644 --- a/gpu/gl/GrGLProgram.cpp +++ b/gpu/gl/GrGLProgram.cpp @@ -17,8 +17,6 @@ #include "GrGLSL.h" #include "SkXfermode.h" -SK_DEFINE_INST_COUNT(GrGLProgram) - #define GL_CALL(X) GR_GL_CALL(fGpu->glInterface(), X) #define GL_CALL_RET(R, X) GR_GL_CALL_RET(fGpu->glInterface(), R, X) diff --git a/gpu/gl/GrGLShaderBuilder.h b/gpu/gl/GrGLShaderBuilder.h index 52c24ae3..103efa5a 100644 --- a/gpu/gl/GrGLShaderBuilder.h +++ b/gpu/gl/GrGLShaderBuilder.h @@ -208,6 +208,25 @@ public: const GrGLContextInfo& ctxInfo() const; + /** + * Helper for begining and ending a block in the fragment code. TODO: Make GrGLShaderBuilder + * aware of all blocks and turn single \t's into the correct number of tabs (or spaces) so that + * our shaders print pretty without effect writers tracking indentation. + */ + class FSBlock { + public: + FSBlock(GrGLShaderBuilder* builder) : fBuilder(builder) { + SkASSERT(NULL != builder); + fBuilder->fsCodeAppend("\t{\n"); + } + + ~FSBlock() { + fBuilder->fsCodeAppend("\t}\n"); + } + private: + GrGLShaderBuilder* fBuilder; + }; + protected: GrGpuGL* gpu() const { return fGpu; } diff --git a/gpu/gl/GrGLTexture.cpp b/gpu/gl/GrGLTexture.cpp index 97721225..856cfb12 100644 --- a/gpu/gl/GrGLTexture.cpp +++ b/gpu/gl/GrGLTexture.cpp @@ -8,8 +8,6 @@ #include "GrGLTexture.h" #include "GrGpuGL.h" -SK_DEFINE_INST_COUNT(GrGLTexID) - #define GPUGL static_cast<GrGpuGL*>(getGpu()) #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X) diff --git a/gpu/gl/GrGpuGL.cpp b/gpu/gl/GrGpuGL.cpp index 9cf39b65..4b5221c3 100644 --- a/gpu/gl/GrGpuGL.cpp +++ b/gpu/gl/GrGpuGL.cpp @@ -552,7 +552,12 @@ bool GrGpuGL::uploadTexData(const GrGLTexture::Desc& desc, SkAutoSMalloc<128 * 128> tempStorage; // paletted textures cannot be partially updated - bool useTexStorage = isNewTexture && + // We currently lazily create MIPMAPs when the we see a draw with + // GrTextureParams::kMipMap_FilterMode. Using texture storage requires that the + // MIP levels are all created when the texture is created. So for now we don't use + // texture storage. + bool useTexStorage = false && + isNewTexture && desc.fConfig != kIndex_8_GrPixelConfig && this->glCaps().texStorageSupport(); @@ -638,8 +643,7 @@ bool GrGpuGL::uploadTexData(const GrGLTexture::Desc& desc, desc.fWidth == width && desc.fHeight == height) { CLEAR_ERROR_BEFORE_ALLOC(this->glInterface()); if (useTexStorage) { - // We never resize or change formats of textures. We don't use - // mipmaps currently. + // We never resize or change formats of textures. GL_ALLOC_CALL(this->glInterface(), TexStorage2D(GR_GL_TEXTURE_2D, 1, // levels @@ -1276,6 +1280,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 +1527,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; diff --git a/gpu/gl/GrGpuGL_program.cpp b/gpu/gl/GrGpuGL_program.cpp index a777e8f3..a3beab1a 100644 --- a/gpu/gl/GrGpuGL_program.cpp +++ b/gpu/gl/GrGpuGL_program.cpp @@ -27,8 +27,6 @@ struct GrGpuGL::ProgramCache::Entry { unsigned int fLRUStamp; }; -SK_DEFINE_INST_COUNT(GrGpuGL::ProgramCache::Entry); - struct GrGpuGL::ProgramCache::ProgDescLess { bool operator() (const GrGLProgramDesc& desc, const Entry* entry) { SkASSERT(NULL != entry->fProgram.get()); diff --git a/gpu/gl/SkGLContextHelper.cpp b/gpu/gl/SkGLContextHelper.cpp index 6f0372dd..da446be0 100644 --- a/gpu/gl/SkGLContextHelper.cpp +++ b/gpu/gl/SkGLContextHelper.cpp @@ -8,8 +8,6 @@ #include "gl/SkGLContextHelper.h" #include "GrGLUtil.h" -SK_DEFINE_INST_COUNT(SkGLContextHelper) - SkGLContextHelper::SkGLContextHelper() : fFBO(0) , fColorBufferID(0) diff --git a/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/gpu/gl/debug/GrGLCreateDebugInterface.cpp index 2ccd1584..1a0e7acc 100644 --- a/gpu/gl/debug/GrGLCreateDebugInterface.cpp +++ b/gpu/gl/debug/GrGLCreateDebugInterface.cpp @@ -786,8 +786,6 @@ private: typedef GrGLInterface INHERITED; }; -SK_DEFINE_INST_COUNT(GrDebugGLInterface) - //////////////////////////////////////////////////////////////////////////////// const GrGLInterface* GrGLCreateDebugInterface() { GrGLInterface* interface = SkNEW(GrDebugGLInterface); diff --git a/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/gpu/gl/win/GrGLCreateNativeInterface_win.cpp index e9207b16..06e406f8 100644 --- a/gpu/gl/win/GrGLCreateNativeInterface_win.cpp +++ b/gpu/gl/win/GrGLCreateNativeInterface_win.cpp @@ -11,7 +11,7 @@ #include "gl/GrGLInterface.h" #include "gl/GrGLUtil.h" #define WIN32_LEAN_AND_MEAN -#include <Windows.h> +#include <windows.h> /* * Windows makes the GL funcs all be __stdcall instead of __cdecl :( diff --git a/gpu/gl/win/SkNativeGLContext_win.cpp b/gpu/gl/win/SkNativeGLContext_win.cpp index d8777274..392c2bc9 100644 --- a/gpu/gl/win/SkNativeGLContext_win.cpp +++ b/gpu/gl/win/SkNativeGLContext_win.cpp @@ -10,7 +10,7 @@ #include "SkWGL.h" #define WIN32_LEAN_AND_MEAN -#include <Windows.h> +#include <windows.h> SkNativeGLContext::AutoContextRestore::AutoContextRestore() { fOldHGLRC = wglGetCurrentContext(); |