зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1306112 - Inline singly-used ValidateDataRanges. - r=ethlin
MozReview-Commit-ID: EmnhpsHMgu7
This commit is contained in:
Родитель
97bf74701f
Коммит
07cf1bd20c
|
@ -64,10 +64,18 @@ WebGL2Context::CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
|
|||
return;
|
||||
}
|
||||
|
||||
if (readBuffer == writeBuffer &&
|
||||
!ValidateDataRanges(readOffset, writeOffset, size, funcName))
|
||||
{
|
||||
return;
|
||||
if (readBuffer == writeBuffer) {
|
||||
MOZ_ASSERT((CheckedInt<WebGLsizeiptr>(readOffset) + size).isValid());
|
||||
MOZ_ASSERT((CheckedInt<WebGLsizeiptr>(writeOffset) + size).isValid());
|
||||
|
||||
const bool separate = (readOffset + size < writeOffset ||
|
||||
writeOffset + size < readOffset);
|
||||
if (!separate) {
|
||||
ErrorInvalidValue("%s: ranges [readOffset, readOffset + size) and"
|
||||
" [writeOffset, writeOffset + size) overlap",
|
||||
funcName);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const auto& readType = readBuffer->Content();
|
||||
|
|
|
@ -1499,7 +1499,6 @@ protected:
|
|||
bool ValidateBlendFuncSrcEnum(GLenum mode, const char* info);
|
||||
bool ValidateBlendFuncEnumsCompatibility(GLenum sfactor, GLenum dfactor,
|
||||
const char* info);
|
||||
bool ValidateDataRanges(WebGLintptr readOffset, WebGLintptr writeOffset, WebGLsizeiptr size, const char* info);
|
||||
bool ValidateComparisonEnum(GLenum target, const char* info);
|
||||
bool ValidateStencilOpEnum(GLenum action, const char* info);
|
||||
bool ValidateFaceEnum(GLenum face, const char* info);
|
||||
|
|
|
@ -122,27 +122,6 @@ WebGLContext::ValidateBlendFuncEnumsCompatibility(GLenum sfactor,
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check data ranges [readOffset, readOffset + size] and [writeOffset,
|
||||
* writeOffset + size] for overlap.
|
||||
*
|
||||
* It is assumed that offset and size have already been validated.
|
||||
*/
|
||||
bool
|
||||
WebGLContext::ValidateDataRanges(WebGLintptr readOffset, WebGLintptr writeOffset, WebGLsizeiptr size, const char* info)
|
||||
{
|
||||
MOZ_ASSERT((CheckedInt<WebGLsizeiptr>(readOffset) + size).isValid());
|
||||
MOZ_ASSERT((CheckedInt<WebGLsizeiptr>(writeOffset) + size).isValid());
|
||||
|
||||
bool separate = (readOffset + size < writeOffset || writeOffset + size < readOffset);
|
||||
if (!separate) {
|
||||
ErrorInvalidValue("%s: ranges [readOffset, readOffset + size) and [writeOffset, "
|
||||
"writeOffset + size) overlap", info);
|
||||
}
|
||||
|
||||
return separate;
|
||||
}
|
||||
|
||||
bool
|
||||
WebGLContext::ValidateComparisonEnum(GLenum target, const char* info)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче