cc: Add PaintOp::operator==

This moves test-only paint op comparisons from unittests into paint ops
themselves.

This is to support a fuzzing correctness test that serializing and then
deserializing an op results in the same op.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I351b4fb5329ee9ff64d54bb9dd49d0a1a34f7b13
Reviewed-on: https://chromium-review.googlesource.com/777840
Reviewed-by: Khushal <[email protected]>
Commit-Queue: enne <[email protected]>
Cr-Commit-Position: refs/heads/master@{#517675}
diff --git a/cc/paint/paint_image.cc b/cc/paint/paint_image.cc
index db04151..25ca3a3 100644
--- a/cc/paint/paint_image.cc
+++ b/cc/paint/paint_image.cc
@@ -31,15 +31,29 @@
 PaintImage& PaintImage::operator=(PaintImage&& other) = default;
 
 bool PaintImage::operator==(const PaintImage& other) const {
-  return sk_image_ == other.sk_image_ && paint_record_ == other.paint_record_ &&
-         paint_record_rect_ == other.paint_record_rect_ &&
-         paint_record_content_id_ == other.paint_record_content_id_ &&
-         paint_image_generator_ == other.paint_image_generator_ &&
-         id_ == other.id_ && animation_type_ == other.animation_type_ &&
-         completion_state_ == other.completion_state_ &&
-         subset_rect_ == other.subset_rect_ &&
-         frame_index_ == other.frame_index_ &&
-         is_multipart_ == other.is_multipart_;
+  if (sk_image_ != other.sk_image_)
+    return false;
+  if (paint_record_ != other.paint_record_)
+    return false;
+  if (paint_record_rect_ != other.paint_record_rect_)
+    return false;
+  if (paint_record_content_id_ != other.paint_record_content_id_)
+    return false;
+  if (paint_image_generator_ != other.paint_image_generator_)
+    return false;
+  if (id_ != other.id_)
+    return false;
+  if (animation_type_ != other.animation_type_)
+    return false;
+  if (completion_state_ != other.completion_state_)
+    return false;
+  if (subset_rect_ != other.subset_rect_)
+    return false;
+  if (frame_index_ != other.frame_index_)
+    return false;
+  if (is_multipart_ != other.is_multipart_)
+    return false;
+  return true;
 }
 
 // static