Bug 1495025 - P7. Silence compilation warning r=mattwoodrow
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 08 Oct 2018 18:57:58 +0000
changeset 495874 2a9f2418655a1c0e544145490f278bab751392ab
parent 495873 72189fd7d7b2986af012fa3e0ba93f7af0aad36d
child 495875 1bae9022b97eed6aa80b4c6beb800eb7e105ce7e
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1495025
milestone64.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 1495025 - P7. Silence compilation warning r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D7977
gfx/2d/DrawTargetD2D1.cpp
--- a/gfx/2d/DrawTargetD2D1.cpp
+++ b/gfx/2d/DrawTargetD2D1.cpp
@@ -206,17 +206,17 @@ DrawTargetD2D1::DrawSurface(SourceSurfac
   RefPtr<ID2D1Image> image = GetImageForSurface(aSurface, transform, ExtendMode::CLAMP);
 
   if (!image) {
     gfxWarning() << *this << ": Unable to get D2D image for surface.";
     return;
   }
 
   RefPtr<ID2D1Bitmap> bitmap;
-  HRESULT hr;
+  HRESULT hr = E_FAIL;
   if (aSurface->GetType() == SurfaceType::D2D1_1_IMAGE) {
     // If this is called with a DataSourceSurface it might do a partial upload
     // that our DrawBitmap call doesn't support.
     hr = image->QueryInterface((ID2D1Bitmap**)getter_AddRefs(bitmap));
   }
 
   if (SUCCEEDED(hr) && bitmap && aSurfOptions.mSamplingBounds == SamplingBounds::UNBOUNDED) {
     mDC->DrawBitmap(bitmap, D2DRect(aDest), aOptions.mAlpha,
@@ -641,17 +641,17 @@ DrawTargetD2D1::FillGlyphs(ScaledFont *a
     aaMode = aOptions.mAntialiasMode;
   }
 
   PrepareForDrawing(aOptions.mCompositionOp, aPattern);
 
   bool forceClearType = false;
   if (!CurrentLayer().mIsOpaque && mPermitSubpixelAA &&
       aOptions.mCompositionOp == CompositionOp::OP_OVER && aaMode == AntialiasMode::SUBPIXEL) {
-    forceClearType = true;    
+    forceClearType = true;
   }
 
 
   D2D1_TEXT_ANTIALIAS_MODE d2dAAMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT;
 
   switch (aaMode) {
   case AntialiasMode::NONE:
     d2dAAMode = D2D1_TEXT_ANTIALIAS_MODE_ALIASED;
@@ -762,17 +762,17 @@ DrawTargetD2D1::Mask(const Pattern &aSou
                                        D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
                                        D2D1::IdentityMatrix(),
                                        1.0f, mask),
                  nullptr);
 
   Rect rect(0, 0, (Float)mSize.width, (Float)mSize.height);
   Matrix mat = mTransform;
   mat.Invert();
-  
+
   mDC->FillRectangle(D2DRect(mat.TransformBounds(rect)), source);
 
   mDC->PopLayer();
 
   FinalizeDrawing(aOptions.mCompositionOp, aSource);
 }
 
 void
@@ -1742,27 +1742,27 @@ DrawTargetD2D1::GetInverseClippedGeometr
   return inverseGeom.forget();
 }
 
 void
 DrawTargetD2D1::PopAllClips()
 {
   if (CurrentLayer().mClipsArePushed) {
     PopClipsFromDC(mDC);
-  
+
     CurrentLayer().mClipsArePushed = false;
   }
 }
 
 void
 DrawTargetD2D1::PushAllClips()
 {
   if (!CurrentLayer().mClipsArePushed) {
     PushClipsToDC(mDC);
-  
+
     CurrentLayer().mClipsArePushed = true;
   }
 }
 
 void
 DrawTargetD2D1::PushClipsToDC(ID2D1DeviceContext *aDC, bool aForceIgnoreAlpha, const D2D1_RECT_F& aMaxRect)
 {
   mDC->SetTransform(D2D1::IdentityMatrix());
@@ -2008,17 +2008,17 @@ DrawTargetD2D1::GetImageForSurface(Sourc
       // Sometimes we have a dual drawtarget but the underlying targets
       // are d2d surfaces. Let's not readback and reupload in those cases.
       SourceSurfaceDual* surface = static_cast<SourceSurfaceDual*>(aSurface);
       SourceSurface* first = surface->GetFirstSurface();
       if (first->GetType() == SurfaceType::D2D1_1_IMAGE) {
         MOZ_ASSERT(surface->SameSurfaceTypes());
         SourceSurfaceD2D1* d2dSurface = static_cast<SourceSurfaceD2D1*>(first);
         image = d2dSurface->GetImage();
-        AddDependencyOnSource(d2dSurface); 
+        AddDependencyOnSource(d2dSurface);
         break;
       }
       // Otherwise fall through
   }
   default:
     {
       RefPtr<DataSourceSurface> dataSurf = aSurface->GetDataSurface();
       if (!dataSurf) {