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

Unified Diff: cc/layers/layer.cc

Issue 295193002: Get rid of graphics layer anchor points, and replace with transform origin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit. Created 6 years, 6 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 | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 91664fa09310c1390ad0abf63dfcb0a3c35c6220..a444ee12c655a43ce998f00fb685e262763ae08e 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -61,11 +61,9 @@ Layer::Layer()
force_render_surface_(false),
is_3d_sorted_(false),
transform_is_invertible_(true),
- anchor_point_(0.5f, 0.5f),
background_color_(0),
opacity_(1.f),
blend_mode_(SkXfermode::kSrcOver_Mode),
- anchor_point_z_(0.f),
scroll_parent_(NULL),
clip_parent_(NULL),
replica_layer_(NULL),
@@ -371,22 +369,6 @@ void Layer::RequestCopyOfOutput(
SetNeedsCommit();
}
-void Layer::SetAnchorPoint(const gfx::PointF& anchor_point) {
- DCHECK(IsPropertyChangeAllowed());
- if (anchor_point_ == anchor_point)
- return;
- anchor_point_ = anchor_point;
- SetNeedsCommit();
-}
-
-void Layer::SetAnchorPointZ(float anchor_point_z) {
- DCHECK(IsPropertyChangeAllowed());
- if (anchor_point_z_ == anchor_point_z)
- return;
- anchor_point_z_ = anchor_point_z;
- SetNeedsCommit();
-}
-
void Layer::SetBackgroundColor(SkColor background_color) {
DCHECK(IsPropertyChangeAllowed());
if (background_color_ == background_color)
@@ -598,6 +580,14 @@ void Layer::SetTransform(const gfx::Transform& transform) {
SetNeedsCommit();
}
+void Layer::SetTransformOrigin(const gfx::Point3F& transform_origin) {
+ DCHECK(IsPropertyChangeAllowed());
+ if (transform_origin_ == transform_origin)
+ return;
+ transform_origin_ = transform_origin;
+ SetNeedsCommit();
+}
+
bool Layer::TransformIsAnimating() const {
return layer_animation_controller_->IsAnimatingProperty(Animation::Transform);
}
@@ -866,8 +856,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
bool use_paint_properties = paint_properties_.source_frame_number ==
layer_tree_host_->source_frame_number();
- layer->SetAnchorPoint(anchor_point_);
- layer->SetAnchorPointZ(anchor_point_z_);
+ layer->SetTransformOrigin(transform_origin_);
layer->SetBackgroundColor(background_color_);
layer->SetBounds(use_paint_properties ? paint_properties_.bounds
: bounds_);
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698