Bug 839621 - qcms_transform_create can return null, so indirect callers need to be ready for it as well. r=jmuizelaar

This commit is contained in:
Milan Sreckovic 2013-02-08 15:46:26 -05:00
parent 48a6cefff5
commit 8dbfb840d9
2 changed files with 10 additions and 4 deletions

View File

@ -1269,7 +1269,9 @@ gfxContext::SetColor(const gfxRGBA& c)
if (gfxPlatform::GetCMSMode() == eCMSMode_All) {
gfxRGBA cms;
gfxPlatform::TransformPixel(c, cms, gfxPlatform::GetCMSRGBTransform());
qcms_transform *transform = gfxPlatform::GetCMSRGBTransform();
if (transform)
gfxPlatform::TransformPixel(c, cms, transform);
// Use the original alpha to avoid unnecessary float->byte->float
// conversion errors
@ -1285,7 +1287,9 @@ gfxContext::SetColor(const gfxRGBA& c)
if (gfxPlatform::GetCMSMode() == eCMSMode_All) {
gfxRGBA cms;
gfxPlatform::TransformPixel(c, cms, gfxPlatform::GetCMSRGBTransform());
qcms_transform *transform = gfxPlatform::GetCMSRGBTransform();
if (transform)
gfxPlatform::TransformPixel(c, cms, transform);
// Use the original alpha to avoid unnecessary float->byte->float
// conversion errors

View File

@ -80,7 +80,9 @@ gfxPattern::AddColorStop(gfxFloat offset, const gfxRGBA& c)
mStops = NULL;
if (gfxPlatform::GetCMSMode() == eCMSMode_All) {
gfxRGBA cms;
gfxPlatform::TransformPixel(c, cms, gfxPlatform::GetCMSRGBTransform());
qcms_transform *transform = gfxPlatform::GetCMSRGBTransform();
if (transform)
gfxPlatform::TransformPixel(c, cms, transform);
// Use the original alpha to avoid unnecessary float->byte->float
// conversion errors
@ -431,4 +433,4 @@ gfxPattern::AdjustTransformForPattern(Matrix &aPatternTransform,
// device space to current user space.
aPatternTransform = aPatternTransform * *aOriginalTransform * mat;
aPatternTransform.NudgeToIntegers();
}
}