Bug 823148. Make IsPatternSupportedByD2D match its name. r=bgirard

The name of this function got inverted but its implementation stayed the same.
This commit is contained in:
Jeff Muizelaar 2012-12-19 23:19:45 -05:00
parent ef37083bac
commit 1a3fed9d72
2 changed files with 6 additions and 6 deletions

View File

@ -1561,7 +1561,7 @@ DrawTargetD2D::GetRTForOperation(CompositionOp aOperator, const Pattern &aPatter
void
DrawTargetD2D::FinalizeRTForOperation(CompositionOp aOperator, const Pattern &aPattern, const Rect &aBounds)
{
if (aOperator == OP_OVER && !IsPatternSupportedByD2D(aPattern)) {
if (aOperator == OP_OVER && IsPatternSupportedByD2D(aPattern)) {
return;
}
@ -2142,7 +2142,7 @@ DrawTargetD2D::FillGlyphsManual(ScaledFontDWrite *aFont,
TemporaryRef<ID2D1Brush>
DrawTargetD2D::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
{
if (IsPatternSupportedByD2D(aPattern)) {
if (!IsPatternSupportedByD2D(aPattern)) {
RefPtr<ID2D1SolidColorBrush> colBrush;
mRT->CreateSolidColorBrush(D2D1::ColorF(1.0f, 1.0f, 1.0f, 1.0f), byRef(colBrush));
return colBrush;

View File

@ -138,24 +138,24 @@ static inline D2D1_PIXEL_FORMAT D2DPixelFormat(SurfaceFormat aFormat)
static inline bool IsPatternSupportedByD2D(const Pattern &aPattern)
{
if (aPattern.GetType() != PATTERN_RADIAL_GRADIENT) {
return false;
return true;
}
const RadialGradientPattern *pat =
static_cast<const RadialGradientPattern*>(&aPattern);
if (pat->mRadius1 != 0) {
return true;
return false;
}
Point diff = pat->mCenter2 - pat->mCenter1;
if (sqrt(diff.x * diff.x + diff.y * diff.y) >= pat->mRadius2) {
// Inner point lies outside the circle.
return true;
return false;
}
return false;
return true;
}
/**