cc: Clean up Layer and the Layer public API.

To create a distinction between the Layer data that is received from
the embedder and values that are internally cached or set during
PropertyTree building, move the embedder data, callbacks and interfaces
into a seperate struct.

Also move public methods on Layer which are meant to be used internally
in cc but shouldn't be made available to the embedder to private and
restrict access using an explicit friend list.

The patch only moves the variables and method declarations and should
be a no-op.

BUG=625284
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review-Url: https://codereview.chromium.org/2128633002
Cr-Commit-Position: refs/heads/master@{#404286}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 4886d7b..00a1131 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -657,6 +657,8 @@
     "test/fake_video_frame_provider.h",
     "test/geometry_test_utils.cc",
     "test/geometry_test_utils.h",
+    "test/layer_internals_for_test.cc",
+    "test/layer_internals_for_test.h",
     "test/layer_test_common.cc",
     "test/layer_test_common.h",
     "test/layer_tree_host_common_test.cc",
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp
index 271c2c4f..e34ab54 100644
--- a/cc/cc_tests.gyp
+++ b/cc/cc_tests.gyp
@@ -243,6 +243,8 @@
       'test/fake_video_frame_provider.h',
       'test/geometry_test_utils.cc',
       'test/geometry_test_utils.h',
+      'test/layer_internals_for_test.cc',
+      'test/layer_internals_for_test.h',
       'test/layer_test_common.cc',
       'test/layer_test_common.h',
       'test/layer_tree_host_common_test.cc',
diff --git a/cc/layers/heads_up_display_layer.cc b/cc/layers/heads_up_display_layer.cc
index 0492cb0a..2feb1fa 100644
--- a/cc/layers/heads_up_display_layer.cc
+++ b/cc/layers/heads_up_display_layer.cc
@@ -63,7 +63,7 @@
 
 std::unique_ptr<LayerImpl> HeadsUpDisplayLayer::CreateLayerImpl(
     LayerTreeImpl* tree_impl) {
-  return HeadsUpDisplayLayerImpl::Create(tree_impl, layer_id_);
+  return HeadsUpDisplayLayerImpl::Create(tree_impl, id());
 }
 
 void HeadsUpDisplayLayer::SetTypeForProtoSerialization(
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 60afdfb..b0c62a9 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -41,55 +41,60 @@
 
 base::StaticAtomicSequenceNumber g_next_layer_id;
 
+Layer::Inputs::Inputs()
+    :  // Layer IDs start from 1.
+      layer_id(g_next_layer_id.GetNext() + 1),
+      masks_to_bounds(false),
+      mask_layer(nullptr),
+      replica_layer(nullptr),
+      opacity(1.f),
+      blend_mode(SkXfermode::kSrcOver_Mode),
+      is_root_for_isolated_group(false),
+      contents_opaque(false),
+      is_drawable(false),
+      double_sided(true),
+      should_flatten_transform(true),
+      sorting_context_id(0),
+      use_parent_backface_visibility(false),
+      background_color(0),
+      scroll_clip_layer_id(INVALID_ID),
+      user_scrollable_horizontal(true),
+      user_scrollable_vertical(true),
+      main_thread_scrolling_reasons(
+          MainThreadScrollingReason::kNotScrollingOnMain),
+      is_container_for_fixed_position_layers(false),
+      mutable_properties(MutableProperty::kNone),
+      scroll_parent(nullptr),
+      clip_parent(nullptr),
+      has_will_change_transform_hint(false),
+      hide_layer_and_subtree(false),
+      client(nullptr) {}
+
+Layer::Inputs::~Inputs() {}
+
 scoped_refptr<Layer> Layer::Create() {
   return make_scoped_refptr(new Layer());
 }
 
 Layer::Layer()
-    :  // Layer IDs start from 1.
-      layer_id_(g_next_layer_id.GetNext() + 1),
-      ignore_set_needs_commit_(false),
-      sorting_context_id_(0),
+    : ignore_set_needs_commit_(false),
       parent_(nullptr),
       layer_tree_host_(nullptr),
-      scroll_clip_layer_id_(INVALID_ID),
       num_descendants_that_draw_content_(0),
       transform_tree_index_(-1),
       effect_tree_index_(-1),
       clip_tree_index_(-1),
       scroll_tree_index_(-1),
       property_tree_sequence_number_(-1),
-      mutable_properties_(MutableProperty::kNone),
-      main_thread_scrolling_reasons_(
-          MainThreadScrollingReason::kNotScrollingOnMain),
       should_flatten_transform_from_property_tree_(false),
-      user_scrollable_horizontal_(true),
-      user_scrollable_vertical_(true),
-      is_root_for_isolated_group_(false),
-      is_container_for_fixed_position_layers_(false),
-      is_drawable_(false),
       draws_content_(false),
-      hide_layer_and_subtree_(false),
-      masks_to_bounds_(false),
-      contents_opaque_(false),
-      double_sided_(true),
-      should_flatten_transform_(true),
-      use_parent_backface_visibility_(false),
       use_local_transform_for_backface_visibility_(false),
       should_check_backface_visibility_(false),
       force_render_surface_for_testing_(false),
       subtree_property_changed_(false),
       layer_property_changed_(false),
-      has_will_change_transform_hint_(false),
-      background_color_(0),
       safe_opaque_background_color_(0),
-      opacity_(1.f),
-      blend_mode_(SkXfermode::kSrcOver_Mode),
       draw_blend_mode_(SkXfermode::kSrcOver_Mode),
-      scroll_parent_(nullptr),
-      clip_parent_(nullptr),
-      replica_layer_(nullptr),
-      client_(nullptr),
       num_unclipped_descendants_(0) {}
 
 Layer::~Layer() {
@@ -105,13 +110,13 @@
 
   // Remove the parent reference from all children and dependents.
   RemoveAllChildren();
-  if (mask_layer_.get()) {
-    DCHECK_EQ(this, mask_layer_->parent());
-    mask_layer_->RemoveFromParent();
+  if (inputs_.mask_layer.get()) {
+    DCHECK_EQ(this, inputs_.mask_layer->parent());
+    inputs_.mask_layer->RemoveFromParent();
   }
-  if (replica_layer_.get()) {
-    DCHECK_EQ(this, replica_layer_->parent());
-    replica_layer_->RemoveFromParent();
+  if (inputs_.replica_layer.get()) {
+    DCHECK_EQ(this, inputs_.replica_layer->parent());
+    inputs_.replica_layer->RemoveFromParent();
   }
 }
 
@@ -123,18 +128,18 @@
     layer_tree_host_->property_trees()->RemoveIdFromIdToIndexMaps(id());
     layer_tree_host_->property_trees()->needs_rebuild = true;
     layer_tree_host_->UnregisterLayer(this);
-    if (element_id_) {
+    if (inputs_.element_id) {
       layer_tree_host_->animation_host()->UnregisterElement(
-          element_id_, ElementListType::ACTIVE);
+          inputs_.element_id, ElementListType::ACTIVE);
       layer_tree_host_->RemoveFromElementMap(this);
     }
   }
   if (host) {
     host->property_trees()->needs_rebuild = true;
     host->RegisterLayer(this);
-    if (element_id_) {
+    if (inputs_.element_id) {
       host->AddToElementMap(this);
-      host->animation_host()->RegisterElement(element_id_,
+      host->animation_host()->RegisterElement(inputs_.element_id,
                                               ElementListType::ACTIVE);
     }
   }
@@ -146,13 +151,13 @@
   // side for the new host.
   SetNeedsPushProperties();
 
-  for (size_t i = 0; i < children_.size(); ++i)
-    children_[i]->SetLayerTreeHost(host);
+  for (size_t i = 0; i < inputs_.children.size(); ++i)
+    inputs_.children[i]->SetLayerTreeHost(host);
 
-  if (mask_layer_.get())
-    mask_layer_->SetLayerTreeHost(host);
-  if (replica_layer_.get())
-    replica_layer_->SetLayerTreeHost(host);
+  if (inputs_.mask_layer.get())
+    inputs_.mask_layer->SetLayerTreeHost(host);
+  if (inputs_.replica_layer.get())
+    inputs_.replica_layer->SetLayerTreeHost(host);
 
   const bool has_any_animation =
       layer_tree_host_ ? layer_tree_host_->HasAnyAnimation(this) : false;
@@ -238,7 +243,7 @@
 }
 
 void Layer::AddChild(scoped_refptr<Layer> child) {
-  InsertChild(child, children_.size());
+  InsertChild(child, inputs_.children.size());
 }
 
 void Layer::InsertChild(scoped_refptr<Layer> child, size_t index) {
@@ -249,8 +254,8 @@
   child->SetParent(this);
   child->SetSubtreePropertyChanged();
 
-  index = std::min(index, children_.size());
-  children_.insert(children_.begin() + index, child);
+  index = std::min(index, inputs_.children.size());
+  inputs_.children.insert(inputs_.children.begin() + index, child);
   SetNeedsFullTreeSync();
 }
 
@@ -261,29 +266,28 @@
 }
 
 void Layer::RemoveChildOrDependent(Layer* child) {
-  if (mask_layer_.get() == child) {
-    mask_layer_->SetParent(nullptr);
-    mask_layer_ = nullptr;
+  if (inputs_.mask_layer.get() == child) {
+    inputs_.mask_layer->SetParent(nullptr);
+    inputs_.mask_layer = nullptr;
     SetNeedsFullTreeSync();
     return;
   }
-  if (replica_layer_.get() == child) {
-    replica_layer_->SetParent(nullptr);
-    replica_layer_ = nullptr;
+  if (inputs_.replica_layer.get() == child) {
+    inputs_.replica_layer->SetParent(nullptr);
+    inputs_.replica_layer = nullptr;
     SetNeedsFullTreeSync();
     return;
   }
 
-  for (LayerList::iterator iter = children_.begin();
-       iter != children_.end();
-       ++iter) {
+  for (LayerList::iterator iter = inputs_.children.begin();
+       iter != inputs_.children.end(); ++iter) {
     if (iter->get() != child)
       continue;
 
     child->SetParent(nullptr);
     AddDrawableDescendants(-child->NumDescendantsThatDrawContent() -
                            (child->DrawsContent() ? 1 : 0));
-    children_.erase(iter);
+    inputs_.children.erase(iter);
     SetNeedsFullTreeSync();
     return;
   }
@@ -299,12 +303,12 @@
 
   // Find the index of |reference| in |children_|.
   auto reference_it =
-      std::find_if(children_.begin(), children_.end(),
+      std::find_if(inputs_.children.begin(), inputs_.children.end(),
                    [reference](const scoped_refptr<Layer>& layer) {
                      return layer.get() == reference;
                    });
-  DCHECK(reference_it != children_.end());
-  size_t reference_index = reference_it - children_.begin();
+  DCHECK(reference_it != inputs_.children.end());
+  size_t reference_index = reference_it - inputs_.children.begin();
   reference->RemoveFromParent();
 
   if (new_layer.get()) {
@@ -317,7 +321,7 @@
   DCHECK(IsPropertyChangeAllowed());
   if (bounds() == size)
     return;
-  bounds_ = size;
+  inputs_.bounds = size;
 
   if (!layer_tree_host_)
     return;
@@ -336,8 +340,8 @@
 
 void Layer::RemoveAllChildren() {
   DCHECK(IsPropertyChangeAllowed());
-  while (children_.size()) {
-    Layer* layer = children_[0].get();
+  while (inputs_.children.size()) {
+    Layer* layer = inputs_.children[0].get();
     DCHECK_EQ(this, layer->parent());
     layer->RemoveFromParent();
   }
@@ -345,7 +349,7 @@
 
 void Layer::SetChildren(const LayerList& children) {
   DCHECK(IsPropertyChangeAllowed());
-  if (children == children_)
+  if (children == inputs_.children)
     return;
 
   RemoveAllChildren();
@@ -365,25 +369,25 @@
   DCHECK(IsPropertyChangeAllowed());
   if (void* source = request->source()) {
     auto it =
-        std::find_if(copy_requests_.begin(), copy_requests_.end(),
+        std::find_if(inputs_.copy_requests.begin(), inputs_.copy_requests.end(),
                      [source](const std::unique_ptr<CopyOutputRequest>& x) {
                        return x->source() == source;
                      });
-    if (it != copy_requests_.end())
-      copy_requests_.erase(it);
+    if (it != inputs_.copy_requests.end())
+      inputs_.copy_requests.erase(it);
   }
   if (request->IsEmpty())
     return;
-  copy_requests_.push_back(std::move(request));
+  inputs_.copy_requests.push_back(std::move(request));
   SetSubtreePropertyChanged();
   SetNeedsCommit();
 }
 
 void Layer::SetBackgroundColor(SkColor background_color) {
   DCHECK(IsPropertyChangeAllowed());
-  if (background_color_ == background_color)
+  if (inputs_.background_color == background_color)
     return;
-  background_color_ = background_color;
+  inputs_.background_color = background_color;
   SetNeedsCommit();
 }
 
@@ -406,27 +410,27 @@
 
 void Layer::SetMasksToBounds(bool masks_to_bounds) {
   DCHECK(IsPropertyChangeAllowed());
-  if (masks_to_bounds_ == masks_to_bounds)
+  if (inputs_.masks_to_bounds == masks_to_bounds)
     return;
-  masks_to_bounds_ = masks_to_bounds;
+  inputs_.masks_to_bounds = masks_to_bounds;
   SetNeedsCommit();
   SetSubtreePropertyChanged();
 }
 
 void Layer::SetMaskLayer(Layer* mask_layer) {
   DCHECK(IsPropertyChangeAllowed());
-  if (mask_layer_.get() == mask_layer)
+  if (inputs_.mask_layer.get() == mask_layer)
     return;
-  if (mask_layer_.get()) {
-    DCHECK_EQ(this, mask_layer_->parent());
-    mask_layer_->RemoveFromParent();
+  if (inputs_.mask_layer.get()) {
+    DCHECK_EQ(this, inputs_.mask_layer->parent());
+    inputs_.mask_layer->RemoveFromParent();
   }
-  mask_layer_ = mask_layer;
-  if (mask_layer_.get()) {
-    mask_layer_->RemoveFromParent();
-    DCHECK(!mask_layer_->parent());
-    mask_layer_->SetParent(this);
-    mask_layer_->SetIsMask(true);
+  inputs_.mask_layer = mask_layer;
+  if (inputs_.mask_layer.get()) {
+    inputs_.mask_layer->RemoveFromParent();
+    DCHECK(!inputs_.mask_layer->parent());
+    inputs_.mask_layer->SetParent(this);
+    inputs_.mask_layer->SetIsMask(true);
   }
   SetSubtreePropertyChanged();
   SetNeedsFullTreeSync();
@@ -434,17 +438,17 @@
 
 void Layer::SetReplicaLayer(Layer* layer) {
   DCHECK(IsPropertyChangeAllowed());
-  if (replica_layer_.get() == layer)
+  if (inputs_.replica_layer.get() == layer)
     return;
-  if (replica_layer_.get()) {
-    DCHECK_EQ(this, replica_layer_->parent());
-    replica_layer_->RemoveFromParent();
+  if (inputs_.replica_layer.get()) {
+    DCHECK_EQ(this, inputs_.replica_layer->parent());
+    inputs_.replica_layer->RemoveFromParent();
   }
-  replica_layer_ = layer;
-  if (replica_layer_.get()) {
-    DCHECK(!replica_layer_->parent());
-    replica_layer_->RemoveFromParent();
-    replica_layer_->SetParent(this);
+  inputs_.replica_layer = layer;
+  if (inputs_.replica_layer.get()) {
+    DCHECK(!inputs_.replica_layer->parent());
+    inputs_.replica_layer->RemoveFromParent();
+    inputs_.replica_layer->SetParent(this);
   }
   SetSubtreePropertyChanged();
   SetNeedsFullTreeSync();
@@ -452,9 +456,9 @@
 
 void Layer::SetFilters(const FilterOperations& filters) {
   DCHECK(IsPropertyChangeAllowed());
-  if (filters_ == filters)
+  if (inputs_.filters == filters)
     return;
-  filters_ = filters;
+  inputs_.filters = filters;
   SetSubtreePropertyChanged();
   SetNeedsCommit();
 }
@@ -470,9 +474,9 @@
 
 void Layer::SetBackgroundFilters(const FilterOperations& filters) {
   DCHECK(IsPropertyChangeAllowed());
-  if (background_filters_ == filters)
+  if (inputs_.background_filters == filters)
     return;
-  background_filters_ = filters;
+  inputs_.background_filters = filters;
   SetLayerPropertyChanged();
   SetNeedsCommit();
 }
@@ -482,12 +486,12 @@
   DCHECK_GE(opacity, 0.f);
   DCHECK_LE(opacity, 1.f);
 
-  if (opacity_ == opacity)
+  if (inputs_.opacity == opacity)
     return;
   // We need to force a property tree rebuild when opacity changes from 1 to a
   // non-1 value or vice-versa as render surfaces can change.
-  bool force_rebuild = opacity == 1.f || opacity_ == 1.f;
-  opacity_ = opacity;
+  bool force_rebuild = opacity == 1.f || inputs_.opacity == 1.f;
+  inputs_.opacity = opacity;
   SetSubtreePropertyChanged();
   if (layer_tree_host_ && !force_rebuild) {
     PropertyTrees* property_trees = layer_tree_host_->property_trees();
@@ -506,7 +510,7 @@
 }
 
 float Layer::EffectiveOpacity() const {
-  return hide_layer_and_subtree_ ? 0.f : opacity_;
+  return inputs_.hide_layer_and_subtree ? 0.f : inputs_.opacity;
 }
 
 bool Layer::OpacityIsAnimating() const {
@@ -528,7 +532,7 @@
 
 void Layer::SetBlendMode(SkXfermode::Mode blend_mode) {
   DCHECK(IsPropertyChangeAllowed());
-  if (blend_mode_ == blend_mode)
+  if (inputs_.blend_mode == blend_mode)
     return;
 
   // Allowing only blend modes that are defined in the CSS Compositing standard:
@@ -571,33 +575,33 @@
       return;
   }
 
-  blend_mode_ = blend_mode;
+  inputs_.blend_mode = blend_mode;
   SetNeedsCommit();
   SetSubtreePropertyChanged();
 }
 
 void Layer::SetIsRootForIsolatedGroup(bool root) {
   DCHECK(IsPropertyChangeAllowed());
-  if (is_root_for_isolated_group_ == root)
+  if (inputs_.is_root_for_isolated_group == root)
     return;
-  is_root_for_isolated_group_ = root;
+  inputs_.is_root_for_isolated_group = root;
   SetNeedsCommit();
 }
 
 void Layer::SetContentsOpaque(bool opaque) {
   DCHECK(IsPropertyChangeAllowed());
-  if (contents_opaque_ == opaque)
+  if (inputs_.contents_opaque == opaque)
     return;
-  contents_opaque_ = opaque;
+  inputs_.contents_opaque = opaque;
   SetNeedsCommit();
   SetSubtreePropertyChanged();
 }
 
 void Layer::SetPosition(const gfx::PointF& position) {
   DCHECK(IsPropertyChangeAllowed());
-  if (position_ == position)
+  if (inputs_.position == position)
     return;
-  position_ = position;
+  inputs_.position = position;
 
   if (!layer_tree_host_)
     return;
@@ -623,11 +627,11 @@
 }
 
 bool Layer::IsContainerForFixedPositionLayers() const {
-  if (!transform_.IsIdentityOrTranslation())
+  if (!inputs_.transform.IsIdentityOrTranslation())
     return true;
-  if (parent_ && !parent_->transform_.IsIdentityOrTranslation())
+  if (parent_ && !parent_->inputs_.transform.IsIdentityOrTranslation())
     return true;
-  return is_container_for_fixed_position_layers_;
+  return inputs_.is_container_for_fixed_position_layers;
 }
 
 bool Are2dAxisAligned(const gfx::Transform& a, const gfx::Transform& b) {
@@ -647,7 +651,7 @@
 
 void Layer::SetTransform(const gfx::Transform& transform) {
   DCHECK(IsPropertyChangeAllowed());
-  if (transform_ == transform)
+  if (inputs_.transform == transform)
     return;
 
   SetSubtreePropertyChanged();
@@ -656,14 +660,15 @@
     if (property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM,
                                          id())) {
       // We need to trigger a rebuild if we could have affected 2d axis
-      // alignment. We'll check to see if transform and transform_ are axis
+      // alignment. We'll check to see if transform and inputs_.transform
+      // are axis
       // align with respect to one another.
       DCHECK_EQ(transform_tree_index(),
                 property_trees->transform_id_to_index_map[id()]);
       TransformNode* transform_node =
           property_trees->transform_tree.Node(transform_tree_index());
       bool preserves_2d_axis_alignment =
-          Are2dAxisAligned(transform_, transform);
+          Are2dAxisAligned(inputs_.transform, transform);
       transform_node->data.local = transform;
       transform_node->data.needs_local_transform_update = true;
       transform_node->data.transform_changed = true;
@@ -672,21 +677,21 @@
         SetNeedsCommitNoRebuild();
       else
         SetNeedsCommit();
-      transform_ = transform;
+      inputs_.transform = transform;
       return;
     }
   }
 
-  transform_ = transform;
+  inputs_.transform = transform;
 
   SetNeedsCommit();
 }
 
 void Layer::SetTransformOrigin(const gfx::Point3F& transform_origin) {
   DCHECK(IsPropertyChangeAllowed());
-  if (transform_origin_ == transform_origin)
+  if (inputs_.transform_origin == transform_origin)
     return;
-  transform_origin_ = transform_origin;
+  inputs_.transform_origin = transform_origin;
 
   if (!layer_tree_host_)
     return;
@@ -750,16 +755,16 @@
 
 void Layer::SetScrollParent(Layer* parent) {
   DCHECK(IsPropertyChangeAllowed());
-  if (scroll_parent_ == parent)
+  if (inputs_.scroll_parent == parent)
     return;
 
-  if (scroll_parent_)
-    scroll_parent_->RemoveScrollChild(this);
+  if (inputs_.scroll_parent)
+    inputs_.scroll_parent->RemoveScrollChild(this);
 
-  scroll_parent_ = parent;
+  inputs_.scroll_parent = parent;
 
-  if (scroll_parent_)
-    scroll_parent_->AddScrollChild(this);
+  if (inputs_.scroll_parent)
+    inputs_.scroll_parent->AddScrollChild(this);
 
   SetNeedsCommit();
 }
@@ -780,16 +785,16 @@
 
 void Layer::SetClipParent(Layer* ancestor) {
   DCHECK(IsPropertyChangeAllowed());
-  if (clip_parent_ == ancestor)
+  if (inputs_.clip_parent == ancestor)
     return;
 
-  if (clip_parent_)
-    clip_parent_->RemoveClipChild(this);
+  if (inputs_.clip_parent)
+    inputs_.clip_parent->RemoveClipChild(this);
 
-  clip_parent_ = ancestor;
+  inputs_.clip_parent = ancestor;
 
-  if (clip_parent_)
-    clip_parent_->AddClipChild(this);
+  if (inputs_.clip_parent)
+    inputs_.clip_parent->AddClipChild(this);
 
   SetNeedsCommit();
   if (layer_tree_host_)
@@ -813,9 +818,9 @@
 void Layer::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) {
   DCHECK(IsPropertyChangeAllowed());
 
-  if (scroll_offset_ == scroll_offset)
+  if (inputs_.scroll_offset == scroll_offset)
     return;
-  scroll_offset_ = scroll_offset;
+  inputs_.scroll_offset = scroll_offset;
 
   if (!layer_tree_host_)
     return;
@@ -846,9 +851,9 @@
   // This function only gets called during a BeginMainFrame, so there
   // is no need to call SetNeedsUpdate here.
   DCHECK(layer_tree_host_ && layer_tree_host_->CommitRequested());
-  if (scroll_offset_ == scroll_offset)
+  if (inputs_.scroll_offset == scroll_offset)
     return;
-  scroll_offset_ = scroll_offset;
+  inputs_.scroll_offset = scroll_offset;
   SetNeedsPushProperties();
 
   bool needs_rebuild = true;
@@ -872,31 +877,31 @@
   if (needs_rebuild)
     property_trees->needs_rebuild = true;
 
-  if (!did_scroll_callback_.is_null())
-    did_scroll_callback_.Run();
+  if (!inputs_.did_scroll_callback.is_null())
+    inputs_.did_scroll_callback.Run();
   // The callback could potentially change the layer structure:
   // "this" may have been destroyed during the process.
 }
 
 void Layer::SetScrollClipLayerId(int clip_layer_id) {
   DCHECK(IsPropertyChangeAllowed());
-  if (scroll_clip_layer_id_ == clip_layer_id)
+  if (inputs_.scroll_clip_layer_id == clip_layer_id)
     return;
-  scroll_clip_layer_id_ = clip_layer_id;
+  inputs_.scroll_clip_layer_id = clip_layer_id;
   SetNeedsCommit();
 }
 
 Layer* Layer::scroll_clip_layer() const {
-  return layer_tree_host()->LayerById(scroll_clip_layer_id_);
+  return layer_tree_host()->LayerById(inputs_.scroll_clip_layer_id);
 }
 
 void Layer::SetUserScrollable(bool horizontal, bool vertical) {
   DCHECK(IsPropertyChangeAllowed());
-  if (user_scrollable_horizontal_ == horizontal &&
-      user_scrollable_vertical_ == vertical)
+  if (inputs_.user_scrollable_horizontal == horizontal &&
+      inputs_.user_scrollable_vertical == vertical)
     return;
-  user_scrollable_horizontal_ = horizontal;
-  user_scrollable_vertical_ = vertical;
+  inputs_.user_scrollable_horizontal = horizontal;
+  inputs_.user_scrollable_vertical = vertical;
   SetNeedsCommit();
 }
 
@@ -905,10 +910,10 @@
   DCHECK(IsPropertyChangeAllowed());
   DCHECK(main_thread_scrolling_reasons);
   uint32_t new_reasons =
-      main_thread_scrolling_reasons_ | main_thread_scrolling_reasons;
-  if (main_thread_scrolling_reasons_ == new_reasons)
+      inputs_.main_thread_scrolling_reasons | main_thread_scrolling_reasons;
+  if (inputs_.main_thread_scrolling_reasons == new_reasons)
     return;
-  main_thread_scrolling_reasons_ = new_reasons;
+  inputs_.main_thread_scrolling_reasons = new_reasons;
   SetNeedsCommit();
 }
 
@@ -916,28 +921,28 @@
     uint32_t main_thread_scrolling_reasons_to_clear) {
   DCHECK(IsPropertyChangeAllowed());
   DCHECK(main_thread_scrolling_reasons_to_clear);
-  uint32_t new_reasons =
-      ~main_thread_scrolling_reasons_to_clear & main_thread_scrolling_reasons_;
-  if (new_reasons == main_thread_scrolling_reasons_)
+  uint32_t new_reasons = ~main_thread_scrolling_reasons_to_clear &
+                         inputs_.main_thread_scrolling_reasons;
+  if (new_reasons == inputs_.main_thread_scrolling_reasons)
     return;
-  main_thread_scrolling_reasons_ = new_reasons;
+  inputs_.main_thread_scrolling_reasons = new_reasons;
   SetNeedsCommit();
 }
 
 void Layer::SetNonFastScrollableRegion(const Region& region) {
   DCHECK(IsPropertyChangeAllowed());
-  if (non_fast_scrollable_region_ == region)
+  if (inputs_.non_fast_scrollable_region == region)
     return;
-  non_fast_scrollable_region_ = region;
+  inputs_.non_fast_scrollable_region = region;
   SetNeedsCommit();
 }
 
 void Layer::SetTouchEventHandlerRegion(const Region& region) {
   DCHECK(IsPropertyChangeAllowed());
-  if (touch_event_handler_region_ == region)
+  if (inputs_.touch_event_handler_region == region)
     return;
 
-  touch_event_handler_region_ = region;
+  inputs_.touch_event_handler_region = region;
   SetNeedsCommit();
 }
 
@@ -951,18 +956,18 @@
 
 void Layer::SetDoubleSided(bool double_sided) {
   DCHECK(IsPropertyChangeAllowed());
-  if (double_sided_ == double_sided)
+  if (inputs_.double_sided == double_sided)
     return;
-  double_sided_ = double_sided;
+  inputs_.double_sided = double_sided;
   SetNeedsCommit();
   SetSubtreePropertyChanged();
 }
 
 void Layer::Set3dSortingContextId(int id) {
   DCHECK(IsPropertyChangeAllowed());
-  if (id == sorting_context_id_)
+  if (id == inputs_.sorting_context_id)
     return;
-  sorting_context_id_ = id;
+  inputs_.sorting_context_id = id;
   SetNeedsCommit();
   SetSubtreePropertyChanged();
 }
@@ -1044,18 +1049,18 @@
 
 void Layer::SetShouldFlattenTransform(bool should_flatten) {
   DCHECK(IsPropertyChangeAllowed());
-  if (should_flatten_transform_ == should_flatten)
+  if (inputs_.should_flatten_transform == should_flatten)
     return;
-  should_flatten_transform_ = should_flatten;
+  inputs_.should_flatten_transform = should_flatten;
   SetNeedsCommit();
   SetSubtreePropertyChanged();
 }
 
 void Layer::SetUseParentBackfaceVisibility(bool use) {
   DCHECK(IsPropertyChangeAllowed());
-  if (use_parent_backface_visibility_ == use)
+  if (inputs_.use_parent_backface_visibility == use)
     return;
-  use_parent_backface_visibility_ = use;
+  inputs_.use_parent_backface_visibility = use;
   SetNeedsPushProperties();
 }
 
@@ -1076,19 +1081,19 @@
 
 void Layer::SetIsDrawable(bool is_drawable) {
   DCHECK(IsPropertyChangeAllowed());
-  if (is_drawable_ == is_drawable)
+  if (inputs_.is_drawable == is_drawable)
     return;
 
-  is_drawable_ = is_drawable;
+  inputs_.is_drawable = is_drawable;
   UpdateDrawsContent(HasDrawableContent());
 }
 
 void Layer::SetHideLayerAndSubtree(bool hide) {
   DCHECK(IsPropertyChangeAllowed());
-  if (hide_layer_and_subtree_ == hide)
+  if (inputs_.hide_layer_and_subtree == hide)
     return;
 
-  hide_layer_and_subtree_ = hide;
+  inputs_.hide_layer_and_subtree = hide;
   SetNeedsCommit();
   SetSubtreePropertyChanged();
 }
@@ -1098,25 +1103,25 @@
     return;
 
   SetNeedsPushProperties();
-  update_rect_.Union(dirty_rect);
+  inputs_.update_rect.Union(dirty_rect);
 
   if (DrawsContent())
     SetNeedsUpdate();
 }
 
 bool Layer::DescendantIsFixedToContainerLayer() const {
-  for (size_t i = 0; i < children_.size(); ++i) {
-    if (children_[i]->position_constraint_.is_fixed_position() ||
-        children_[i]->DescendantIsFixedToContainerLayer())
+  for (size_t i = 0; i < inputs_.children.size(); ++i) {
+    if (inputs_.children[i]->inputs_.position_constraint.is_fixed_position() ||
+        inputs_.children[i]->DescendantIsFixedToContainerLayer())
       return true;
   }
   return false;
 }
 
 void Layer::SetIsContainerForFixedPositionLayers(bool container) {
-  if (is_container_for_fixed_position_layers_ == container)
+  if (inputs_.is_container_for_fixed_position_layers == container)
     return;
-  is_container_for_fixed_position_layers_ = container;
+  inputs_.is_container_for_fixed_position_layers = container;
 
   if (layer_tree_host_ && layer_tree_host_->CommitRequested())
     return;
@@ -1128,9 +1133,9 @@
 
 void Layer::SetPositionConstraint(const LayerPositionConstraint& constraint) {
   DCHECK(IsPropertyChangeAllowed());
-  if (position_constraint_ == constraint)
+  if (inputs_.position_constraint == constraint)
     return;
-  position_constraint_ = constraint;
+  inputs_.position_constraint = constraint;
   SetNeedsCommit();
 }
 
@@ -1159,10 +1164,10 @@
   bool use_paint_properties = paint_properties_.source_frame_number ==
                               layer_tree_host_->source_frame_number();
 
-  layer->SetBackgroundColor(background_color_);
+  layer->SetBackgroundColor(inputs_.background_color);
   layer->SetSafeOpaqueBackgroundColor(safe_opaque_background_color_);
   layer->SetBounds(use_paint_properties ? paint_properties_.bounds
-                                        : bounds_);
+                                        : inputs_.bounds);
 
 #if defined(NDEBUG)
   if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots())
@@ -1182,30 +1187,31 @@
   if (subtree_property_changed_ || layer_property_changed_)
     layer->NoteLayerPropertyChanged();
   if (!FilterIsAnimating())
-    layer->SetFilters(filters_);
-  layer->SetMasksToBounds(masks_to_bounds_);
-  layer->set_main_thread_scrolling_reasons(main_thread_scrolling_reasons_);
-  layer->SetNonFastScrollableRegion(non_fast_scrollable_region_);
-  layer->SetTouchEventHandlerRegion(touch_event_handler_region_);
-  layer->SetContentsOpaque(contents_opaque_);
-  layer->SetBlendMode(blend_mode_);
-  layer->SetPosition(position_);
+    layer->SetFilters(inputs_.filters);
+  layer->SetMasksToBounds(inputs_.masks_to_bounds);
+  layer->set_main_thread_scrolling_reasons(
+      inputs_.main_thread_scrolling_reasons);
+  layer->SetNonFastScrollableRegion(inputs_.non_fast_scrollable_region);
+  layer->SetTouchEventHandlerRegion(inputs_.touch_event_handler_region);
+  layer->SetContentsOpaque(inputs_.contents_opaque);
+  layer->SetBlendMode(inputs_.blend_mode);
+  layer->SetPosition(inputs_.position);
   layer->set_should_flatten_transform_from_property_tree(
       should_flatten_transform_from_property_tree_);
   layer->set_draw_blend_mode(draw_blend_mode_);
-  layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_);
+  layer->SetUseParentBackfaceVisibility(inputs_.use_parent_backface_visibility);
   layer->SetUseLocalTransformForBackfaceVisibility(
       use_local_transform_for_backface_visibility_);
   layer->SetShouldCheckBackfaceVisibility(should_check_backface_visibility_);
   if (!TransformIsAnimating())
-    layer->SetTransform(transform_);
-  layer->Set3dSortingContextId(sorting_context_id_);
+    layer->SetTransform(inputs_.transform);
+  layer->Set3dSortingContextId(inputs_.sorting_context_id);
 
-  layer->SetScrollClipLayer(scroll_clip_layer_id_);
-  layer->set_user_scrollable_horizontal(user_scrollable_horizontal_);
-  layer->set_user_scrollable_vertical(user_scrollable_vertical_);
-  layer->SetElementId(element_id_);
-  layer->SetMutableProperties(mutable_properties_);
+  layer->SetScrollClipLayer(inputs_.scroll_clip_layer_id);
+  layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal);
+  layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical);
+  layer->SetElementId(inputs_.element_id);
+  layer->SetMutableProperties(inputs_.mutable_properties);
 
   // When a scroll offset animation is interrupted the new scroll position on
   // the pending tree will clobber any impl-side scrolling occuring on the
@@ -1220,8 +1226,8 @@
   // draws, then damage tracking will become incorrect if we simply clobber the
   // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e.
   // union) any update changes that have occurred on the main thread.
-  update_rect_.Union(layer->update_rect());
-  layer->SetUpdateRect(update_rect_);
+  inputs_.update_rect.Union(layer->update_rect());
+  layer->SetUpdateRect(inputs_.update_rect);
 
   layer->SetHasWillChangeTransformHint(has_will_change_transform_hint());
   layer->SetNeedsPushProperties();
@@ -1229,14 +1235,14 @@
   // Reset any state that should be cleared for the next update.
   subtree_property_changed_ = false;
   layer_property_changed_ = false;
-  update_rect_ = gfx::Rect();
+  inputs_.update_rect = gfx::Rect();
 
   layer_tree_host()->RemoveLayerShouldPushProperties(this);
 }
 
 void Layer::TakeCopyRequests(
     std::vector<std::unique_ptr<CopyOutputRequest>>* requests) {
-  for (auto& it : copy_requests_) {
+  for (auto& it : inputs_.copy_requests) {
     scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner =
         layer_tree_host()->task_runner_provider()->MainThreadTaskRunner();
     std::unique_ptr<CopyOutputRequest> original_request = std::move(it);
@@ -1253,7 +1259,7 @@
     requests->push_back(std::move(main_thread_request));
   }
 
-  copy_requests_.clear();
+  inputs_.copy_requests.clear();
 }
 
 void Layer::SetTypeForProtoSerialization(proto::LayerNode* proto) const {
@@ -1261,26 +1267,26 @@
 }
 
 void Layer::ToLayerNodeProto(proto::LayerNode* proto) const {
-  proto->set_id(layer_id_);
+  proto->set_id(inputs_.layer_id);
   SetTypeForProtoSerialization(proto);
 
   if (parent_)
     proto->set_parent_id(parent_->id());
 
   DCHECK_EQ(0, proto->children_size());
-  for (const auto& child : children_) {
+  for (const auto& child : inputs_.children) {
     child->ToLayerNodeProto(proto->add_children());
   }
 
-  if (mask_layer_)
-    mask_layer_->ToLayerNodeProto(proto->mutable_mask_layer());
-  if (replica_layer_)
-    replica_layer_->ToLayerNodeProto(proto->mutable_replica_layer());
+  if (inputs_.mask_layer)
+    inputs_.mask_layer->ToLayerNodeProto(proto->mutable_mask_layer());
+  if (inputs_.replica_layer)
+    inputs_.replica_layer->ToLayerNodeProto(proto->mutable_replica_layer());
 }
 
 void Layer::ClearLayerTreePropertiesForDeserializationAndAddToMap(
     LayerIdMap* layer_map) {
-  (*layer_map)[layer_id_] = this;
+  (*layer_map)[inputs_.layer_id] = this;
 
   if (layer_tree_host_)
     layer_tree_host_->UnregisterLayer(this);
@@ -1289,22 +1295,22 @@
   parent_ = nullptr;
 
   // Clear these properties for all the children and add them to the map.
-  for (auto& child : children_) {
+  for (auto& child : inputs_.children) {
     child->ClearLayerTreePropertiesForDeserializationAndAddToMap(layer_map);
   }
 
-  children_.clear();
+  inputs_.children.clear();
 
-  if (mask_layer_) {
-    mask_layer_->ClearLayerTreePropertiesForDeserializationAndAddToMap(
+  if (inputs_.mask_layer) {
+    inputs_.mask_layer->ClearLayerTreePropertiesForDeserializationAndAddToMap(
         layer_map);
-    mask_layer_ = nullptr;
+    inputs_.mask_layer = nullptr;
   }
 
-  if (replica_layer_) {
-    replica_layer_->ClearLayerTreePropertiesForDeserializationAndAddToMap(
-        layer_map);
-    replica_layer_ = nullptr;
+  if (inputs_.replica_layer) {
+    inputs_.replica_layer
+        ->ClearLayerTreePropertiesForDeserializationAndAddToMap(layer_map);
+    inputs_.replica_layer = nullptr;
   }
 }
 
@@ -1312,13 +1318,13 @@
                                const LayerIdMap& layer_map,
                                LayerTreeHost* layer_tree_host) {
   DCHECK(!layer_tree_host_);
-  DCHECK(children_.empty());
-  DCHECK(!mask_layer_);
-  DCHECK(!replica_layer_);
+  DCHECK(inputs_.children.empty());
+  DCHECK(!inputs_.mask_layer);
+  DCHECK(!inputs_.replica_layer);
   DCHECK(layer_tree_host);
   DCHECK(proto.has_id());
 
-  layer_id_ = proto.id();
+  inputs_.layer_id = proto.id();
 
   layer_tree_host_ = layer_tree_host;
   layer_tree_host_->RegisterLayer(this);
@@ -1333,36 +1339,36 @@
     DCHECK(!child->parent_);
     child->parent_ = this;
     child->FromLayerNodeProto(child_proto, layer_map, layer_tree_host_);
-    children_.push_back(child);
+    inputs_.children.push_back(child);
   }
 
   if (proto.has_mask_layer()) {
-    mask_layer_ = LayerProtoConverter::FindOrAllocateAndConstruct(
+    inputs_.mask_layer = LayerProtoConverter::FindOrAllocateAndConstruct(
         proto.mask_layer(), layer_map);
-    mask_layer_->parent_ = this;
-    mask_layer_->FromLayerNodeProto(proto.mask_layer(), layer_map,
-                                    layer_tree_host_);
+    inputs_.mask_layer->parent_ = this;
+    inputs_.mask_layer->FromLayerNodeProto(proto.mask_layer(), layer_map,
+                                           layer_tree_host_);
   }
 
   if (proto.has_replica_layer()) {
-    replica_layer_ = LayerProtoConverter::FindOrAllocateAndConstruct(
+    inputs_.replica_layer = LayerProtoConverter::FindOrAllocateAndConstruct(
         proto.replica_layer(), layer_map);
-    replica_layer_->parent_ = this;
-    replica_layer_->FromLayerNodeProto(proto.replica_layer(), layer_map,
-                                       layer_tree_host_);
+    inputs_.replica_layer->parent_ = this;
+    inputs_.replica_layer->FromLayerNodeProto(proto.replica_layer(), layer_map,
+                                              layer_tree_host_);
   }
 }
 
 void Layer::ToLayerPropertiesProto(proto::LayerUpdate* layer_update) {
   // Always set properties metadata for serialized layers.
   proto::LayerProperties* proto = layer_update->add_layers();
-  proto->set_id(layer_id_);
+  proto->set_id(inputs_.layer_id);
   LayerSpecificPropertiesToProto(proto);
 }
 
 void Layer::FromLayerPropertiesProto(const proto::LayerProperties& proto) {
   DCHECK(proto.has_id());
-  DCHECK_EQ(layer_id_, proto.id());
+  DCHECK_EQ(inputs_.layer_id, proto.id());
   FromLayerSpecificPropertiesProto(proto);
 }
 
@@ -1373,10 +1379,10 @@
                               paint_properties_.source_frame_number ==
                                   layer_tree_host_->source_frame_number();
 
-  Point3FToProto(transform_origin_, base->mutable_transform_origin());
-  base->set_background_color(background_color_);
+  Point3FToProto(inputs_.transform_origin, base->mutable_transform_origin());
+  base->set_background_color(inputs_.background_color);
   base->set_safe_opaque_background_color(safe_opaque_background_color_);
-  SizeToProto(use_paint_properties ? paint_properties_.bounds : bounds_,
+  SizeToProto(use_paint_properties ? paint_properties_.bounds : inputs_.bounds,
               base->mutable_bounds());
 
   // TODO(nyquist): Figure out what to do with debug info. See crbug.com/570372.
@@ -1387,44 +1393,47 @@
   base->set_scroll_tree_index(scroll_tree_index_);
   Vector2dFToProto(offset_to_transform_parent_,
                    base->mutable_offset_to_transform_parent());
-  base->set_double_sided(double_sided_);
+  base->set_double_sided(inputs_.double_sided);
   base->set_draws_content(draws_content_);
-  base->set_hide_layer_and_subtree(hide_layer_and_subtree_);
+  base->set_hide_layer_and_subtree(inputs_.hide_layer_and_subtree);
   base->set_subtree_property_changed(subtree_property_changed_);
   base->set_layer_property_changed(layer_property_changed_);
 
   // TODO(nyquist): Add support for serializing FilterOperations for
   // |filters_| and |background_filters_|. See crbug.com/541321.
 
-  base->set_masks_to_bounds(masks_to_bounds_);
-  base->set_main_thread_scrolling_reasons(main_thread_scrolling_reasons_);
-  RegionToProto(non_fast_scrollable_region_,
+  base->set_masks_to_bounds(inputs_.masks_to_bounds);
+  base->set_main_thread_scrolling_reasons(
+      inputs_.main_thread_scrolling_reasons);
+  RegionToProto(inputs_.non_fast_scrollable_region,
                 base->mutable_non_fast_scrollable_region());
-  RegionToProto(touch_event_handler_region_,
+  RegionToProto(inputs_.touch_event_handler_region,
                 base->mutable_touch_event_handler_region());
-  base->set_contents_opaque(contents_opaque_);
-  base->set_opacity(opacity_);
-  base->set_blend_mode(SkXfermodeModeToProto(blend_mode_));
-  base->set_is_root_for_isolated_group(is_root_for_isolated_group_);
-  PointFToProto(position_, base->mutable_position());
+  base->set_contents_opaque(inputs_.contents_opaque);
+  base->set_opacity(inputs_.opacity);
+  base->set_blend_mode(SkXfermodeModeToProto(inputs_.blend_mode));
+  base->set_is_root_for_isolated_group(inputs_.is_root_for_isolated_group);
+  PointFToProto(inputs_.position, base->mutable_position());
   base->set_is_container_for_fixed_position_layers(
-      is_container_for_fixed_position_layers_);
-  position_constraint_.ToProtobuf(base->mutable_position_constraint());
-  base->set_should_flatten_transform(should_flatten_transform_);
+      inputs_.is_container_for_fixed_position_layers);
+  inputs_.position_constraint.ToProtobuf(base->mutable_position_constraint());
+  base->set_should_flatten_transform(inputs_.should_flatten_transform);
   base->set_should_flatten_transform_from_property_tree(
       should_flatten_transform_from_property_tree_);
   base->set_draw_blend_mode(SkXfermodeModeToProto(draw_blend_mode_));
-  base->set_use_parent_backface_visibility(use_parent_backface_visibility_);
-  TransformToProto(transform_, base->mutable_transform());
-  base->set_sorting_context_id(sorting_context_id_);
+  base->set_use_parent_backface_visibility(
+      inputs_.use_parent_backface_visibility);
+  TransformToProto(inputs_.transform, base->mutable_transform());
+  base->set_sorting_context_id(inputs_.sorting_context_id);
   base->set_num_descendants_that_draw_content(
       num_descendants_that_draw_content_);
 
-  base->set_scroll_clip_layer_id(scroll_clip_layer_id_);
-  base->set_user_scrollable_horizontal(user_scrollable_horizontal_);
-  base->set_user_scrollable_vertical(user_scrollable_vertical_);
+  base->set_scroll_clip_layer_id(inputs_.scroll_clip_layer_id);
+  base->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal);
+  base->set_user_scrollable_vertical(inputs_.user_scrollable_vertical);
 
-  int scroll_parent_id = scroll_parent_ ? scroll_parent_->id() : INVALID_ID;
+  int scroll_parent_id =
+      inputs_.scroll_parent ? inputs_.scroll_parent->id() : INVALID_ID;
   base->set_scroll_parent_id(scroll_parent_id);
 
   if (scroll_children_) {
@@ -1432,7 +1441,8 @@
       base->add_scroll_children_ids(child->id());
   }
 
-  int clip_parent_id = clip_parent_ ? clip_parent_->id() : INVALID_ID;
+  int clip_parent_id =
+      inputs_.clip_parent ? inputs_.clip_parent->id() : INVALID_ID;
   base->set_clip_parent_id(clip_parent_id);
 
   if (clip_children_) {
@@ -1440,19 +1450,20 @@
       base->add_clip_children_ids(child->id());
   }
 
-  ScrollOffsetToProto(scroll_offset_, base->mutable_scroll_offset());
+  ScrollOffsetToProto(inputs_.scroll_offset, base->mutable_scroll_offset());
 
   // TODO(nyquist): Figure out what to do with CopyRequests.
   // See crbug.com/570374.
 
-  RectToProto(update_rect_, base->mutable_update_rect());
+  RectToProto(inputs_.update_rect, base->mutable_update_rect());
 
   // TODO(nyquist): Figure out what to do with ElementAnimations.
   // See crbug.com/570376.
 
-  update_rect_ = gfx::Rect();
+  inputs_.update_rect = gfx::Rect();
 
-  base->set_has_will_change_transform_hint(has_will_change_transform_hint_);
+  base->set_has_will_change_transform_hint(
+      inputs_.has_will_change_transform_hint);
 }
 
 void Layer::FromLayerSpecificPropertiesProto(
@@ -1461,10 +1472,10 @@
   DCHECK(layer_tree_host_);
   const proto::BaseLayerProperties& base = proto.base();
 
-  transform_origin_ = ProtoToPoint3F(base.transform_origin());
-  background_color_ = base.background_color();
+  inputs_.transform_origin = ProtoToPoint3F(base.transform_origin());
+  inputs_.background_color = base.background_color();
   safe_opaque_background_color_ = base.safe_opaque_background_color();
-  bounds_ = ProtoToSize(base.bounds());
+  inputs_.bounds = ProtoToSize(base.bounds());
 
   transform_tree_index_ = base.transform_free_index();
   effect_tree_index_ = base.effect_tree_index();
@@ -1472,41 +1483,43 @@
   scroll_tree_index_ = base.scroll_tree_index();
   offset_to_transform_parent_ =
       ProtoToVector2dF(base.offset_to_transform_parent());
-  double_sided_ = base.double_sided();
+  inputs_.double_sided = base.double_sided();
   draws_content_ = base.draws_content();
-  hide_layer_and_subtree_ = base.hide_layer_and_subtree();
+  inputs_.hide_layer_and_subtree = base.hide_layer_and_subtree();
   subtree_property_changed_ = base.subtree_property_changed();
   layer_property_changed_ = base.layer_property_changed();
-  masks_to_bounds_ = base.masks_to_bounds();
-  main_thread_scrolling_reasons_ = base.main_thread_scrolling_reasons();
-  non_fast_scrollable_region_ =
+  inputs_.masks_to_bounds = base.masks_to_bounds();
+  inputs_.main_thread_scrolling_reasons = base.main_thread_scrolling_reasons();
+  inputs_.non_fast_scrollable_region =
       RegionFromProto(base.non_fast_scrollable_region());
-  touch_event_handler_region_ =
+  inputs_.touch_event_handler_region =
       RegionFromProto(base.touch_event_handler_region());
-  contents_opaque_ = base.contents_opaque();
-  opacity_ = base.opacity();
-  blend_mode_ = SkXfermodeModeFromProto(base.blend_mode());
-  is_root_for_isolated_group_ = base.is_root_for_isolated_group();
-  position_ = ProtoToPointF(base.position());
-  is_container_for_fixed_position_layers_ =
+  inputs_.contents_opaque = base.contents_opaque();
+  inputs_.opacity = base.opacity();
+  inputs_.blend_mode = SkXfermodeModeFromProto(base.blend_mode());
+  inputs_.is_root_for_isolated_group = base.is_root_for_isolated_group();
+  inputs_.position = ProtoToPointF(base.position());
+  inputs_.is_container_for_fixed_position_layers =
       base.is_container_for_fixed_position_layers();
-  position_constraint_.FromProtobuf(base.position_constraint());
-  should_flatten_transform_ = base.should_flatten_transform();
+  inputs_.position_constraint.FromProtobuf(base.position_constraint());
+  inputs_.should_flatten_transform = base.should_flatten_transform();
   should_flatten_transform_from_property_tree_ =
       base.should_flatten_transform_from_property_tree();
   draw_blend_mode_ = SkXfermodeModeFromProto(base.draw_blend_mode());
-  use_parent_backface_visibility_ = base.use_parent_backface_visibility();
-  transform_ = ProtoToTransform(base.transform());
-  sorting_context_id_ = base.sorting_context_id();
+  inputs_.use_parent_backface_visibility =
+      base.use_parent_backface_visibility();
+  inputs_.transform = ProtoToTransform(base.transform());
+  inputs_.sorting_context_id = base.sorting_context_id();
   num_descendants_that_draw_content_ = base.num_descendants_that_draw_content();
 
-  scroll_clip_layer_id_ = base.scroll_clip_layer_id();
-  user_scrollable_horizontal_ = base.user_scrollable_horizontal();
-  user_scrollable_vertical_ = base.user_scrollable_vertical();
+  inputs_.scroll_clip_layer_id = base.scroll_clip_layer_id();
+  inputs_.user_scrollable_horizontal = base.user_scrollable_horizontal();
+  inputs_.user_scrollable_vertical = base.user_scrollable_vertical();
 
-  scroll_parent_ = base.scroll_parent_id() == INVALID_ID
-                       ? nullptr
-                       : layer_tree_host_->LayerById(base.scroll_parent_id());
+  inputs_.scroll_parent =
+      base.scroll_parent_id() == INVALID_ID
+          ? nullptr
+          : layer_tree_host_->LayerById(base.scroll_parent_id());
 
   // If there have been scroll children entries in previous deserializations,
   // clear out the set. If there have been none, initialize the set of children.
@@ -1523,9 +1536,10 @@
     scroll_children_->insert(child.get());
   }
 
-  clip_parent_ = base.clip_parent_id() == INVALID_ID
-                     ? nullptr
-                     : layer_tree_host_->LayerById(base.clip_parent_id());
+  inputs_.clip_parent =
+      base.clip_parent_id() == INVALID_ID
+          ? nullptr
+          : layer_tree_host_->LayerById(base.clip_parent_id());
 
   // If there have been clip children entries in previous deserializations,
   // clear out the set. If there have been none, initialize the set of children.
@@ -1542,15 +1556,16 @@
     clip_children_->insert(child.get());
   }
 
-  scroll_offset_ = ProtoToScrollOffset(base.scroll_offset());
+  inputs_.scroll_offset = ProtoToScrollOffset(base.scroll_offset());
 
-  update_rect_.Union(ProtoToRect(base.update_rect()));
+  inputs_.update_rect.Union(ProtoToRect(base.update_rect()));
 
-  has_will_change_transform_hint_ = base.has_will_change_transform_hint();
+  inputs_.has_will_change_transform_hint =
+      base.has_will_change_transform_hint();
 }
 
 std::unique_ptr<LayerImpl> Layer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
-  return LayerImpl::Create(tree_impl, layer_id_);
+  return LayerImpl::Create(tree_impl, inputs_.layer_id);
 }
 
 bool Layer::DrawsContent() const {
@@ -1558,12 +1573,12 @@
 }
 
 bool Layer::HasDrawableContent() const {
-  return is_drawable_;
+  return inputs_.is_drawable;
 }
 
 void Layer::UpdateDrawsContent(bool has_drawable_content) {
   bool draws_content = has_drawable_content;
-  DCHECK(is_drawable_ || !has_drawable_content);
+  DCHECK(inputs_.is_drawable || !has_drawable_content);
   if (draws_content == draws_content_)
     return;
 
@@ -1583,7 +1598,7 @@
 
   // TODO(reveman): Save all layer properties that we depend on not
   // changing until PushProperties() has been called. crbug.com/231016
-  paint_properties_.bounds = bounds_;
+  paint_properties_.bounds = inputs_.bounds;
   paint_properties_.source_frame_number =
       layer_tree_host_->source_frame_number();
 }
@@ -1602,8 +1617,8 @@
 
 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
 Layer::TakeDebugInfo() {
-  if (client_)
-    return client_->TakeDebugInfo(this);
+  if (inputs_.client)
+    return inputs_.client->TakeDebugInfo(this);
   else
     return nullptr;
 }
@@ -1631,16 +1646,16 @@
 // is no need to request a commit to push this value over, so the value is
 // set directly rather than by calling Set<Property>.
 void Layer::OnFilterAnimated(const FilterOperations& filters) {
-  filters_ = filters;
+  inputs_.filters = filters;
 }
 
 void Layer::OnOpacityAnimated(float opacity) {
   DCHECK_GE(opacity, 0.f);
   DCHECK_LE(opacity, 1.f);
 
-  if (opacity_ == opacity)
+  if (inputs_.opacity == opacity)
     return;
-  opacity_ = opacity;
+  inputs_.opacity = opacity;
   // Changing the opacity may make a previously hidden layer visible, so a new
   // recording may be needed.
   SetNeedsUpdate();
@@ -1658,9 +1673,9 @@
 }
 
 void Layer::OnTransformAnimated(const gfx::Transform& transform) {
-  if (transform_ == transform)
+  if (inputs_.transform == transform)
     return;
-  transform_ = transform;
+  inputs_.transform = transform;
   // Changing the transform may change the visible part of this layer, so a new
   // recording may be needed.
   SetNeedsUpdate();
@@ -1751,9 +1766,9 @@
 }
 
 void Layer::SetHasWillChangeTransformHint(bool has_will_change) {
-  if (has_will_change_transform_hint_ == has_will_change)
+  if (inputs_.has_will_change_transform_hint == has_will_change)
     return;
-  has_will_change_transform_hint_ = has_will_change;
+  inputs_.has_will_change_transform_hint = has_will_change;
   SetNeedsCommit();
 }
 
@@ -1804,21 +1819,21 @@
 
 void Layer::SetElementId(ElementId id) {
   DCHECK(IsPropertyChangeAllowed());
-  if (element_id_ == id)
+  if (inputs_.element_id == id)
     return;
   TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
                "Layer::SetElementId", "element", id.AsValue().release());
-  if (element_id_ && layer_tree_host()) {
+  if (inputs_.element_id && layer_tree_host()) {
     layer_tree_host()->animation_host()->UnregisterElement(
-        element_id_, ElementListType::ACTIVE);
+        inputs_.element_id, ElementListType::ACTIVE);
     layer_tree_host()->RemoveFromElementMap(this);
   }
 
-  element_id_ = id;
+  inputs_.element_id = id;
 
-  if (element_id_ && layer_tree_host()) {
+  if (inputs_.element_id && layer_tree_host()) {
     layer_tree_host()->animation_host()->RegisterElement(
-        element_id_, ElementListType::ACTIVE);
+        inputs_.element_id, ElementListType::ACTIVE);
     layer_tree_host()->AddToElementMap(this);
   }
 
@@ -1827,11 +1842,11 @@
 
 void Layer::SetMutableProperties(uint32_t properties) {
   DCHECK(IsPropertyChangeAllowed());
-  if (mutable_properties_ == properties)
+  if (inputs_.mutable_properties == properties)
     return;
   TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
                "Layer::SetMutableProperties", "properties", properties);
-  mutable_properties_ = properties;
+  inputs_.mutable_properties = properties;
   SetNeedsCommit();
 }
 
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 7718e00f..addb510 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -81,7 +81,7 @@
 
   static scoped_refptr<Layer> Create();
 
-  int id() const { return layer_id_; }
+  int id() const { return inputs_.layer_id; }
 
   Layer* RootLayer();
   Layer* parent() { return parent_; }
@@ -94,8 +94,8 @@
   void SetChildren(const LayerList& children);
   bool HasAncestor(const Layer* ancestor) const;
 
-  const LayerList& children() const { return children_; }
-  Layer* child_at(size_t index) { return children_[index].get(); }
+  const LayerList& children() const { return inputs_.children; }
+  Layer* child_at(size_t index) { return inputs_.children[index].get(); }
 
   // This requests the layer and its subtree be rendered and given to the
   // callback. If the copy is unable to be produced (the layer is destroyed
@@ -103,15 +103,13 @@
   // request's source property is set, any prior uncommitted requests having the
   // same source will be aborted.
   void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request);
-  bool HasCopyRequest() const {
-    return !copy_requests_.empty();
-  }
+  bool HasCopyRequest() const { return !inputs_.copy_requests.empty(); }
 
   void TakeCopyRequests(
       std::vector<std::unique_ptr<CopyOutputRequest>>* requests);
 
   virtual void SetBackgroundColor(SkColor background_color);
-  SkColor background_color() const { return background_color_; }
+  SkColor background_color() const { return inputs_.background_color; }
   void SetSafeOpaqueBackgroundColor(SkColor background_color);
   // If contents_opaque(), return an opaque color else return a
   // non-opaque color.  Tries to return background_color(), if possible.
@@ -120,20 +118,20 @@
   // A layer's bounds are in logical, non-page-scaled pixels (however, the
   // root layer's bounds are in physical pixels).
   void SetBounds(const gfx::Size& bounds);
-  gfx::Size bounds() const { return bounds_; }
+  gfx::Size bounds() const { return inputs_.bounds; }
 
   void SetMasksToBounds(bool masks_to_bounds);
-  bool masks_to_bounds() const { return masks_to_bounds_; }
+  bool masks_to_bounds() const { return inputs_.masks_to_bounds; }
 
   void SetMaskLayer(Layer* mask_layer);
-  Layer* mask_layer() { return mask_layer_.get(); }
-  const Layer* mask_layer() const { return mask_layer_.get(); }
+  Layer* mask_layer() { return inputs_.mask_layer.get(); }
+  const Layer* mask_layer() const { return inputs_.mask_layer.get(); }
 
   virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect);
   void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); }
 
   virtual void SetOpacity(float opacity);
-  float opacity() const { return opacity_; }
+  float opacity() const { return inputs_.opacity; }
   float EffectiveOpacity() const;
   bool OpacityIsAnimating() const;
   bool HasPotentiallyRunningOpacityAnimation() const;
@@ -142,7 +140,7 @@
   virtual bool AlwaysUseActiveTreeOpacity() const;
 
   void SetBlendMode(SkXfermode::Mode blend_mode);
-  SkXfermode::Mode blend_mode() const { return blend_mode_; }
+  SkXfermode::Mode blend_mode() const { return inputs_.blend_mode; }
 
   void set_draw_blend_mode(SkXfermode::Mode blend_mode) {
     if (draw_blend_mode_ == blend_mode)
@@ -153,7 +151,7 @@
   SkXfermode::Mode draw_blend_mode() const { return draw_blend_mode_; }
 
   bool uses_default_blend_mode() const {
-    return blend_mode_ == SkXfermode::kSrcOver_Mode;
+    return inputs_.blend_mode == SkXfermode::kSrcOver_Mode;
   }
 
   // A layer is root for an isolated group when it and all its descendants are
@@ -162,11 +160,11 @@
   // layers within the group to blend with layers outside this group.
   void SetIsRootForIsolatedGroup(bool root);
   bool is_root_for_isolated_group() const {
-    return is_root_for_isolated_group_;
+    return inputs_.is_root_for_isolated_group;
   }
 
   void SetFilters(const FilterOperations& filters);
-  const FilterOperations& filters() const { return filters_; }
+  const FilterOperations& filters() const { return inputs_.filters; }
   bool FilterIsAnimating() const;
   bool HasPotentiallyRunningFilterAnimation() const;
 
@@ -175,14 +173,14 @@
   // through the WebLayer interface, and are not exposed to HTML.
   void SetBackgroundFilters(const FilterOperations& filters);
   const FilterOperations& background_filters() const {
-    return background_filters_;
+    return inputs_.background_filters;
   }
 
   virtual void SetContentsOpaque(bool opaque);
-  bool contents_opaque() const { return contents_opaque_; }
+  bool contents_opaque() const { return inputs_.contents_opaque; }
 
   void SetPosition(const gfx::PointF& position);
-  gfx::PointF position() const { return position_; }
+  gfx::PointF position() const { return inputs_.position; }
 
   // A layer that is a container for fixed position layers cannot be both
   // scrollable and have a non-identity transform.
@@ -195,11 +193,11 @@
 
   void SetPositionConstraint(const LayerPositionConstraint& constraint);
   const LayerPositionConstraint& position_constraint() const {
-    return position_constraint_;
+    return inputs_.position_constraint;
   }
 
   void SetTransform(const gfx::Transform& transform);
-  const gfx::Transform& transform() const { return transform_; }
+  const gfx::Transform& transform() const { return inputs_.transform; }
   bool TransformIsAnimating() const;
   bool HasPotentiallyRunningTransformAnimation() const;
   bool HasOnlyTranslationTransforms() const;
@@ -209,7 +207,7 @@
   bool AnimationStartScale(float* start_scale) const;
 
   void SetTransformOrigin(const gfx::Point3F&);
-  gfx::Point3F transform_origin() const { return transform_origin_; }
+  gfx::Point3F transform_origin() const { return inputs_.transform_origin; }
 
   bool HasAnyAnimationTargetingProperty(TargetProperty::Type property) const;
 
@@ -217,8 +215,8 @@
 
   void SetScrollParent(Layer* parent);
 
-  Layer* scroll_parent() { return scroll_parent_; }
-  const Layer* scroll_parent() const { return scroll_parent_; }
+  Layer* scroll_parent() { return inputs_.scroll_parent; }
+  const Layer* scroll_parent() const { return inputs_.scroll_parent; }
 
   void AddScrollChild(Layer* child);
   void RemoveScrollChild(Layer* child);
@@ -230,10 +228,8 @@
 
   void SetClipParent(Layer* ancestor);
 
-  Layer* clip_parent() { return clip_parent_; }
-  const Layer* clip_parent() const {
-    return clip_parent_;
-  }
+  Layer* clip_parent() { return inputs_.clip_parent; }
+  const Layer* clip_parent() const { return inputs_.clip_parent; }
 
   void AddClipChild(Layer* child);
   void RemoveClipChild(Layer* child);
@@ -255,41 +251,43 @@
 
   void SetScrollOffset(const gfx::ScrollOffset& scroll_offset);
 
-  gfx::ScrollOffset scroll_offset() const { return scroll_offset_; }
+  gfx::ScrollOffset scroll_offset() const { return inputs_.scroll_offset; }
   void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset);
 
   void SetScrollClipLayerId(int clip_layer_id);
-  bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; }
+  bool scrollable() const { return inputs_.scroll_clip_layer_id != INVALID_ID; }
   Layer* scroll_clip_layer() const;
 
   void SetUserScrollable(bool horizontal, bool vertical);
   bool user_scrollable_horizontal() const {
-    return user_scrollable_horizontal_;
+    return inputs_.user_scrollable_horizontal;
   }
-  bool user_scrollable_vertical() const { return user_scrollable_vertical_; }
+  bool user_scrollable_vertical() const {
+    return inputs_.user_scrollable_vertical;
+  }
 
   void AddMainThreadScrollingReasons(uint32_t main_thread_scrolling_reasons);
   void ClearMainThreadScrollingReasons(
       uint32_t main_thread_scrolling_reasons_to_clear);
   uint32_t main_thread_scrolling_reasons() const {
-    return main_thread_scrolling_reasons_;
+    return inputs_.main_thread_scrolling_reasons;
   }
   bool should_scroll_on_main_thread() const {
-    return !!main_thread_scrolling_reasons_;
+    return !!inputs_.main_thread_scrolling_reasons;
   }
 
   void SetNonFastScrollableRegion(const Region& non_fast_scrollable_region);
   const Region& non_fast_scrollable_region() const {
-    return non_fast_scrollable_region_;
+    return inputs_.non_fast_scrollable_region;
   }
 
   void SetTouchEventHandlerRegion(const Region& touch_event_handler_region);
   const Region& touch_event_handler_region() const {
-    return touch_event_handler_region_;
+    return inputs_.touch_event_handler_region;
   }
 
   void set_did_scroll_callback(const base::Closure& callback) {
-    did_scroll_callback_ = callback;
+    inputs_.did_scroll_callback = callback;
   }
 
   void SetForceRenderSurfaceForTesting(bool force_render_surface);
@@ -297,19 +295,23 @@
     return force_render_surface_for_testing_;
   }
 
-  gfx::ScrollOffset CurrentScrollOffset() const { return scroll_offset_; }
+  gfx::ScrollOffset CurrentScrollOffset() const {
+    return inputs_.scroll_offset;
+  }
 
   void SetDoubleSided(bool double_sided);
-  bool double_sided() const { return double_sided_; }
+  bool double_sided() const { return inputs_.double_sided; }
 
   void SetShouldFlattenTransform(bool flatten);
-  bool should_flatten_transform() const { return should_flatten_transform_; }
+  bool should_flatten_transform() const {
+    return inputs_.should_flatten_transform;
+  }
 
-  bool Is3dSorted() const { return sorting_context_id_ != 0; }
+  bool Is3dSorted() const { return inputs_.sorting_context_id != 0; }
 
   void SetUseParentBackfaceVisibility(bool use);
   bool use_parent_backface_visibility() const {
-    return use_parent_backface_visibility_;
+    return inputs_.use_parent_backface_visibility;
   }
 
   void SetUseLocalTransformForBackfaceVisibility(bool use_local);
@@ -327,17 +329,18 @@
   void SetIsDrawable(bool is_drawable);
 
   void SetHideLayerAndSubtree(bool hide);
-  bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; }
+  bool hide_layer_and_subtree() const { return inputs_.hide_layer_and_subtree; }
 
   void SetReplicaLayer(Layer* layer);
-  Layer* replica_layer() { return replica_layer_.get(); }
-  const Layer* replica_layer() const { return replica_layer_.get(); }
+  Layer* replica_layer() { return inputs_.replica_layer.get(); }
+  const Layer* replica_layer() const { return inputs_.replica_layer.get(); }
 
-  bool has_mask() const { return !!mask_layer_.get(); }
-  bool has_replica() const { return !!replica_layer_.get(); }
+  bool has_mask() const { return !!inputs_.mask_layer.get(); }
+  bool has_replica() const { return !!inputs_.replica_layer.get(); }
   bool replica_has_mask() const {
-    return replica_layer_.get() &&
-           (mask_layer_.get() || replica_layer_->mask_layer_.get());
+    return inputs_.replica_layer.get() &&
+           (inputs_.mask_layer.get() ||
+            inputs_.replica_layer->inputs_.mask_layer.get());
   }
 
   int NumDescendantsThatDrawContent() const;
@@ -358,7 +361,7 @@
   virtual std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
   TakeDebugInfo();
 
-  void SetLayerClient(LayerClient* client) { client_ = client; }
+  void SetLayerClient(LayerClient* client) { inputs_.client = client; }
 
   virtual void PushPropertiesTo(LayerImpl* layer);
 
@@ -416,8 +419,8 @@
   // Constructs a LayerImpl of the correct runtime type for this Layer type.
   virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl);
 
-  bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); }
-  void ResetNeedsDisplayForTesting() { update_rect_ = gfx::Rect(); }
+  bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); }
+  void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); }
 
   RenderingStatsInstrumentation* rendering_stats_instrumentation() const;
 
