Bug 823148. Make IsPatternSupportedByD2D match its name. r=bgirard
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 19 Dec 2012 23:19:45 -0500
changeset 125695 68e0f5e187e17f6da5fb3b077308e8b8a726dc17
parent 125694 cd7f3548011c7a66a958ee7e3f174532dd33ee11
child 125696 60f6033378d4b07d1e1c507bf3bcdd6957d50e57
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgirard
bugs823148
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 823148. Make IsPatternSupportedByD2D match its name. r=bgirard The name of this function got inverted but its implementation stayed the same.
gfx/2d/DrawTargetD2D.cpp
gfx/2d/HelpersD2D.h
--- a/gfx/2d/DrawTargetD2D.cpp
+++ b/gfx/2d/DrawTargetD2D.cpp
@@ -1556,17 +1556,17 @@ DrawTargetD2D::GetRTForOperation(Composi
  * contents) to the rendertarget using the requested composition operation.
  * In order to respect clip for operations which are unbound by their mask,
  * the old content of the surface outside the clipped area may be blended back
  * to the surface.
  */
 void
 DrawTargetD2D::FinalizeRTForOperation(CompositionOp aOperator, const Pattern &aPattern, const Rect &aBounds)
 {
-  if (aOperator == OP_OVER && !IsPatternSupportedByD2D(aPattern)) {
+  if (aOperator == OP_OVER && IsPatternSupportedByD2D(aPattern)) {
     return;
   }
 
   if (!mTempRT) {
     return;
   }
 
   PopClipsFromRT(mTempRT);
@@ -2137,17 +2137,17 @@ DrawTargetD2D::FillGlyphsManual(ScaledFo
   SetScissorToRect(clipBounds);
   mDevice->Draw(4, 0);
   return true;
 }
 
 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;
   }
 
   if (aPattern.GetType() == PATTERN_COLOR) {
     RefPtr<ID2D1SolidColorBrush> colBrush;
     Color color = static_cast<const ColorPattern*>(&aPattern)->mColor;
--- a/gfx/2d/HelpersD2D.h
+++ b/gfx/2d/HelpersD2D.h
@@ -133,34 +133,34 @@ static inline D2D1_ALPHA_MODE AlphaMode(
 static inline D2D1_PIXEL_FORMAT D2DPixelFormat(SurfaceFormat aFormat)
 {
   return D2D1::PixelFormat(DXGIFormat(aFormat), AlphaMode(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;
 }
 
 /**
  * This structure is used to pass rectangles to our shader constant. We can use
  * this for passing rectangular areas to SetVertexShaderConstant. In the format
  * of a 4 component float(x,y,width,height). Our vertex shader can then use
  * this to construct rectangular positions from the 0,0-1,1 quad that we source
  * it with.