зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1442355 - Add a getter for docshell's colormatrix. r=smaug
--HG-- extra : rebase_source : ceb177980b2da2e0efa3e78a68f9bc299386355f
This commit is contained in:
Родитель
401631cd0e
Коммит
528d0526a6
|
@ -14528,3 +14528,26 @@ nsDocShell::SetColorMatrix(float* aMatrix, uint32_t aMatrixLen)
|
|||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetColorMatrix(uint32_t* aMatrixLen, float** aMatrix)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aMatrixLen);
|
||||
*aMatrixLen = 0;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aMatrix);
|
||||
*aMatrix = nullptr;
|
||||
|
||||
if (mColorMatrix) {
|
||||
*aMatrix = (float*)moz_xmalloc(20 * sizeof(float));
|
||||
if (!*aMatrix) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(20 * sizeof(float) == sizeof(mColorMatrix->components));
|
||||
*aMatrixLen = 20;
|
||||
memcpy(*aMatrix, mColorMatrix->components, 20 * sizeof(float));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1186,6 +1186,9 @@ interface nsIDocShell : nsIDocShellTreeItem
|
|||
void setColorMatrix([array, size_is(aMatrixLen)] in float aMatrix,
|
||||
[optional] in unsigned long aMatrixLen);
|
||||
|
||||
void getColorMatrix([optional] out unsigned long aMatrixLen,
|
||||
[array, size_is(aMatrixLen), retval] out float aMatrix);
|
||||
|
||||
%{C++
|
||||
/**
|
||||
* These methods call nsDocShell::GetHTMLEditorInternal() and
|
||||
|
|
Загрузка…
Ссылка в новой задаче