@@ -431,7 +434,7 @@
   virtual void RunMicroBenchmark(MicroBenchmark* benchmark);
 
   void Set3dSortingContextId(int id);
-  int sorting_context_id() const { return sorting_context_id_; }
+  int sorting_context_id() const { return inputs_.sorting_context_id; }
 
   void set_property_tree_sequence_number(int sequence_number) {
     property_tree_sequence_number_ = sequence_number;
@@ -493,26 +496,16 @@
   int num_copy_requests_in_target_subtree();
 
   void SetElementId(ElementId id);
-  ElementId element_id() const { return element_id_; }
+  ElementId element_id() const { return inputs_.element_id; }
 
   void SetMutableProperties(uint32_t properties);
-  uint32_t mutable_properties() const { return mutable_properties_; }
+  uint32_t mutable_properties() const { return inputs_.mutable_properties; }
 
-  // Interactions with attached animations.
-  gfx::ScrollOffset ScrollOffsetForAnimation() const;
-  void OnFilterAnimated(const FilterOperations& filters);
-  void OnOpacityAnimated(float opacity);
-  void OnTransformAnimated(const gfx::Transform& transform);
-  void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset);
-  void OnTransformIsCurrentlyAnimatingChanged(bool is_animating);
-  void OnTransformIsPotentiallyAnimatingChanged(bool is_animating);
-  void OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating);
-  void OnOpacityIsPotentiallyAnimatingChanged(bool has_potential_animation);
   bool HasActiveAnimationForTesting() const;
 
   void SetHasWillChangeTransformHint(bool has_will_change);
   bool has_will_change_transform_hint() const {
-    return has_will_change_transform_hint_;
+    return inputs_.has_will_change_transform_hint;
   }
 
  protected:
