Disable buffer to buffer transfers on WebGL.

Our implementation currently requires GrGLCaps::fTransferBufferType to
be set to something other than kNone for this to work. We haven't
enabled transfer surface/buffer transfers yet and so are not
setting this value. To do so we'd have to more thoroughly understand
the additional buffer restrictions in WebGL compared to GLES and it
isn't currently a priority.

Bug: skia:13461
Change-Id: I033b9d2c7a3116bdc95bcdbae1e4ac86c9f1b2c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551894
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/src/gpu/ganesh/gl/GrGLCaps.cpp b/src/gpu/ganesh/gl/GrGLCaps.cpp
index e8ce6c5..0ed883c 100644
--- a/src/gpu/ganesh/gl/GrGLCaps.cpp
+++ b/src/gpu/ganesh/gl/GrGLCaps.cpp
@@ -514,6 +514,11 @@
         fMapBufferFlags = kNone_MapFlags;
     }
 
+    // Buffers have more restrictions in WebGL than GLES. For example,
+    // https://www.khronos.org/registry/webgl/specs/latest/2.0/#BUFFER_OBJECT_BINDING
+    // We therefore haven't attempted to support mapping or transfers between buffers and surfaces
+    // or between buffers.
+
     if (GR_IS_GR_GL(standard)) {
         if (version >= GR_GL_VER(2, 1) || ctxInfo.hasExtension("GL_ARB_pixel_buffer_object") ||
             ctxInfo.hasExtension("GL_EXT_pixel_buffer_object")) {
@@ -539,9 +544,6 @@
 //            fTransferFromSurfaceToBufferSupport = false;
 //            fTransferBufferType = TransferBufferType::kChromium;
         }
-    } else if (GR_IS_GR_WEBGL(standard)) {
-        fTransferFromBufferToTextureSupport = false;
-        fTransferFromSurfaceToBufferSupport = false;
     }
 
     if (GR_IS_GR_GL(standard) &&
@@ -550,8 +552,6 @@
     } else if (GR_IS_GR_GL_ES(standard) &&
                (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_NV_copy_buffer"))) {
         fTransferFromBufferToBufferSupport = true;
-    } else if (GR_IS_GR_WEBGL(standard) && version >= GR_GL_VER(2,0)) {
-        fTransferFromBufferToBufferSupport = true;
     }
 
     // On many GPUs, map memory is very expensive, so we effectively disable it here by setting the