Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Unified Diff: ui/compositor/layer.h

Issue 140443002: ui: Cleanup ui::Layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/compositor/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.h
diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h
index dc124a73d60ea6b3a2bc91eb27727933d1b61ce0..c62550e08c76ca727c52875abe219b2d9c4e4bb8 100644
--- a/ui/compositor/layer.h
+++ b/ui/compositor/layer.h
@@ -283,14 +283,13 @@ class COMPOSITOR_EXPORT Layer
// 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 @@ class COMPOSITOR_EXPORT Layer
// 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 @@ class COMPOSITOR_EXPORT Layer
// 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 @@ class COMPOSITOR_EXPORT Layer
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 @@ class COMPOSITOR_EXPORT Layer
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 @@ class COMPOSITOR_EXPORT Layer
// 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 @@ class COMPOSITOR_EXPORT Layer
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_;
« no previous file with comments | « no previous file | ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698