Clarify that buffers of type GrGpuBufferType::kXferGpuToCpu are mapped for reading.

Don't allow GrGpuBuffer::updateData on kXferGpuToCpu (in GL this can resize the buffer
to a smaller size).

Don't call glBufferData with NULL prior to mapping for reading.

Don't set GL_MAP_WRITE_BIT when using glMapBufferRange for reading only.

Bug: skia:8962
Change-Id: I605d83fa40c7b170082c48a456436d97cf3b70a5
Reviewed-by: Jim Van Verth <>
Commit-Queue: Brian Salomon <>
5 files changed