Reland "EqualsForTesting() instead of operator== for cc paint classes"

This reverts commit 5301ebaea91b59c95c444e6aa900c0e3342f7d58.

This reland fixes MSAN failures:
1. The original CL exposed uninitialized use_cache field of
   ClipPathOp and DrawPathOp after Deserialize(). Now specify the
   default value in the class declarations.
2. memcpy() in DrawingDisplayItem::EqualsForUnderInvalidationImpl()
   touched uninitialized gaps in the PaintRecord. Now skip the
   condition for MSAN.

Original change's description:
> Revert "EqualsForTesting() instead of operator== for cc paint classes"
>
> This reverts commit c005c73b5c6bc78195e17b7f588fa41004ab33e0.
>
> Reason for revert: causes many consistent failures in Linux MSan bot
> https://ci.chromium.org/p/chromium/builders/ci/Linux%20MSan%20Tests
> https://screenshot.googleplex.com/5vLMtwhGdcicjoW
> ...
>
> Original change's description:
> > EqualsForTesting() instead of operator== for cc paint classes
> >
> > == operators of cc paint classes only meet the requirement of test
> > code, not production code. Rename them to prevent them from being
> > called from production code.
> >
> > Production codes that called the functions are changed to use
> > alternative ways:
> > - blink::BoxReflection::operator== (called from
> > FilterOperations::operator==) is changed to return true only if the
> > mask PaintRecords are both empty.
> > - blink::DrawingDisplayItem::EqualsForUnderInvalidationImpl() is
> > changed to compare PaintRecord using memcmp before comparing bitmaps.
> >
> > Change-Id: I6a49006845ba500c771fa3437a8ff86444bcfb41
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4117789
> > Reviewed-by: Vladimir Levin <[email protected]>
> > Owners-Override: Xianzhu Wang <[email protected]>
> > Commit-Queue: Xianzhu Wang <[email protected]>
> > Cr-Commit-Position: refs/heads/main@{#1090444}
>
> Change-Id: I689ce1e33411e53d140ca90b30a036767c0d17e5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4149233
> Owners-Override: Mark Pearson <[email protected]>
> Commit-Queue: Rubber Stamper <[email protected]>
> Auto-Submit: Mark Pearson <[email protected]>
> Bot-Commit: Rubber Stamper <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1090583}

Change-Id: I15d4cc9d3bff8b9ac744e21ff6e9826da3f797ab
Cq-Include-Trybots: luci.chromium.try:linux_chromium_chromeos_msan_rel_ng,linux_chromium_msan_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4149507
Commit-Queue: Xianzhu Wang <[email protected]>
Reviewed-by: Vladimir Levin <[email protected]>
Owners-Override: Xianzhu Wang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1091525}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 30e89fd..18a09f3 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -563,6 +563,7 @@
     "test/mock_layer_tree_mutator.cc",
     "test/mock_layer_tree_mutator.h",
     "test/mock_occlusion_tracker.h",
+    "test/paint_image_matchers.h",
     "test/paint_op_helper.h",
     "test/paint_op_matchers.h",
     "test/pixel_comparator.cc",