Turn off buffer mapping in Chromium
authorbsalomon <bsalomon@google.com>
Fri, 26 Jun 2015 18:38:25 +0000 (11:38 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 26 Jun 2015 18:38:25 +0000 (11:38 -0700)
BUG=chromium:496224

Review URL: https://codereview.chromium.org/1211363006

src/gpu/gl/GrGLCaps.cpp

index 22fd053..69580ec 100644 (file)
@@ -377,7 +377,14 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
     // On many GPUs, map memory is very expensive, so we effectively disable it here by setting the
     // threshold to the maximum unless the client gives us a hint that map memory is cheap.
     if (fGeometryBufferMapThreshold < 0) {
+        // We think mapping on Chromium will be cheaper once we know ahead of time how much space
+        // we will use for all GrBatchs. Right now we might wind up mapping a large buffer and using
+        // a small subset.
+#if 0
         fGeometryBufferMapThreshold = kChromium_GrGLDriver == ctxInfo.driver() ? 0 : SK_MaxS32;
+#else
+        fGeometryBufferMapThreshold = SK_MaxS32;
+#endif
     }
 
     if (kGL_GrGLStandard == standard) {