diff options
-rw-r--r-- | include/gpu/GrCaps.h | 5 | ||||
-rw-r--r-- | src/gpu/GrCaps.cpp | 1 | ||||
-rw-r--r-- | src/gpu/GrGpu.cpp | 11 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 6 |
4 files changed, 19 insertions, 4 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index fc682069ea..e2e44a5120 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -151,6 +151,10 @@ public: return fUseDrawInsteadOfPartialRenderTargetWrite; } + bool useDrawInsteadOfAllRenderTargetWrites() const { + return fUseDrawInsteadOfAllRenderTargetWrites; + } + bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } /** @@ -280,6 +284,7 @@ protected: // Driver workaround bool fUseDrawInsteadOfClear : 1; bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; + bool fUseDrawInsteadOfAllRenderTargetWrites : 1; // ANGLE workaround bool fPreferVRAMUseOverFlushes : 1; diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp index 2568e567fc..4fb05c14a1 100644 --- a/src/gpu/GrCaps.cpp +++ b/src/gpu/GrCaps.cpp @@ -115,6 +115,7 @@ GrCaps::GrCaps(const GrContextOptions& options) { fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedTexture; fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; fUseDrawInsteadOfPartialRenderTargetWrite = options.fUseDrawInsteadOfPartialRenderTargetWrite; + fUseDrawInsteadOfAllRenderTargetWrites = false; fPreferVRAMUseOverFlushes = true; } diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index ab8e5cb535..39d190e052 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -280,10 +280,13 @@ bool GrGpu::getWritePixelsInfo(GrSurface* dstSurface, int width, int height, siz return false; } - if (this->caps()->useDrawInsteadOfPartialRenderTargetWrite() && - SkToBool(dstSurface->asRenderTarget()) && - (width < dstSurface->width() || height < dstSurface->height())) { - ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); + if (SkToBool(dstSurface->asRenderTarget())) { + if (this->caps()->useDrawInsteadOfAllRenderTargetWrites()) { + ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); + } else if (this->caps()->useDrawInsteadOfPartialRenderTargetWrite() && + (width < dstSurface->width() || height < dstSurface->height())) { + ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); + } } if (!this->onGetWritePixelsInfo(dstSurface, width, height, rowBytes, srcConfig, drawPreference, diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 6dc5ee8c4f..fd888d6c36 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -456,6 +456,12 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, fUseDrawInsteadOfPartialRenderTargetWrite = true; } + // Texture uploads sometimes seem to be ignored to textures bound to FBOS on Tegra3. + if (kTegra3_GrGLRenderer == ctxInfo.renderer()) { + fUseDrawInsteadOfPartialRenderTargetWrite = true; + fUseDrawInsteadOfAllRenderTargetWrites = true; + } + #ifdef SK_BUILD_FOR_WIN // On ANGLE deferring flushes can lead to GPU starvation fPreferVRAMUseOverFlushes = !isANGLE; |