@@ -564,30 +557,29 @@
   virtual void FromLayerSpecificPropertiesProto(
       const proto::LayerProperties& proto);
 
-  // The update rect is the region of the compositor resource that was
-  // actually updated by the compositor. For layers that may do updating
-  // outside the compositor's control (i.e. plugin layers), this information
-  // is not available and the update rect will remain empty.
-  // Note this rect is in layer space (not content space).
-  gfx::Rect update_rect_;
-
-  scoped_refptr<Layer> mask_layer_;
-
-  int layer_id_;
+  gfx::Rect& update_rect() { return inputs_.update_rect; }
 
   // When true, the layer is about to perform an update. Any commit requests
   // will be handled implicitly after the update completes.
   bool ignore_set_needs_commit_;
 
-  // Layers that share a sorting context id will be sorted together in 3d
-  // space.  0 is a special value that means this layer will not be sorted and
-  // will be drawn in paint order.
-  int sorting_context_id_;
-
  private:
   friend class base::RefCounted<Layer>;
   friend class LayerSerializationTest;
   friend class LayerTreeHostCommon;
+  friend class LayerTreeHost;
+  friend class LayerInternalsForTest;
+
+  // Interactions with attached animations.
+  gfx::ScrollOffset ScrollOffsetForAnimation() const;
+  void OnFilterAnimated(const FilterOperations& filters);
+  void OnOpacityAnimated(float opacity);
+  void OnTransformAnimated(const gfx::Transform& transform);
+  void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset);
+  void OnTransformIsCurrentlyAnimatingChanged(bool is_animating);
+  void OnTransformIsPotentiallyAnimatingChanged(bool is_animating);
+  void OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating);
+  void OnOpacityIsPotentiallyAnimatingChanged(bool has_potential_animation);
 
   void SetParent(Layer* layer);
   bool DescendantIsFixedToContainerLayer() const;
