Fix bug in op chaining

I created this problem with my fix to crbug.com/1108475

Bug: 1112259

Change-Id: Ieb001fa61bd9ed68dcae43e7d511b4581f16ef0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308638
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index d3a1c62..f43c9b1 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -993,7 +993,7 @@
     CombineResult onCombineIfPossible(GrOp* t, GrRecordingContext::Arenas*,
                                       const GrCaps& caps) override {
         TRACE_EVENT0("skia.gpu", TRACE_FUNC);
-        const auto* that = t->cast<TextureOp>();
+        auto* that = t->cast<TextureOp>();
 
         SkDEBUGCODE(this->validate();)
         SkDEBUGCODE(that->validate();)
@@ -1070,7 +1070,16 @@
         fMetadata.fTotalQuadCount += that->fQuads.count();
 
         if (upgradeToCoverageAAOnMerge) {
+            // This merger may be the start of a concatenation of two chains. When one
+            // of the chains mutates its AA the other must follow suit or else the above AA
+            // check may prevent later ops from chaining together. A specific example of this is
+            // when chain2 is prepended onto chain1:
+            //  chain1 (that): opA (non-AA/mergeable) opB (non-AA/non-mergeable)
+            //  chain2 (this): opC (cov-AA/non-mergeable) opD (cov-AA/mergeable)
+            // W/o this propagation, after opD & opA merge, opB and opC would say they couldn't
+            // chain - which would stop the concatenation process.
             this->propagateCoverageAAThroughoutChain();
+            that->propagateCoverageAAThroughoutChain();
         }
 
         SkDEBUGCODE(this->validate();)