Bug 1628692 - Fix FallibleTArray handling in gfxContext::CurrentDash. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D71576
This commit is contained in:
Simon Giesecke 2020-04-29 08:58:36 +00:00
parent 3d350bb101
commit d62827d0da

View File

@ -41,7 +41,7 @@ UserDataKey gfxContext::sDontUseAsSourceKey;
# define CURRENTSTATE_CHANGED()
#endif
PatternFromState::operator mozilla::gfx::Pattern&() {
PatternFromState::operator mozilla::gfx::Pattern &() {
gfxContext::AzureState& state = mContext->CurrentState();
if (state.pattern) {
@ -432,12 +432,10 @@ bool gfxContext::CurrentDash(FallibleTArray<Float>& dashes,
const AzureState& state = CurrentState();
int count = state.strokeOptions.mDashLength;
if (count <= 0 || !dashes.SetLength(count, fallible)) {
if (count <= 0 || !dashes.Assign(state.dashPattern, fallible)) {
return false;
}
dashes = state.dashPattern;
*offset = state.strokeOptions.mDashOffset;
return true;