@@ -607,7 +599,95 @@
   // indices becomes invalid.
   void InvalidatePropertyTreesIndices();
 
-  LayerList children_;
+  // Encapsulates all data, callbacks or interfaces received from the embedder.
+  // TODO(khushalsagar): This is only valid when PropertyTrees are built
+  // internally in cc. Update this for the SPv2 path where blink generates
+  // PropertyTrees.
+  struct Inputs {
+    Inputs();
+    ~Inputs();
+
+    int layer_id;
+
+    LayerList children;
+
+    // The update rect is the region of the compositor resource that was
+    // actually updated by the compositor. For layers that may do updating
+    // outside the compositor's control (i.e. plugin layers), this information
+    // is not available and the update rect will remain empty.
+    // Note this rect is in layer space (not content space).
+    gfx::Rect update_rect;
+
+    gfx::Size bounds;
+    bool masks_to_bounds;
+
+    scoped_refptr<Layer> mask_layer;
+
+    // Replica layer used for reflections.
+    scoped_refptr<Layer> replica_layer;
+
+    float opacity;
+    SkXfermode::Mode blend_mode;
+
+    bool is_root_for_isolated_group : 1;
+
+    bool contents_opaque : 1;
+
+    gfx::PointF position;
+    gfx::Transform transform;
+    gfx::Point3F transform_origin;
+
+    bool is_drawable : 1;
+
+    bool double_sided : 1;
+    bool should_flatten_transform : 1;
+
+    // Layers that share a sorting context id will be sorted together in 3d
+    // space.  0 is a special value that means this layer will not be sorted
+    // and will be drawn in paint order.
+    int sorting_context_id;
+
+    bool use_parent_backface_visibility : 1;
+
+    SkColor background_color;
+
+    FilterOperations filters;
+    FilterOperations background_filters;
+
+    gfx::ScrollOffset scroll_offset;
+
+    // This variable indicates which ancestor layer (if any) whose size,
+    // transformed relative to this layer, defines the maximum scroll offset
+    // for this layer.
+    int scroll_clip_layer_id;
+    bool user_scrollable_horizontal : 1;
+    bool user_scrollable_vertical : 1;
+
+    uint32_t main_thread_scrolling_reasons;
+    Region non_fast_scrollable_region;
+
+    Region touch_event_handler_region;
+
+    bool is_container_for_fixed_position_layers : 1;
+    LayerPositionConstraint position_constraint;
+
+    ElementId element_id;
+
+    uint32_t mutable_properties;
+
+    Layer* scroll_parent;
+    Layer* clip_parent;
+
+    bool has_will_change_transform_hint : 1;
+
+    bool hide_layer_and_subtree : 1;
+
+    // The following elements can not and are not serialized.
+    LayerClient* client;
+    base::Closure did_scroll_callback;
+    std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests;
+  };
+
   Layer* parent_;
 
   // Layer instances have a weak pointer to their LayerTreeHost.
