Bug 1382257 - (followup) Draw border image if nsCSSBorderImageRenderer was created successfully. r=me.
authorcku <cku@mozilla.com>
Mon, 24 Jul 2017 13:27:54 +0800
changeset 419278 12a1858f250b2b206ba0640cead2945fce97695e
parent 419223 5edfe512460d3d2f5f9577e7f76c4361bc9f7292
child 419279 be884de5820a867b7548d893c03958671029b507
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1382257
milestone56.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 1382257 - (followup) Draw border image if nsCSSBorderImageRenderer was created successfully. r=me. MozReview-Commit-ID: 7SJwCt9XUBF
layout/painting/nsCSSRendering.cpp
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -828,23 +828,22 @@ nsCSSRendering::PaintBorderWithStyleBord
     }
 
     // Creating the border image renderer will request a decode, and we rely on
     // that happening.
     Maybe<nsCSSBorderImageRenderer> renderer =
       nsCSSBorderImageRenderer::CreateBorderImageRenderer(aPresContext, aForFrame, aBorderArea,
                                                           aStyleBorder, aDirtyRect, aSkipSides,
                                                           irFlags, &result);
-    if (aStyleBorder.IsBorderImageLoaded()) {
-      if (renderer) {
-        result &= renderer->DrawBorderImage(aPresContext, aRenderingContext,
-                                            aForFrame, aDirtyRect);
-      }
-
-      return result;
+    // renderer was created successfully, which means border image is ready to
+    // be used.
+    if (renderer) {
+      MOZ_ASSERT(result == DrawResult::SUCCESS);
+      return renderer->DrawBorderImage(aPresContext, aRenderingContext,
+                                       aForFrame, aDirtyRect);
     }
   }
 
   DrawResult result = DrawResult::SUCCESS;
 
   // If we had a border-image, but it wasn't loaded, then we should return
   // DrawResult::NOT_READY; we'll want to try again if we do a paint with sync
   // decoding enabled.