ui: Cleanup ui::Layer

* Add & update description of some member functions and variables.
* Remove unused variable - layer_updated_externally_.
* Remove redundant function calls - SetXXXImmediately().
    - Immediate setting is done by default animator.

[email protected]
BUG=NONE
TEST=compositor_unittests

Review URL: https://codereview.chromium.org/140443002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245357 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h
index dc124a7..c62550e 100644
--- a/ui/compositor/layer.h
+++ b/ui/compositor/layer.h
@@ -283,14 +283,13 @@
   // SchedulePaint() for that.
   void ScheduleDraw();
 
-  // Sends damaged rectangles recorded in |damaged_region_| to
-  // |compostior_| to repaint the content.
+  // Uses damaged rectangles recorded in |damaged_region_| to invalidate the
+  // |cc_layer_|.
   void SendDamagedRects();
 
   const SkRegion& damaged_region() const { return damaged_region_; }
 
-  // Suppresses painting the content by disgarding damaged region and ignoring
-  // new paint requests.
+  // Suppresses painting the content by disconnecting |delegate_|.
   void SuppressPaint();
 
   // Notifies the layer that the device scale factor has changed.
@@ -298,7 +297,7 @@
 
   // Sets whether the layer should scale its content. If true, the canvas will
   // be scaled in software rendering mode before it is passed to
-  // |LayerDelegate::OnPaint|.
+  // |LayerDelegate::OnPaintLayer|.
   // Set to false if the delegate handles scaling.
   // NOTE: if this is called during |LayerDelegate::OnPaint|, the new value will
   // not apply to the canvas passed to the pending draw.
@@ -307,10 +306,6 @@
   // Returns true if the layer scales its content.
   bool scale_content() const { return scale_content_; }
 
-  // Sometimes the Layer is being updated by something other than SetCanvas
-  // (e.g. the GPU process on UI_COMPOSITOR_IMAGE_TRANSPORT).
-  bool layer_updated_externally() const { return layer_updated_externally_; }
-
   // Requets a copy of the layer's output as a texture or bitmap.
   void RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request);
 
@@ -358,16 +353,6 @@
   bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const;
   bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const;
 
-  // Following are invoked from the animation or if no animation exists to
-  // update the values immediately.
-  void SetBoundsImmediately(const gfx::Rect& bounds);
-  void SetTransformImmediately(const gfx::Transform& transform);
-  void SetOpacityImmediately(float opacity);
-  void SetVisibilityImmediately(bool visibility);
-  void SetBrightnessImmediately(float brightness);
-  void SetGrayscaleImmediately(float grayscale);
-  void SetColorImmediately(SkColor color);
-
   // Implementation of LayerAnimatorDelegate
   virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) OVERRIDE;
   virtual void SetTransformFromAnimation(
@@ -390,7 +375,10 @@
       scoped_ptr<cc::Animation> animation) OVERRIDE;
   virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE;
 
+  // Creates a corresponding composited layer for |type_|.
   void CreateWebLayer();
+
+  // Recomputes and sets to |cc_layer_|.
   void RecomputeCCTransformFromTransform(const gfx::Transform& transform);
   void RecomputeDrawsContentAndUVRect();
   void RecomputePosition();
@@ -401,8 +389,7 @@
   // Set all filters which got applied to the layer background.
   void SetLayerBackgroundFilters();
 
-  void UpdateIsDrawn();
-
+  // Cleanup |cc_layer_| and replaces it with |new_layer|.
   void SwitchToLayer(scoped_refptr<cc::Layer> new_layer);
 
   // We cannot send animations to our cc_layer_ until we have been added to a
@@ -431,9 +418,6 @@
 
   bool fills_bounds_opaquely_;
 
-  // If true the layer is always up to date.
-  bool layer_updated_externally_;
-
   // Union of damaged rects, in pixel coordinates, to be used when
   // compositor is ready to paint the content.
   SkRegion damaged_region_;