@@ -615,74 +695,30 @@
   // updated via SetLayerTreeHost() if a layer moves between trees.
   LayerTreeHost* layer_tree_host_;
 
-  // Layer properties.
-  gfx::Size bounds_;
+  Inputs inputs_;
 
-  gfx::ScrollOffset scroll_offset_;
-  // This variable indicates which ancestor layer (if any) whose size,
-  // transformed relative to this layer, defines the maximum scroll offset for
-  // this layer.
-  int scroll_clip_layer_id_;
   int num_descendants_that_draw_content_;
   int transform_tree_index_;
   int effect_tree_index_;
   int clip_tree_index_;
   int scroll_tree_index_;
   int property_tree_sequence_number_;
-  ElementId element_id_;
-  uint32_t mutable_properties_;
   gfx::Vector2dF offset_to_transform_parent_;
-  uint32_t main_thread_scrolling_reasons_;
   bool should_flatten_transform_from_property_tree_ : 1;
-  bool user_scrollable_horizontal_ : 1;
-  bool user_scrollable_vertical_ : 1;
-  bool is_root_for_isolated_group_ : 1;
-  bool is_container_for_fixed_position_layers_ : 1;
-  bool is_drawable_ : 1;
   bool draws_content_ : 1;
-  bool hide_layer_and_subtree_ : 1;
-  bool masks_to_bounds_ : 1;
-  bool contents_opaque_ : 1;
-  bool double_sided_ : 1;
-  bool should_flatten_transform_ : 1;
-  bool use_parent_backface_visibility_ : 1;
   bool use_local_transform_for_backface_visibility_ : 1;
   bool should_check_backface_visibility_ : 1;
   bool force_render_surface_for_testing_ : 1;
   bool subtree_property_changed_ : 1;
   bool layer_property_changed_ : 1;
