Exemplo n.º 1
0
void WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset,
                                 const dom::ArrayBuffer& src) {
  const FuncScope funcScope(*this, "bufferSubData");
  if (IsContextLost()) return;

  src.ComputeLengthAndData();
  BufferSubDataImpl(target, dstByteOffset, src.LengthAllowShared(),
                    src.DataAllowShared());
}
Exemplo n.º 2
0
void WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset,
                                 const dom::ArrayBufferView& src,
                                 GLuint srcElemOffset,
                                 GLuint srcElemCountOverride) {
  const FuncScope funcScope(*this, "bufferSubData");
  if (IsContextLost()) return;

  uint8_t* bytes;
  size_t byteLen;
  if (!ValidateArrayBufferView(src, srcElemOffset, srcElemCountOverride,
                               LOCAL_GL_INVALID_VALUE, &bytes, &byteLen)) {
    return;
  }

  BufferSubDataImpl(target, dstByteOffset, byteLen, bytes);
}
Exemplo n.º 3
0
void
WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset,
                            const dom::ArrayBufferView& src, GLuint srcElemOffset,
                            GLuint srcElemCountOverride)
{
    const char funcName[] = "bufferSubData";
    if (IsContextLost())
        return;

    uint8_t* bytes;
    size_t byteLen;
    if (!ValidateArrayBufferView(funcName, src, srcElemOffset, srcElemCountOverride,
                                 &bytes, &byteLen))
    {
        return;
    }

    BufferSubDataImpl(target, dstByteOffset, byteLen, bytes);
}