Rename SurfaceLayer::hit_testable_ to surface_hit_testable_

We want to propagate pointer-events: none information to cc to generate
correct hit testing data for viz. The plan is to have blink set the hit
testable bit on cc::Layers. In order to disambiguate the bit in surface
layer that represents the origin of the surface, we want to rename the
variable.

Bug: 841358
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I207815dcfad0f29b222b0a39c350f1e926aedac9
Reviewed-on: https://chromium-review.googlesource.com/1052506
Reviewed-by: Bo <[email protected]>
Reviewed-by: Robert Kroeger <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Commit-Queue: Xianda Sun <[email protected]>
Cr-Commit-Position: refs/heads/master@{#558450}
diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc
index 8a123ca..6124fe4 100644
--- a/cc/layers/surface_layer.cc
+++ b/cc/layers/surface_layer.cc
@@ -59,10 +59,10 @@
   SetNeedsPushProperties();
 }
 
-void SurfaceLayer::SetHitTestable(bool hit_testable) {
-  if (hit_testable_ == hit_testable)
+void SurfaceLayer::SetSurfaceHitTestable(bool surface_hit_testable) {
+  if (surface_hit_testable_ == surface_hit_testable)
     return;
-  hit_testable_ = hit_testable;
+  surface_hit_testable_ = surface_hit_testable;
   SetNeedsPushProperties();
 }
 
@@ -100,7 +100,7 @@
   deadline_in_frames_ = 0u;
   layer_impl->SetFallbackSurfaceId(fallback_surface_id_);
   layer_impl->SetStretchContentToFillBounds(stretch_content_to_fill_bounds_);
-  layer_impl->SetHitTestable(hit_testable_);
+  layer_impl->SetSurfaceHitTestable(surface_hit_testable_);
 }
 
 }  // namespace cc
diff --git a/cc/layers/surface_layer.h b/cc/layers/surface_layer.h
index 3ed0b9a..87c5a26 100644
--- a/cc/layers/surface_layer.h
+++ b/cc/layers/surface_layer.h
@@ -32,8 +32,8 @@
     return stretch_content_to_fill_bounds_;
   }
 
-  void SetHitTestable(bool hit_testable);
-  bool hit_testable() const { return hit_testable_; }
+  void SetSurfaceHitTestable(bool surface_hit_testable);
+  bool surface_hit_testable() const { return surface_hit_testable_; }
 
   // Layer overrides.
   std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
@@ -64,7 +64,14 @@
   base::Optional<uint32_t> deadline_in_frames_ = 0u;
 
   bool stretch_content_to_fill_bounds_ = false;
-  bool hit_testable_ = false;
+
+  // Whether or not the surface should submit hit test data when submitting
+  // compositor frame. The bit represents that the surface layer may be
+  // associated with an out-of-process iframe and viz hit testing needs to know
+  // the hit test information of that iframe. This bit is different from a layer
+  // being hit testable in the renderer, a hit testable surface layer may not
+  // be surface hit testable (e.g., a surface layer created by video).
+  bool surface_hit_testable_ = false;
 
   DISALLOW_COPY_AND_ASSIGN(SurfaceLayer);
 };
diff --git a/cc/layers/surface_layer_impl.cc b/cc/layers/surface_layer_impl.cc
index d90e233bf..def52815 100644
--- a/cc/layers/surface_layer_impl.cc
+++ b/cc/layers/surface_layer_impl.cc
@@ -54,11 +54,11 @@
   NoteLayerPropertyChanged();
 }
 
-void SurfaceLayerImpl::SetHitTestable(bool hit_testable) {
-  if (hit_testable_ == hit_testable)
+void SurfaceLayerImpl::SetSurfaceHitTestable(bool surface_hit_testable) {
+  if (surface_hit_testable_ == surface_hit_testable)
     return;
 
-  hit_testable_ = hit_testable;
+  surface_hit_testable_ = surface_hit_testable;
   NoteLayerPropertyChanged();
 }
 
@@ -71,7 +71,7 @@
   deadline_in_frames_ = 0u;
   layer_impl->SetFallbackSurfaceId(fallback_surface_id_);
   layer_impl->SetStretchContentToFillBounds(stretch_content_to_fill_bounds_);
-  layer_impl->SetHitTestable(hit_testable_);
+  layer_impl->SetSurfaceHitTestable(surface_hit_testable_);
 }
 
 void SurfaceLayerImpl::AppendQuads(viz::RenderPass* render_pass,
diff --git a/cc/layers/surface_layer_impl.h b/cc/layers/surface_layer_impl.h
index d51dd6a..ce24320 100644
--- a/cc/layers/surface_layer_impl.h
+++ b/cc/layers/surface_layer_impl.h
@@ -50,8 +50,8 @@
     return stretch_content_to_fill_bounds_;
   }
 
-  void SetHitTestable(bool hit_testable);
-  bool hit_testable() const { return hit_testable_; }
+  void SetSurfaceHitTestable(bool surface_hit_testable);
+  bool surface_hit_testable() const { return surface_hit_testable_; }
 
   // LayerImpl overrides.
   std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
@@ -79,7 +79,7 @@
   base::Optional<uint32_t> deadline_in_frames_;
 
   bool stretch_content_to_fill_bounds_ = false;
-  bool hit_testable_ = false;
+  bool surface_hit_testable_ = false;
 
   DISALLOW_COPY_AND_ASSIGN(SurfaceLayerImpl);
 };