-  bool has_will_change_transform_hint_ : 1;
-  Region non_fast_scrollable_region_;
-  Region touch_event_handler_region_;
-  gfx::PointF position_;
-  SkColor background_color_;
   SkColor safe_opaque_background_color_;
-  float opacity_;
-  SkXfermode::Mode blend_mode_;
   // draw_blend_mode may be different than blend_mode_,
   // when a RenderSurface re-parents the layer's blend_mode.
   SkXfermode::Mode draw_blend_mode_;
-  FilterOperations filters_;
-  FilterOperations background_filters_;
-  LayerPositionConstraint position_constraint_;
-  Layer* scroll_parent_;
   std::unique_ptr<std::set<Layer*>> scroll_children_;
 
-  Layer* clip_parent_;
   std::unique_ptr<std::set<Layer*>> clip_children_;
 
-  gfx::Transform transform_;
-  gfx::Point3F transform_origin_;
-
-  // Replica layer used for reflections.
-  scoped_refptr<Layer> replica_layer_;
-
-  LayerClient* client_;
-
-  std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_;
-
-  base::Closure did_scroll_callback_;
-
   PaintProperties paint_properties_;
 
   // These all act like draw properties, so don't need push properties.
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index 6f9dfbf..65e38d3 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -24,6 +24,7 @@
 #include "cc/test/fake_layer_tree_host_client.h"
 #include "cc/test/fake_layer_tree_host_impl.h"
 #include "cc/test/geometry_test_utils.h"
+#include "cc/test/layer_internals_for_test.h"
 #include "cc/test/layer_test_common.h"
 #include "cc/test/test_gpu_memory_buffer_manager.h"
 #include "cc/test/test_shared_bitmap_manager.h"
@@ -129,7 +130,7 @@
 
     // The following member is reset during serialization, so store the original
     // values.
-    gfx::Rect update_rect = src->update_rect_;
+    gfx::Rect update_rect = src->inputs_.update_rect;
 
     // Serialize |src| to protobuf and read the first entry in the
     // LayerUpdate. There are no descendants, so the serialization
@@ -140,14 +141,14 @@
     proto::LayerProperties props = layer_update.layers(0);
 
     // The |dest| layer needs to be able to lookup the scroll and clip parents.
-    if (src->scroll_parent_)
-      layer_tree_host_->RegisterLayer(src->scroll_parent_);
+    if (src->inputs_.scroll_parent)
+      layer_tree_host_->RegisterLayer(src->inputs_.scroll_parent);
     if (src->scroll_children_) {
       for (auto* child : *(src->scroll_children_))
         layer_tree_host_->RegisterLayer(child);
     }
