Reland "remove SkCanvas::kIsOpaque_SaveLayerFlag"

This reverts the revert 9ff8c8c073ba553dc8b22bb9aacc23949292f72f.

Original:

    This is a performance-only hint that no one but fuzzers
    is using.  It's even explicitly filtered out in Android.

    The fuzzers have noticed they can trick us into allocating
    uninitialized memory and treating it as opaque, blending
    uninitialized pixels, etc.

    Since no one's using this, we can just kill the bit.

    Bug: skia:7566, chromium:808830

Docs-Preview: https://skia.org/?cl=105282
Change-Id: I4326c663f777aa373ff7ec9f319519da9729350d
Reviewed-on: https://skia-review.googlesource.com/105282
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 9f13a71..2667f8f 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1036,20 +1036,18 @@
     }
 }
 
-static SkImageInfo make_layer_info(const SkImageInfo& prev, int w, int h, bool isOpaque,
-                                   const SkPaint* paint) {
+static SkImageInfo make_layer_info(const SkImageInfo& prev, int w, int h, const SkPaint* paint) {
     // need to force L32 for now if we have an image filter. Once filters support other colortypes
     // e.g. sRGB or F16, we can remove this check
     // SRGBTODO: Can we remove this check now?
     const bool hasImageFilter = paint && paint->getImageFilter();
 
-    SkAlphaType alphaType = isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
     if ((prev.bytesPerPixel() < 4) || hasImageFilter) {
         // force to L32
-        return SkImageInfo::MakeN32(w, h, alphaType);
+        return SkImageInfo::MakeN32Premul(w, h);
     } else {
         // keep the same characteristics as the prev
-        return SkImageInfo::Make(w, h, prev.colorType(), alphaType, prev.refColorSpace());
+        return SkImageInfo::Make(w, h, prev.colorType(), kPremul_SkAlphaType, prev.refColorSpace());
     }
 }
 
@@ -1107,12 +1105,10 @@
         return;
     }
 
-    bool isOpaque = SkToBool(saveLayerFlags & kIsOpaque_SaveLayerFlag);
     SkPixelGeometry geo = fProps.pixelGeometry();
     if (paint) {
         // TODO: perhaps add a query to filters so we might preserve opaqueness...
         if (paint->getImageFilter() || paint->getColorFilter()) {
-            isOpaque = false;
             geo = kUnknown_SkPixelGeometry;
         }
     }
@@ -1123,8 +1119,7 @@
         return;
     }
 
-    SkImageInfo info = make_layer_info(priorDevice->imageInfo(), ir.width(), ir.height(), isOpaque,
-                                       paint);
+    SkImageInfo info = make_layer_info(priorDevice->imageInfo(), ir.width(), ir.height(), paint);
 
     sk_sp<SkBaseDevice> newDevice;
     {