-    if (src->clip_parent_)
-      layer_tree_host_->RegisterLayer(src->clip_parent_);
+    if (src->inputs_.clip_parent)
+      layer_tree_host_->RegisterLayer(src->inputs_.clip_parent);
     if (src->clip_children_) {
       for (auto* child : *(src->clip_children_))
         layer_tree_host_->RegisterLayer(child);
@@ -157,60 +158,67 @@
     src->SetLayerTreeHost(nullptr);
 
     scoped_refptr<Layer> dest = Layer::Create();
-    dest->layer_id_ = src->layer_id_;
+    dest->inputs_.layer_id = src->inputs_.layer_id;
     dest->SetLayerTreeHost(layer_tree_host_.get());
     dest->FromLayerPropertiesProto(props);
 
     // Verify that both layers are equal.
-    EXPECT_EQ(src->transform_origin_, dest->transform_origin_);
-    EXPECT_EQ(src->background_color_, dest->background_color_);
-    EXPECT_EQ(src->bounds_, dest->bounds_);
+    EXPECT_EQ(src->inputs_.transform_origin, dest->inputs_.transform_origin);
+    EXPECT_EQ(src->inputs_.background_color, dest->inputs_.background_color);
+    EXPECT_EQ(src->inputs_.bounds, dest->inputs_.bounds);
     EXPECT_EQ(src->transform_tree_index_, dest->transform_tree_index_);
     EXPECT_EQ(src->effect_tree_index_, dest->effect_tree_index_);
     EXPECT_EQ(src->clip_tree_index_, dest->clip_tree_index_);
     EXPECT_EQ(src->offset_to_transform_parent_,
               dest->offset_to_transform_parent_);
-    EXPECT_EQ(src->double_sided_, dest->double_sided_);
+    EXPECT_EQ(src->inputs_.double_sided, dest->inputs_.double_sided);
     EXPECT_EQ(src->draws_content_, dest->draws_content_);
-    EXPECT_EQ(src->hide_layer_and_subtree_, dest->hide_layer_and_subtree_);
-    EXPECT_EQ(src->masks_to_bounds_, dest->masks_to_bounds_);
-    EXPECT_EQ(src->main_thread_scrolling_reasons_,
-              dest->main_thread_scrolling_reasons_);
-    EXPECT_EQ(src->non_fast_scrollable_region_,
-              dest->non_fast_scrollable_region_);
-    EXPECT_EQ(src->touch_event_handler_region_,
-              dest->touch_event_handler_region_);
-    EXPECT_EQ(src->contents_opaque_, dest->contents_opaque_);
-    EXPECT_EQ(src->opacity_, dest->opacity_);
-    EXPECT_EQ(src->blend_mode_, dest->blend_mode_);
-    EXPECT_EQ(src->is_root_for_isolated_group_,
-              dest->is_root_for_isolated_group_);
-    EXPECT_EQ(src->position_, dest->position_);
-    EXPECT_EQ(src->is_container_for_fixed_position_layers_,
-              dest->is_container_for_fixed_position_layers_);
-    EXPECT_EQ(src->position_constraint_, dest->position_constraint_);
-    EXPECT_EQ(src->should_flatten_transform_, dest->should_flatten_transform_);
+    EXPECT_EQ(src->inputs_.hide_layer_and_subtree,
+              dest->inputs_.hide_layer_and_subtree);
+    EXPECT_EQ(src->inputs_.masks_to_bounds, dest->inputs_.masks_to_bounds);
+    EXPECT_EQ(src->inputs_.main_thread_scrolling_reasons,
+              dest->inputs_.main_thread_scrolling_reasons);
+    EXPECT_EQ(src->inputs_.non_fast_scrollable_region,
+              dest->inputs_.non_fast_scrollable_region);
+    EXPECT_EQ(src->inputs_.touch_event_handler_region,
+              dest->inputs_.touch_event_handler_region);
+    EXPECT_EQ(src->inputs_.contents_opaque, dest->inputs_.contents_opaque);
+    EXPECT_EQ(src->inputs_.opacity, dest->inputs_.opacity);
+    EXPECT_EQ(src->inputs_.blend_mode, dest->inputs_.blend_mode);
+    EXPECT_EQ(src->inputs_.is_root_for_isolated_group,
+              dest->inputs_.is_root_for_isolated_group);
+    EXPECT_EQ(src->inputs_.position, dest->inputs_.position);
+    EXPECT_EQ(src->inputs_.is_container_for_fixed_position_layers,
+              dest->inputs_.is_container_for_fixed_position_layers);
+    EXPECT_EQ(src->inputs_.position_constraint,
+              dest->inputs_.position_constraint);
+    EXPECT_EQ(src->inputs_.should_flatten_transform,
+              dest->inputs_.should_flatten_transform);
     EXPECT_EQ(src->should_flatten_transform_from_property_tree_,
               dest->should_flatten_transform_from_property_tree_);
     EXPECT_EQ(src->draw_blend_mode_, dest->draw_blend_mode_);
-    EXPECT_EQ(src->use_parent_backface_visibility_,
-              dest->use_parent_backface_visibility_);
-    EXPECT_EQ(src->transform_, dest->transform_);
-    EXPECT_EQ(src->sorting_context_id_, dest->sorting_context_id_);
+    EXPECT_EQ(src->inputs_.use_parent_backface_visibility,
+              dest->inputs_.use_parent_backface_visibility);
+    EXPECT_EQ(src->inputs_.transform, dest->inputs_.transform);
+    EXPECT_EQ(src->inputs_.sorting_context_id,
+              dest->inputs_.sorting_context_id);
     EXPECT_EQ(src->num_descendants_that_draw_content_,
               dest->num_descendants_that_draw_content_);
-    EXPECT_EQ(src->scroll_clip_layer_id_, dest->scroll_clip_layer_id_);
-    EXPECT_EQ(src->user_scrollable_horizontal_,
-              dest->user_scrollable_horizontal_);
-    EXPECT_EQ(src->user_scrollable_vertical_, dest->user_scrollable_vertical_);
-    EXPECT_EQ(src->scroll_offset_, dest->scroll_offset_);
-    EXPECT_EQ(update_rect, dest->update_rect_);
+    EXPECT_EQ(src->inputs_.scroll_clip_layer_id,
+              dest->inputs_.scroll_clip_layer_id);
+    EXPECT_EQ(src->inputs_.user_scrollable_horizontal,
+              dest->inputs_.user_scrollable_horizontal);
+    EXPECT_EQ(src->inputs_.user_scrollable_vertical,
+              dest->inputs_.user_scrollable_vertical);
+    EXPECT_EQ(src->inputs_.scroll_offset, dest->inputs_.scroll_offset);
+    EXPECT_EQ(update_rect, dest->inputs_.update_rect);
 
-    if (src->scroll_parent_) {
-      ASSERT_TRUE(dest->scroll_parent_);
-      EXPECT_EQ(src->scroll_parent_->id(), dest->scroll_parent_->id());
+    if (src->inputs_.scroll_parent) {
+      ASSERT_TRUE(dest->inputs_.scroll_parent);
+      EXPECT_EQ(src->inputs_.scroll_parent->id(),
+                dest->inputs_.scroll_parent->id());
     } else {
-      EXPECT_FALSE(dest->scroll_parent_);
+      EXPECT_FALSE(dest->inputs_.scroll_parent);
     }
     if (src->scroll_children_) {
       ASSERT_TRUE(dest->scroll_children_);
@@ -219,11 +227,12 @@
       EXPECT_FALSE(dest->scroll_children_);
     }
 
-    if (src->clip_parent_) {
-      ASSERT_TRUE(dest->clip_parent_);
-      EXPECT_EQ(src->clip_parent_->id(), dest->clip_parent_->id());
+    if (src->inputs_.clip_parent) {
+      ASSERT_TRUE(dest->inputs_.clip_parent);
+      EXPECT_EQ(src->inputs_.clip_parent->id(),
+                dest->inputs_.clip_parent->id());
     } else {
-      ASSERT_FALSE(dest->clip_parent_);
+      ASSERT_FALSE(dest->inputs_.clip_parent);
     }
     if (src->clip_children_) {
       ASSERT_TRUE(dest->clip_children_);
@@ -233,16 +242,16 @@
     }
 
     // The following member should have been reset during serialization.
-    EXPECT_EQ(gfx::Rect(), src->update_rect_);
+    EXPECT_EQ(gfx::Rect(), src->inputs_.update_rect);
 
     // Before deleting |dest|, the LayerTreeHost must be unset.
     dest->SetLayerTreeHost(nullptr);
 
     // Cleanup scroll tree.
-    if (src->scroll_parent_)
-      layer_tree_host_->UnregisterLayer(src->scroll_parent_);
-    src->scroll_parent_ = nullptr;
-    dest->scroll_parent_ = nullptr;
+    if (src->inputs_.scroll_parent)
+      layer_tree_host_->UnregisterLayer(src->inputs_.scroll_parent);
+    src->inputs_.scroll_parent = nullptr;
+    dest->inputs_.scroll_parent = nullptr;
     if (src->scroll_children_) {
       for (auto* child : *(src->scroll_children_))
         layer_tree_host_->UnregisterLayer(child);
@@ -251,10 +260,10 @@
     }
 
     // Cleanup clip tree.
-    if (src->clip_parent_)
-      layer_tree_host_->UnregisterLayer(src->clip_parent_);
-    src->clip_parent_ = nullptr;
-    dest->clip_parent_ = nullptr;
+    if (src->inputs_.clip_parent)
+      layer_tree_host_->UnregisterLayer(src->inputs_.clip_parent);
+    src->inputs_.clip_parent = nullptr;
+    dest->inputs_.clip_parent = nullptr;
     if (src->clip_children_) {
       for (auto* child : *(src->clip_children_))
         layer_tree_host_->UnregisterLayer(child);
@@ -270,91 +279,96 @@
 
   void RunArbitraryMembersChangedTest() {
     scoped_refptr<Layer> layer = Layer::Create();
-    layer->transform_origin_ = gfx::Point3F(3.0f, 1.0f, 4.0f);
-    layer->background_color_ = SK_ColorRED;
-    layer->bounds_ = gfx::Size(3, 14);
+    layer->inputs_.transform_origin = gfx::Point3F(3.0f, 1.0f, 4.0f);
+    layer->inputs_.background_color = SK_ColorRED;
+    layer->inputs_.bounds = gfx::Size(3, 14);
     layer->transform_tree_index_ = -1;
     layer->effect_tree_index_ = -1;
     layer->clip_tree_index_ = 71;
     layer->offset_to_transform_parent_ = gfx::Vector2dF(3.14f, 1.618f);
-    layer->double_sided_ = true;
+    layer->inputs_.double_sided = true;
     layer->draws_content_ = true;
-    layer->hide_layer_and_subtree_ = false;
-    layer->masks_to_bounds_ = true;
-    layer->main_thread_scrolling_reasons_ =
+    layer->inputs_.hide_layer_and_subtree = false;
+    layer->inputs_.masks_to_bounds = true;
+    layer->inputs_.main_thread_scrolling_reasons =
         MainThreadScrollingReason::kNotScrollingOnMain;
-    layer->non_fast_scrollable_region_ = Region(gfx::Rect(5, 1, 14, 3));
-    layer->touch_event_handler_region_ = Region(gfx::Rect(3, 14, 1, 5));
-    layer->contents_opaque_ = true;
-    layer->opacity_ = 1.f;
-    layer->blend_mode_ = SkXfermode::kSrcOver_Mode;
-    layer->is_root_for_isolated_group_ = true;
-    layer->position_ = gfx::PointF(3.14f, 6.28f);
-    layer->is_container_for_fixed_position_layers_ = true;
+    layer->inputs_.non_fast_scrollable_region = Region(gfx::Rect(5, 1, 14, 3));
+    layer->inputs_.touch_event_handler_region = Region(gfx::Rect(3, 14, 1, 5));
+    layer->inputs_.contents_opaque = true;
+    layer->inputs_.opacity = 1.f;
+    layer->inputs_.blend_mode = SkXfermode::kSrcOver_Mode;
+    layer->inputs_.is_root_for_isolated_group = true;
+    layer->inputs_.position = gfx::PointF(3.14f, 6.28f);
+    layer->inputs_.is_container_for_fixed_position_layers = true;
     LayerPositionConstraint pos_con;
     pos_con.set_is_fixed_to_bottom_edge(true);
-    layer->position_constraint_ = pos_con;
-    layer->should_flatten_transform_ = true;
+    layer->inputs_.position_constraint = pos_con;
+    layer->inputs_.should_flatten_transform = true;
     layer->should_flatten_transform_from_property_tree_ = true;
     layer->draw_blend_mode_ = SkXfermode::kSrcOut_Mode;
-    layer->use_parent_backface_visibility_ = true;
+    layer->inputs_.use_parent_backface_visibility = true;
     gfx::Transform transform;
     transform.Rotate(90);
-    layer->transform_ = transform;
-    layer->sorting_context_id_ = 0;
+    layer->inputs_.transform = transform;
+    layer->inputs_.sorting_context_id = 0;
     layer->num_descendants_that_draw_content_ = 5;
-    layer->scroll_clip_layer_id_ = Layer::INVALID_ID;
-    layer->user_scrollable_horizontal_ = false;
-    layer->user_scrollable_vertical_ = true;
-    layer->scroll_offset_ = gfx::ScrollOffset(3, 14);
-    layer->update_rect_ = gfx::Rect(14, 15);
+    layer->inputs_.scroll_clip_layer_id = Layer::INVALID_ID;
+    layer->inputs_.user_scrollable_horizontal = false;
+    layer->inputs_.user_scrollable_vertical = true;
+    layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14);
+    layer->inputs_.update_rect = gfx::Rect(14, 15);
 
     VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get());
   }
 
   void RunAllMembersChangedTest() {
     scoped_refptr<Layer> layer = Layer::Create();
-    layer->transform_origin_ = gfx::Point3F(3.0f, 1.0f, 4.0f);
-    layer->background_color_ = SK_ColorRED;
-    layer->bounds_ = gfx::Size(3, 14);
+    layer->inputs_.transform_origin = gfx::Point3F(3.0f, 1.0f, 4.0f);
+    layer->inputs_.background_color = SK_ColorRED;
+    layer->inputs_.bounds = gfx::Size(3, 14);
     layer->transform_tree_index_ = 39;
     layer->effect_tree_index_ = 17;
     layer->clip_tree_index_ = 71;
     layer->offset_to_transform_parent_ = gfx::Vector2dF(3.14f, 1.618f);
-    layer->double_sided_ = !layer->double_sided_;
+    layer->inputs_.double_sided = !layer->inputs_.double_sided;
     layer->draws_content_ = !layer->draws_content_;
-    layer->hide_layer_and_subtree_ = !layer->hide_layer_and_subtree_;
-    layer->masks_to_bounds_ = !layer->masks_to_bounds_;
-    layer->main_thread_scrolling_reasons_ =
+    layer->inputs_.hide_layer_and_subtree =
+        !layer->inputs_.hide_layer_and_subtree;
+    layer->inputs_.masks_to_bounds = !layer->inputs_.masks_to_bounds;
+    layer->inputs_.main_thread_scrolling_reasons =
         MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects;
-    layer->non_fast_scrollable_region_ = Region(gfx::Rect(5, 1, 14, 3));
-    layer->touch_event_handler_region_ = Region(gfx::Rect(3, 14, 1, 5));
-    layer->contents_opaque_ = !layer->contents_opaque_;
-    layer->opacity_ = 3.14f;
-    layer->blend_mode_ = SkXfermode::kSrcIn_Mode;
-    layer->is_root_for_isolated_group_ = !layer->is_root_for_isolated_group_;
-    layer->position_ = gfx::PointF(3.14f, 6.28f);
-    layer->is_container_for_fixed_position_layers_ =
-        !layer->is_container_for_fixed_position_layers_;
+    layer->inputs_.non_fast_scrollable_region = Region(gfx::Rect(5, 1, 14, 3));
+    layer->inputs_.touch_event_handler_region = Region(gfx::Rect(3, 14, 1, 5));
+    layer->inputs_.contents_opaque = !layer->inputs_.contents_opaque;
+    layer->inputs_.opacity = 3.14f;
+    layer->inputs_.blend_mode = SkXfermode::kSrcIn_Mode;
+    layer->inputs_.is_root_for_isolated_group =
+        !layer->inputs_.is_root_for_isolated_group;
+    layer->inputs_.position = gfx::PointF(3.14f, 6.28f);
+    layer->inputs_.is_container_for_fixed_position_layers =
+        !layer->inputs_.is_container_for_fixed_position_layers;
     LayerPositionConstraint pos_con;
     pos_con.set_is_fixed_to_bottom_edge(true);
-    layer->position_constraint_ = pos_con;
-    layer->should_flatten_transform_ = !layer->should_flatten_transform_;
+    layer->inputs_.position_constraint = pos_con;
+    layer->inputs_.should_flatten_transform =
+        !layer->inputs_.should_flatten_transform;
     layer->should_flatten_transform_from_property_tree_ =
         !layer->should_flatten_transform_from_property_tree_;
     layer->draw_blend_mode_ = SkXfermode::kSrcOut_Mode;
-    layer->use_parent_backface_visibility_ =
-        !layer->use_parent_backface_visibility_;
+    layer->inputs_.use_parent_backface_visibility =
+        !layer->inputs_.use_parent_backface_visibility;
     gfx::Transform transform;
     transform.Rotate(90);
-    layer->transform_ = transform;
-    layer->sorting_context_id_ = 42;
+    layer->inputs_.transform = transform;
+    layer->inputs_.sorting_context_id = 42;
     layer->num_descendants_that_draw_content_ = 5;
-    layer->scroll_clip_layer_id_ = 17;
-    layer->user_scrollable_horizontal_ = !layer->user_scrollable_horizontal_;
-    layer->user_scrollable_vertical_ = !layer->user_scrollable_vertical_;
-    layer->scroll_offset_ = gfx::ScrollOffset(3, 14);
-    layer->update_rect_ = gfx::Rect(14, 15);
+    layer->inputs_.scroll_clip_layer_id = 17;
+    layer->inputs_.user_scrollable_horizontal =
+        !layer->inputs_.user_scrollable_horizontal;
+    layer->inputs_.user_scrollable_vertical =
+        !layer->inputs_.user_scrollable_vertical;
+    layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14);
+    layer->inputs_.update_rect = gfx::Rect(14, 15);
 
     VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get());
   }
@@ -367,7 +381,8 @@
     scoped_refptr<SolidColorScrollbarLayer> deserialized_scrollbar =
         SolidColorScrollbarLayer::Create(ScrollbarOrientation::HORIZONTAL, -1,
                                          -1, false, Layer::INVALID_ID);
-    deserialized_scrollbar->layer_id_ = source_scrollbar->layer_id_;
+    deserialized_scrollbar->inputs_.layer_id =
+        source_scrollbar->inputs_.layer_id;
 
     // FromLayerSpecificPropertiesProto expects a non-null LayerTreeHost to be
     // set.
@@ -393,13 +408,13 @@
     scoped_refptr<Layer> layer = Layer::Create();
 
     scoped_refptr<Layer> scroll_parent = Layer::Create();
-    layer->scroll_parent_ = scroll_parent.get();
+    layer->inputs_.scroll_parent = scroll_parent.get();
     scoped_refptr<Layer> scroll_child = Layer::Create();
     layer->scroll_children_.reset(new std::set<Layer*>);
     layer->scroll_children_->insert(scroll_child.get());
 
     scoped_refptr<Layer> clip_parent = Layer::Create();
-    layer->clip_parent_ = clip_parent.get();
+    layer->inputs_.clip_parent = clip_parent.get();
     layer->clip_children_.reset(new std::set<Layer*>);
     scoped_refptr<Layer> clip_child1 = Layer::Create();
     layer->clip_children_->insert(clip_child1.get());
@@ -542,9 +557,9 @@
     EXPECT_EQ(layer_src_b->id(), layer_dest_b->id());
 
     // Swap order of the children.
-    scoped_refptr<Layer> tmp_a = layer_src_root->children_[0];
-    layer_src_root->children_[0] = layer_src_root->children_[1];
-    layer_src_root->children_[1] = tmp_a;
+    scoped_refptr<Layer> tmp_a = layer_src_root->inputs_.children[0];
+    layer_src_root->inputs_.children[0] = layer_src_root->inputs_.children[1];
+    layer_src_root->inputs_.children[1] = tmp_a;
 
     // Fake the fact that the destination layers have valid indexes.
     layer_dest_root->transform_tree_index_ = 33;
@@ -2192,20 +2207,22 @@
   scoped_refptr<Layer> layer = Layer::Create();
   EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(layer));
 
+  LayerInternalsForTest layer_internals(layer.get());
+
   EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1);
-  layer->OnOpacityAnimated(0.5f);
+  layer_internals.OnOpacityAnimated(0.5f);
   Mock::VerifyAndClearExpectations(layer_tree_host_.get());
 
   EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1);
   gfx::Transform transform;
   transform.Rotate(45.0);
-  layer->OnTransformAnimated(transform);
+  layer_internals.OnTransformAnimated(transform);
   Mock::VerifyAndClearExpectations(layer_tree_host_.get());
 
   // Scroll offset animation should not schedule a layer update since it is
   // handled similarly to normal compositor scroll updates.
   EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(0);
-  layer->OnScrollOffsetAnimated(gfx::ScrollOffset(10, 10));
+  layer_internals.OnScrollOffsetAnimated(gfx::ScrollOffset(10, 10));
   Mock::VerifyAndClearExpectations(layer_tree_host_.get());
 }
 
diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc
index 6bbcf107..09bb588b 100644
--- a/cc/layers/painted_scrollbar_layer.cc
+++ b/cc/layers/painted_scrollbar_layer.cc
@@ -245,7 +245,7 @@
     updated = true;
   }
 
-  if (update_rect_.IsEmpty() && track_resource_)
+  if (update_rect().IsEmpty() && track_resource_)
     return updated;
 
   if (!track_resource_ || scrollbar_->NeedsPaintPart(TRACK)) {
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index eab540e..7d1e142 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -201,7 +201,7 @@
   // SetTextureMailbox could be called externally and the same mailbox used for
   // different textures.  Such callers notify this layer that the texture has
   // changed by calling SetNeedsDisplay, so check for that here.
-  return updated || !update_rect_.IsEmpty();
+  return updated || !update_rect().IsEmpty();
 }
 
 void TextureLayer::PushPropertiesTo(LayerImpl* layer) {
diff --git a/cc/layers/video_layer.cc b/cc/layers/video_layer.cc
index fe4f2ed..177721b 100644
--- a/cc/layers/video_layer.cc
+++ b/cc/layers/video_layer.cc
@@ -35,7 +35,7 @@
   //
   // This is the inefficient legacy redraw path for videos.  It's better to
   // communicate this directly to the VideoLayerImpl.
-  updated |= !update_rect_.IsEmpty();
+  updated |= !update_rect().IsEmpty();
 
   return updated;
 }
diff --git a/cc/test/fake_picture_layer.cc b/cc/test/fake_picture_layer.cc
index 291342cd..a4e9e8f4 100644
--- a/cc/test/fake_picture_layer.cc
+++ b/cc/test/fake_picture_layer.cc
@@ -32,8 +32,8 @@
 std::unique_ptr<LayerImpl> FakePictureLayer::CreateLayerImpl(
     LayerTreeImpl* tree_impl) {
   if (is_mask())
-    return FakePictureLayerImpl::CreateMask(tree_impl, layer_id_);
-  return FakePictureLayerImpl::Create(tree_impl, layer_id_);
+    return FakePictureLayerImpl::CreateMask(tree_impl, id());
+  return FakePictureLayerImpl::Create(tree_impl, id());
 }
 
 bool FakePictureLayer::Update() {
diff --git a/cc/test/layer_internals_for_test.cc b/cc/test/layer_internals_for_test.cc
new file mode 100644
index 0000000..321330c
--- /dev/null
+++ b/cc/test/layer_internals_for_test.cc
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/test/layer_internals_for_test.h"
+
+#include "cc/layers/layer.h"
+
+namespace cc {
+
+LayerInternalsForTest::LayerInternalsForTest(Layer* layer) : layer_(layer) {}
+
+void LayerInternalsForTest::OnOpacityAnimated(float opacity) {
+  layer_->OnOpacityAnimated(opacity);
+}
+
+void LayerInternalsForTest::OnTransformAnimated(
+    const gfx::Transform& transform) {
+  layer_->OnTransformAnimated(transform);
+}
+
+void LayerInternalsForTest::OnScrollOffsetAnimated(
+    const gfx::ScrollOffset& scroll_offset) {
+  layer_->OnScrollOffsetAnimated(scroll_offset);
+}
+
+}  // namespace cc
diff --git a/cc/test/layer_internals_for_test.h b/cc/test/layer_internals_for_test.h
new file mode 100644
index 0000000..58fce8c
--- /dev/null
+++ b/cc/test/layer_internals_for_test.h
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TEST_LAYER_INTERNALS_FOR_TEST_H_
+#define CC_TEST_LAYER_INTERNALS_FOR_TEST_H_
+
+#include "base/macros.h"
+#include "cc/layers/layer.h"
+
+namespace cc {
+
+// Utility class to give tests access to Layer private methods.
+class LayerInternalsForTest {
+ public:
+  explicit LayerInternalsForTest(Layer* layer);
+
+  void OnOpacityAnimated(float opacity);
+  void OnTransformAnimated(const gfx::Transform& transform);
+  void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset);
+
+ private:
+  Layer* layer_;
+};
+
+}  // namespace cc
+
+#endif  // CC_TEST_LAYER_INTERNALS_FOR_TEST_H_
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 74e73a25..5530858f 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -45,6 +45,7 @@
 #include "cc/test/fake_scoped_ui_resource.h"
 #include "cc/test/fake_video_frame_provider.h"
 #include "cc/test/geometry_test_utils.h"
+#include "cc/test/layer_internals_for_test.h"
 #include "cc/test/layer_tree_test.h"
 #include "cc/test/test_shared_bitmap_manager.h"
 #include "cc/test/test_web_graphics_context_3d.h"
@@ -1116,7 +1117,7 @@
     if (layer_tree_host()->source_frame_number() == 1) {
       gfx::Transform scale;
       scale.Scale(2.0, 2.0);
-      child_->OnTransformAnimated(scale);
+      LayerInternalsForTest(child_.get()).OnTransformAnimated(scale);
     }
   }
 
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc
index 5ac778c..f91e69d3 100644
--- a/cc/trees/tree_synchronizer_unittest.cc
+++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -60,7 +60,7 @@
 
   std::unique_ptr<LayerImpl> CreateLayerImpl(
       LayerTreeImpl* tree_impl) override {
-    return MockLayerImpl::Create(tree_impl, layer_id_);
+    return MockLayerImpl::Create(tree_impl, id());
   }
 
   void PushPropertiesTo(LayerImpl* layer_impl) override {