summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchrishtr@chromium.org <chrishtr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-05 03:14:20 +0000
committerchrishtr@chromium.org <chrishtr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-05 03:14:20 +0000
commita25664116cf216f0946ea3f60837ec207effa291 (patch)
treea8cbc599562d72cfea33b4de13d95233d30fb4ed
parentdc8b94b23ca7993b4004cc82f66cadf37775c3c2 (diff)
downloadchromium_src-a25664116cf216f0946ea3f60837ec207effa291.zip
chromium_src-a25664116cf216f0946ea3f60837ec207effa291.tar.gz
chromium_src-a25664116cf216f0946ea3f60837ec207effa291.tar.bz2
Get rid of graphics layer anchor points, and replace with
transform origin. This is the cc side change that listens to transform origin instead of anchor point. Blink is already populating both fields. BUG=372837 Review URL: https://codereview.chromium.org/295193002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274990 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--android_webview/browser/hardware_renderer.cc1
-rw-r--r--cc/base/math_util.cc8
-rw-r--r--cc/base/math_util.h1
-rw-r--r--cc/layers/delegated_renderer_layer_impl_unittest.cc3
-rw-r--r--cc/layers/io_surface_layer_impl_unittest.cc1
-rw-r--r--cc/layers/layer.cc29
-rw-r--r--cc/layers/layer.h13
-rw-r--r--cc/layers/layer_impl.cc22
-rw-r--r--cc/layers/layer_impl.h11
-rw-r--r--cc/layers/layer_impl_unittest.cc12
-rw-r--r--cc/layers/layer_iterator_unittest.cc1
-rw-r--r--cc/layers/layer_perftest.cc6
-rw-r--r--cc/layers/layer_position_constraint_unittest.cc16
-rw-r--r--cc/layers/layer_unittest.cc5
-rw-r--r--cc/layers/layer_utils.cc27
-rw-r--r--cc/layers/layer_utils_unittest.cc9
-rw-r--r--cc/layers/nine_patch_layer_impl_unittest.cc1
-rw-r--r--cc/layers/painted_scrollbar_layer_impl_unittest.cc1
-rw-r--r--cc/layers/picture_layer_impl_unittest.cc1
-rw-r--r--cc/layers/render_surface_impl_unittest.cc1
-rw-r--r--cc/layers/solid_color_layer_impl_unittest.cc1
-rw-r--r--cc/layers/solid_color_scrollbar_layer_impl_unittest.cc1
-rw-r--r--cc/layers/surface_layer_impl_unittest.cc1
-rw-r--r--cc/layers/texture_layer_impl_unittest.cc1
-rw-r--r--cc/layers/texture_layer_unittest.cc13
-rw-r--r--cc/layers/tiled_layer_impl_unittest.cc1
-rw-r--r--cc/layers/tiled_layer_unittest.cc5
-rw-r--r--cc/layers/ui_resource_layer_impl_unittest.cc1
-rw-r--r--cc/layers/video_layer_impl_unittest.cc1
-rw-r--r--cc/test/fake_content_layer.cc1
-rw-r--r--cc/test/fake_painted_scrollbar_layer.cc1
-rw-r--r--cc/test/fake_picture_layer.cc1
-rw-r--r--cc/test/layer_tree_host_common_test.cc8
-rw-r--r--cc/test/layer_tree_host_common_test.h22
-rw-r--r--cc/test/layer_tree_json_parser.cc1
-rw-r--r--cc/test/layer_tree_pixel_test.cc3
-rw-r--r--cc/test/layer_tree_test.cc1
-rw-r--r--cc/trees/damage_tracker_unittest.cc41
-rw-r--r--cc/trees/layer_tree_host_common.cc32
-rw-r--r--cc/trees/layer_tree_host_common_unittest.cc687
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc59
-rw-r--r--cc/trees/layer_tree_host_pixeltest_masks.cc11
-rw-r--r--cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc1
-rw-r--r--cc/trees/layer_tree_host_pixeltest_readback.cc12
-rw-r--r--cc/trees/layer_tree_host_unittest.cc17
-rw-r--r--cc/trees/layer_tree_host_unittest_context.cc15
-rw-r--r--cc/trees/layer_tree_host_unittest_delegated.cc2
-rw-r--r--cc/trees/layer_tree_host_unittest_occlusion.cc2
-rw-r--r--cc/trees/layer_tree_host_unittest_scroll.cc3
-rw-r--r--cc/trees/layer_tree_host_unittest_video.cc2
-rw-r--r--cc/trees/layer_tree_impl_unittest.cc268
-rw-r--r--cc/trees/occlusion_tracker_unittest.cc1
-rw-r--r--ui/compositor/compositor.cc1
-rw-r--r--ui/compositor/layer.cc4
-rw-r--r--ui/compositor/layer_unittest.cc6
-rw-r--r--webkit/renderer/compositor_bindings/web_layer_impl.cc35
-rw-r--r--webkit/renderer/compositor_bindings/web_layer_impl.h13
-rw-r--r--webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.cc13
-rw-r--r--webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.h3
59 files changed, 703 insertions, 757 deletions
diff --git a/android_webview/browser/hardware_renderer.cc b/android_webview/browser/hardware_renderer.cc
index d1d2253..1669d7f 100644
--- a/android_webview/browser/hardware_renderer.cc
+++ b/android_webview/browser/hardware_renderer.cc
@@ -171,7 +171,6 @@ bool HardwareRenderer::DrawGL(bool stencil_enabled,
delegated_layer_ = cc::DelegatedRendererLayer::Create(frame_provider_);
delegated_layer_->SetBounds(gfx::Size(view_width_, view_height_));
delegated_layer_->SetIsDrawable(true);
- delegated_layer_->SetAnchorPoint(gfx::PointF(0.f, 0.f));
root_layer_->AddChild(delegated_layer_);
} else {
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index 641d649..a619b50 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -591,6 +591,14 @@ scoped_ptr<base::Value> MathUtil::AsValue(const gfx::PointF& pt) {
return res.PassAs<base::Value>();
}
+scoped_ptr<base::Value> MathUtil::AsValue(const gfx::Point3F& pt) {
+ scoped_ptr<base::ListValue> res(new base::ListValue());
+ res->AppendDouble(pt.x());
+ res->AppendDouble(pt.y());
+ res->AppendDouble(pt.z());
+ return res.PassAs<base::Value>();
+}
+
scoped_ptr<base::Value> MathUtil::AsValue(const gfx::Vector2d& v) {
scoped_ptr<base::ListValue> res(new base::ListValue());
res->AppendInteger(v.x());
diff --git a/cc/base/math_util.h b/cc/base/math_util.h
index 6a13a38..3af2102 100644
--- a/cc/base/math_util.h
+++ b/cc/base/math_util.h
@@ -178,6 +178,7 @@ class CC_EXPORT MathUtil {
static scoped_ptr<base::Value> AsValue(const gfx::Rect& r);
static bool FromValue(const base::Value*, gfx::Rect* out_rect);
static scoped_ptr<base::Value> AsValue(const gfx::PointF& q);
+ static scoped_ptr<base::Value> AsValue(const gfx::Point3F&);
static scoped_ptr<base::Value> AsValue(const gfx::Vector2d& v);
static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q);
static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect);
diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc
index a2f1422..3f30d15 100644
--- a/cc/layers/delegated_renderer_layer_impl_unittest.cc
+++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc
@@ -511,6 +511,8 @@ class DelegatedRendererLayerImplTestTransform
transform.Scale(2.0, 2.0);
transform.Translate(8.0, 8.0);
delegated_renderer_layer->SetTransform(transform);
+ delegated_renderer_layer->SetTransformOrigin(
+ gfx::Point3F(75 * 0.5f, 75 * 0.5f, 0.0f));
ScopedPtrVector<RenderPass> delegated_render_passes;
@@ -1386,7 +1388,6 @@ TEST_F(DelegatedRendererLayerImplTest, Occlusion) {
FakeDelegatedRendererLayerImpl* delegated_renderer_layer_impl =
impl.AddChildToRoot<FakeDelegatedRendererLayerImpl>();
- delegated_renderer_layer_impl->SetAnchorPoint(gfx::PointF());
delegated_renderer_layer_impl->SetBounds(layer_size);
delegated_renderer_layer_impl->SetContentBounds(layer_size);
delegated_renderer_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/io_surface_layer_impl_unittest.cc b/cc/layers/io_surface_layer_impl_unittest.cc
index 9a09bbd..e5ee789 100644
--- a/cc/layers/io_surface_layer_impl_unittest.cc
+++ b/cc/layers/io_surface_layer_impl_unittest.cc
@@ -18,7 +18,6 @@ TEST(IOSurfaceLayerImplTest, Occlusion) {
IOSurfaceLayerImpl* io_surface_layer_impl =
impl.AddChildToRoot<IOSurfaceLayerImpl>();
- io_surface_layer_impl->SetAnchorPoint(gfx::PointF());
io_surface_layer_impl->SetBounds(layer_size);
io_surface_layer_impl->SetContentBounds(layer_size);
io_surface_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 91664fa..a444ee1 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_);
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 7e7d2861..9e94b53 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -29,6 +29,7 @@
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkXfermode.h"
+#include "ui/gfx/point3_f.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/rect_f.h"
#include "ui/gfx/transform.h"
@@ -103,12 +104,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
return !copy_requests_.empty();
}
- void SetAnchorPoint(const gfx::PointF& anchor_point);
- gfx::PointF anchor_point() const { return anchor_point_; }
-
- void SetAnchorPointZ(float anchor_point_z);
- float anchor_point_z() const { return anchor_point_z_; }
-
virtual void SetBackgroundColor(SkColor background_color);
SkColor background_color() const { return background_color_; }
// If contents_opaque(), return an opaque color else return a
@@ -182,6 +177,9 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
bool TransformIsAnimating() const;
bool transform_is_invertible() const { return transform_is_invertible_; }
+ void SetTransformOrigin(const gfx::Point3F&);
+ gfx::Point3F transform_origin() { return transform_origin_; }
+
void SetScrollParent(Layer* parent);
Layer* scroll_parent() { return scroll_parent_; }
@@ -595,13 +593,11 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
Region non_fast_scrollable_region_;
Region touch_event_handler_region_;
gfx::PointF position_;
- gfx::PointF anchor_point_;
SkColor background_color_;
float opacity_;
SkXfermode::Mode blend_mode_;
FilterOperations filters_;
FilterOperations background_filters_;
- float anchor_point_z_;
LayerPositionConstraint position_constraint_;
Layer* scroll_parent_;
scoped_ptr<std::set<Layer*> > scroll_children_;
@@ -610,6 +606,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
scoped_ptr<std::set<Layer*> > clip_children_;
gfx::Transform transform_;
+ gfx::Point3F transform_origin_;
// Replica layer used for reflections.
scoped_refptr<Layer> replica_layer_;
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 708271a..05bbd42 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -40,8 +40,6 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
replica_layer_id_(-1),
layer_id_(id),
layer_tree_impl_(tree_impl),
- anchor_point_(0.5f, 0.5f),
- anchor_point_z_(0.f),
scroll_offset_delegate_(NULL),
scroll_clip_layer_(NULL),
should_scroll_on_main_thread_(false),
@@ -490,8 +488,7 @@ scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) {
}
void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
- layer->SetAnchorPoint(anchor_point_);
- layer->SetAnchorPointZ(anchor_point_z_);
+ layer->SetTransformOrigin(transform_origin_);
layer->SetBackgroundColor(background_color_);
layer->SetBounds(bounds_);
layer->SetContentBounds(content_bounds());
@@ -853,19 +850,10 @@ void LayerImpl::SetHideLayerAndSubtree(bool hide) {
NoteLayerPropertyChangedForSubtree();
}
-void LayerImpl::SetAnchorPoint(const gfx::PointF& anchor_point) {
- if (anchor_point_ == anchor_point)
+void LayerImpl::SetTransformOrigin(const gfx::Point3F& transform_origin) {
+ if (transform_origin_ == transform_origin)
return;
-
- anchor_point_ = anchor_point;
- NoteLayerPropertyChangedForSubtree();
-}
-
-void LayerImpl::SetAnchorPointZ(float anchor_point_z) {
- if (anchor_point_z_ == anchor_point_z)
- return;
-
- anchor_point_z_ = anchor_point_z;
+ transform_origin_ = transform_origin;
NoteLayerPropertyChangedForSubtree();
}
@@ -1427,6 +1415,8 @@ void LayerImpl::AsValueInto(base::DictionaryValue* state) const {
state->SetInteger("draws_content", DrawsContent());
state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes());
state->Set("scroll_offset", MathUtil::AsValue(scroll_offset_).release());
+ state->Set("transform_origin",
+ MathUtil::AsValue(transform_origin_).release());
bool clipped;
gfx::QuadF layer_quad = MathUtil::MapQuad(
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index c97ae12..2ce6eac 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -30,6 +30,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkPicture.h"
+#include "ui/gfx/point3_f.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/rect_f.h"
#include "ui/gfx/transform.h"
@@ -202,11 +203,8 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
bool force_render_surface() const { return force_render_surface_; }
void SetForceRenderSurface(bool force) { force_render_surface_ = force; }
- void SetAnchorPoint(const gfx::PointF& anchor_point);
- gfx::PointF anchor_point() const { return anchor_point_; }
-
- void SetAnchorPointZ(float anchor_point_z);
- float anchor_point_z() const { return anchor_point_z_; }
+ void SetTransformOrigin(const gfx::Point3F& transform_origin);
+ gfx::Point3F transform_origin() const { return transform_origin_; }
void SetBackgroundColor(SkColor background_color);
SkColor background_color() const { return background_color_; }
@@ -597,8 +595,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
LayerTreeImpl* layer_tree_impl_;
// Properties synchronized from the associated Layer.
- gfx::PointF anchor_point_;
- float anchor_point_z_;
+ gfx::Point3F transform_origin_;
gfx::Size bounds_;
gfx::SizeF temporary_impl_bounds_;
gfx::Vector2d scroll_offset_;
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index 54e6ede..51939e4 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -121,6 +121,7 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) {
EXPECT_FALSE(grand_child->LayerPropertyChanged());
gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f);
+ gfx::Point3F arbitrary_point_3f = gfx::Point3F(0.125f, 0.25f, 0.f);
float arbitrary_number = 0.352f;
gfx::Size arbitrary_size = gfx::Size(111, 222);
gfx::Point arbitrary_point = gfx::Point(333, 444);
@@ -142,8 +143,8 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) {
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetBounds(arbitrary_size));
// Changing these properties affects the entire subtree of layers.
- EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetAnchorPoint(arbitrary_point_f));
- EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetAnchorPointZ(arbitrary_number));
+ EXECUTE_AND_VERIFY_SUBTREE_CHANGED(
+ root->SetTransformOrigin(arbitrary_point_3f));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetFilters(arbitrary_filters));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetFilters(FilterOperations()));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(
@@ -202,9 +203,7 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) {
// After setting all these properties already, setting to the exact same
// values again should not cause any change.
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(
- root->SetAnchorPoint(arbitrary_point_f));
- EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(
- root->SetAnchorPointZ(arbitrary_number));
+ root->SetTransformOrigin(arbitrary_point_3f));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetMasksToBounds(true));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(
root->SetPosition(arbitrary_point_f));
@@ -296,7 +295,6 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
layer->SetScrollOffset(arbitrary_vector2d));
// Unrelated functions, always set to new values, always set needs update.
- VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetAnchorPointZ(arbitrary_number));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
layer->SetMaskLayer(LayerImpl::Create(host_impl.active_tree(), 4)));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true));
@@ -325,8 +323,6 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
// Unrelated functions, set to the same values, no needs update.
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(
- layer->SetAnchorPointZ(arbitrary_number));
- VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(
layer->SetIsRootForIsolatedGroup(true));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true));
diff --git a/cc/layers/layer_iterator_unittest.cc b/cc/layers/layer_iterator_unittest.cc
index 89e504a..a7f85b7 100644
--- a/cc/layers/layer_iterator_unittest.cc
+++ b/cc/layers/layer_iterator_unittest.cc
@@ -38,7 +38,6 @@ class TestLayer : public Layer {
TestLayer() : Layer(), draws_content_(true) {
SetBounds(gfx::Size(100, 100));
SetPosition(gfx::Point());
- SetAnchorPoint(gfx::Point());
}
virtual ~TestLayer() {}
diff --git a/cc/layers/layer_perftest.cc b/cc/layers/layer_perftest.cc
index a36f1f0..1c4519a 100644
--- a/cc/layers/layer_perftest.cc
+++ b/cc/layers/layer_perftest.cc
@@ -65,7 +65,7 @@ TEST_F(LayerPerfTest, PushPropertiesTo) {
layer_tree_host_->SetRootLayer(test_layer);
- float anchor_point_z = 0;
+ float transform_origin_z = 0;
bool scrollable = true;
bool contents_opaque = true;
bool double_sided = true;
@@ -76,7 +76,7 @@ TEST_F(LayerPerfTest, PushPropertiesTo) {
timer_.Reset();
do {
test_layer->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f));
- test_layer->SetAnchorPointZ(anchor_point_z);
+ test_layer->SetTransformOrigin(gfx::Point3F(0.f, 0.f, transform_origin_z));
test_layer->SetContentsOpaque(contents_opaque);
test_layer->SetDoubleSided(double_sided);
test_layer->SetHideLayerAndSubtree(hide_layer_and_subtree);
@@ -85,7 +85,7 @@ TEST_F(LayerPerfTest, PushPropertiesTo) {
: Layer::INVALID_ID);
test_layer->PushPropertiesTo(impl_layer.get());
- anchor_point_z += 0.01f;
+ transform_origin_z += 0.01f;
scrollable = !scrollable;
contents_opaque = !contents_opaque;
double_sided = !double_sided;
diff --git a/cc/layers/layer_position_constraint_unittest.cc b/cc/layers/layer_position_constraint_unittest.cc
index cc112d1..269bc96 100644
--- a/cc/layers/layer_position_constraint_unittest.cc
+++ b/cc/layers/layer_position_constraint_unittest.cc
@@ -19,13 +19,13 @@ namespace {
void SetLayerPropertiesForTesting(LayerImpl* layer,
const gfx::Transform& transform,
- const gfx::PointF& anchor,
+ const gfx::Point3F& transform_origin,
const gfx::PointF& position,
const gfx::Size& bounds,
bool flatten_transform,
bool is_3d_sorted) {
layer->SetTransform(transform);
- layer->SetAnchorPoint(anchor);
+ layer->SetTransformOrigin(transform_origin);
layer->SetPosition(position);
layer->SetBounds(bounds);
layer->SetShouldFlattenTransform(flatten_transform);
@@ -87,34 +87,34 @@ class LayerPositionConstraintTest : public testing::Test {
LayerImpl::Create(host_impl_.active_tree(), 4);
gfx::Transform IdentityMatrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(200, 200);
gfx::Size clip_bounds(100, 100);
SetLayerPropertiesForTesting(scroll_layer.get(),
IdentityMatrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
false);
SetLayerPropertiesForTesting(child.get(),
IdentityMatrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
IdentityMatrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
false);
SetLayerPropertiesForTesting(great_grand_child.get(),
IdentityMatrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -741,7 +741,7 @@ TEST_F(LayerPositionConstraintTest,
LayerImpl::Create(host_impl_.active_tree(), 5);
SetLayerPropertiesForTesting(fixed_position_child.get(),
identity,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index e914857..ba77513 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -541,9 +541,8 @@ TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) {
// Next, test properties that should call SetNeedsCommit (but not
// SetNeedsDisplay). All properties need to be set to new values in order for
// SetNeedsCommit to be called.
- EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetAnchorPoint(
- gfx::PointF(1.23f, 4.56f)));
- EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetAnchorPointZ(0.7f));
+ EXPECT_SET_NEEDS_COMMIT(
+ 1, test_layer->SetTransformOrigin(gfx::Point3F(1.23f, 4.56f, 0.f)));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetBackgroundColor(SK_ColorLTGRAY));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetMasksToBounds(true));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetOpacity(0.5f));
diff --git a/cc/layers/layer_utils.cc b/cc/layers/layer_utils.cc
index 4c66d14..9c299c2 100644
--- a/cc/layers/layer_utils.cc
+++ b/cc/layers/layer_utils.cc
@@ -75,8 +75,10 @@ bool LayerUtils::GetAnimationBounds(const LayerImpl& layer_in, gfx::BoxF* out) {
gfx::Transform coalesced_transform;
for (const LayerImpl* layer = &layer_in; layer; layer = layer->parent()) {
- int anchor_x = layer->anchor_point().x() * layer->bounds().width();
- int anchor_y = layer->anchor_point().y() * layer->bounds().height();
+ int transform_origin_x = layer->transform_origin().x();
+ int transform_origin_y = layer->transform_origin().y();
+ int transform_origin_z = layer->transform_origin().z();
+
gfx::PointF position = layer->position();
if (layer->parent() && !HasAnimationThatInflatesBounds(*layer)) {
// |composite_layer_transform| contains 1 - 4 mentioned above. We compute
@@ -85,12 +87,12 @@ bool LayerUtils::GetAnimationBounds(const LayerImpl& layer_in, gfx::BoxF* out) {
// to do it only once.
gfx::Transform composite_layer_transform;
- composite_layer_transform.Translate3d(anchor_x + position.x(),
- anchor_y + position.y(),
- layer->anchor_point_z());
+ composite_layer_transform.Translate3d(transform_origin_x + position.x(),
+ transform_origin_y + position.y(),
+ transform_origin_z);
composite_layer_transform.PreconcatTransform(layer->transform());
composite_layer_transform.Translate3d(
- -anchor_x, -anchor_y, -layer->anchor_point_z());
+ -transform_origin_x, -transform_origin_y, -transform_origin_z);
// Add this layer's contributions to the |coalesced_transform|.
coalesced_transform.ConcatTransform(composite_layer_transform);
@@ -103,9 +105,9 @@ bool LayerUtils::GetAnimationBounds(const LayerImpl& layer_in, gfx::BoxF* out) {
// We need to apply the inflation about the layer's anchor point. Rather
// than doing this via transforms, we'll just shift the box directly.
- box.set_origin(box.origin() + gfx::Vector3dF(-anchor_x,
- -anchor_y,
- -layer->anchor_point_z()));
+ box.set_origin(box.origin() + gfx::Vector3dF(-transform_origin_x,
+ -transform_origin_y,
+ -transform_origin_z));
// Perform the inflation
if (HasFilterAnimationThatInflatesBounds(*layer)) {
@@ -125,9 +127,10 @@ bool LayerUtils::GetAnimationBounds(const LayerImpl& layer_in, gfx::BoxF* out) {
}
// Apply step 3) mentioned above.
- box.set_origin(box.origin() + gfx::Vector3dF(anchor_x + position.x(),
- anchor_y + position.y(),
- layer->anchor_point_z()));
+ box.set_origin(box.origin() +
+ gfx::Vector3dF(transform_origin_x + position.x(),
+ transform_origin_y + position.y(),
+ transform_origin_z));
}
// If we've got an unapplied coalesced transform at this point, it must still
diff --git a/cc/layers/layer_utils_unittest.cc b/cc/layers/layer_utils_unittest.cc
index 3a8d99c..bf4e9db 100644
--- a/cc/layers/layer_utils_unittest.cc
+++ b/cc/layers/layer_utils_unittest.cc
@@ -165,6 +165,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateXNoPerspective) {
child()->draw_properties().screen_space_transform_is_animating = true;
child()->SetPosition(gfx::PointF(150.f, 50.f));
child()->SetBounds(bounds);
+ child()->SetTransformOrigin(
+ gfx::Point3F(bounds.width() * 0.5f, bounds.height() * 0.5f, 0));
gfx::BoxF box;
bool success = LayerUtils::GetAnimationBounds(*child(), &box);
@@ -184,7 +186,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateXWithPerspective) {
// Make the anchor point not the default 0.5 value and line up with the
// child center to make the math easier.
- parent()->SetAnchorPoint(gfx::PointF(0.375f, 0.375f));
+ parent()->SetTransformOrigin(
+ gfx::Point3F(0.375f * 400.f, 0.375f * 400.f, 0.f));
parent()->SetBounds(gfx::Size(400, 400));
gfx::Transform perspective;
@@ -196,6 +199,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateXWithPerspective) {
child()->draw_properties().screen_space_transform_is_animating = true;
child()->SetPosition(gfx::PointF(100.f, 100.f));
child()->SetBounds(bounds);
+ child()->SetTransformOrigin(
+ gfx::Point3F(bounds.width() * 0.5f, bounds.height() * 0.5f, 0));
gfx::BoxF box;
bool success = LayerUtils::GetAnimationBounds(*child(), &box);
@@ -220,6 +225,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateZ) {
child()->draw_properties().screen_space_transform_is_animating = true;
child()->SetPosition(gfx::PointF(150.f, 50.f));
child()->SetBounds(bounds);
+ child()->SetTransformOrigin(
+ gfx::Point3F(bounds.width() * 0.5f, bounds.height() * 0.5f, 0));
gfx::BoxF box;
bool success = LayerUtils::GetAnimationBounds(*child(), &box);
diff --git a/cc/layers/nine_patch_layer_impl_unittest.cc b/cc/layers/nine_patch_layer_impl_unittest.cc
index 28d1775..f2a0dfc 100644
--- a/cc/layers/nine_patch_layer_impl_unittest.cc
+++ b/cc/layers/nine_patch_layer_impl_unittest.cc
@@ -228,7 +228,6 @@ TEST(NinePatchLayerImplTest, Occlusion) {
NinePatchLayerImpl* nine_patch_layer_impl =
impl.AddChildToRoot<NinePatchLayerImpl>();
- nine_patch_layer_impl->SetAnchorPoint(gfx::PointF());
nine_patch_layer_impl->SetBounds(layer_size);
nine_patch_layer_impl->SetContentBounds(layer_size);
nine_patch_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/painted_scrollbar_layer_impl_unittest.cc b/cc/layers/painted_scrollbar_layer_impl_unittest.cc
index f6d3ded..c45af03 100644
--- a/cc/layers/painted_scrollbar_layer_impl_unittest.cc
+++ b/cc/layers/painted_scrollbar_layer_impl_unittest.cc
@@ -34,7 +34,6 @@ TEST(PaintedScrollbarLayerImplTest, Occlusion) {
PaintedScrollbarLayerImpl* scrollbar_layer_impl =
impl.AddChildToRoot<PaintedScrollbarLayerImpl>(orientation);
- scrollbar_layer_impl->SetAnchorPoint(gfx::PointF());
scrollbar_layer_impl->SetBounds(layer_size);
scrollbar_layer_impl->SetContentBounds(layer_size);
scrollbar_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index c06833f..d380cfec 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -132,7 +132,6 @@ class PictureLayerImplTest : public testing::Test {
scoped_ptr<FakePictureLayerImpl> pending_layer =
FakePictureLayerImpl::CreateWithPile(pending_tree, id_, pile);
pending_layer->SetDrawsContent(true);
- pending_layer->SetAnchorPoint(gfx::PointF());
pending_tree->SetRootLayer(pending_layer.PassAs<LayerImpl>());
pending_layer_ = static_cast<FakePictureLayerImpl*>(
diff --git a/cc/layers/render_surface_impl_unittest.cc b/cc/layers/render_surface_impl_unittest.cc
index 20c2afb..7733240 100644
--- a/cc/layers/render_surface_impl_unittest.cc
+++ b/cc/layers/render_surface_impl_unittest.cc
@@ -17,7 +17,6 @@ TEST(RenderSurfaceLayerImplTest, Occlusion) {
LayerTestCommon::LayerImplTest impl;
LayerImpl* owning_layer_impl = impl.AddChildToRoot<LayerImpl>();
- owning_layer_impl->SetAnchorPoint(gfx::PointF());
owning_layer_impl->SetBounds(layer_size);
owning_layer_impl->SetContentBounds(layer_size);
owning_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/solid_color_layer_impl_unittest.cc b/cc/layers/solid_color_layer_impl_unittest.cc
index 8e4ebc9..6caa70ca 100644
--- a/cc/layers/solid_color_layer_impl_unittest.cc
+++ b/cc/layers/solid_color_layer_impl_unittest.cc
@@ -178,7 +178,6 @@ TEST(SolidColorLayerImplTest, Occlusion) {
SolidColorLayerImpl* solid_color_layer_impl =
impl.AddChildToRoot<SolidColorLayerImpl>();
solid_color_layer_impl->SetBackgroundColor(SkColorSetARGB(255, 10, 20, 30));
- solid_color_layer_impl->SetAnchorPoint(gfx::PointF());
solid_color_layer_impl->SetBounds(layer_size);
solid_color_layer_impl->SetContentBounds(layer_size);
solid_color_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/solid_color_scrollbar_layer_impl_unittest.cc b/cc/layers/solid_color_scrollbar_layer_impl_unittest.cc
index 480cd64..5f42636 100644
--- a/cc/layers/solid_color_scrollbar_layer_impl_unittest.cc
+++ b/cc/layers/solid_color_scrollbar_layer_impl_unittest.cc
@@ -29,7 +29,6 @@ TEST(SolidColorScrollbarLayerImplTest, Occlusion) {
track_start,
is_left_side_vertical_scrollbar,
is_overlay);
- scrollbar_layer_impl->SetAnchorPoint(gfx::PointF());
scrollbar_layer_impl->SetBounds(layer_size);
scrollbar_layer_impl->SetContentBounds(layer_size);
scrollbar_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/surface_layer_impl_unittest.cc b/cc/layers/surface_layer_impl_unittest.cc
index 86e3e49c..aeee4b6 100644
--- a/cc/layers/surface_layer_impl_unittest.cc
+++ b/cc/layers/surface_layer_impl_unittest.cc
@@ -18,7 +18,6 @@ TEST(SurfaceLayerImplTest, Occlusion) {
SurfaceLayerImpl* surface_layer_impl =
impl.AddChildToRoot<SurfaceLayerImpl>();
- surface_layer_impl->SetAnchorPoint(gfx::PointF());
surface_layer_impl->SetBounds(layer_size);
surface_layer_impl->SetContentBounds(layer_size);
surface_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/texture_layer_impl_unittest.cc b/cc/layers/texture_layer_impl_unittest.cc
index dc0bf22..cd7cf75 100644
--- a/cc/layers/texture_layer_impl_unittest.cc
+++ b/cc/layers/texture_layer_impl_unittest.cc
@@ -27,7 +27,6 @@ TEST(TextureLayerImplTest, Occlusion) {
TextureLayerImpl* texture_layer_impl =
impl.AddChildToRoot<TextureLayerImpl>();
- texture_layer_impl->SetAnchorPoint(gfx::PointF());
texture_layer_impl->SetBounds(layer_size);
texture_layer_impl->SetContentBounds(layer_size);
texture_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index c4019c1..0a52968 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -694,12 +694,10 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest {
gfx::Size bounds(100, 100);
root_ = Layer::Create();
- root_->SetAnchorPoint(gfx::PointF());
root_->SetBounds(bounds);
layer_ = TextureLayer::CreateForMailbox(NULL);
layer_->SetIsDrawable(true);
- layer_->SetAnchorPoint(gfx::PointF());
layer_->SetBounds(bounds);
root_->AddChild(layer_);
@@ -819,12 +817,10 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest {
virtual void BeginTest() OVERRIDE {
gfx::Size bounds(100, 100);
root_ = Layer::Create();
- root_->SetAnchorPoint(gfx::PointF());
root_->SetBounds(bounds);
layer_ = TextureLayer::CreateForMailbox(NULL);
layer_->SetIsDrawable(true);
- layer_->SetAnchorPoint(gfx::PointF());
layer_->SetBounds(bounds);
root_->AddChild(layer_);
@@ -1129,12 +1125,10 @@ class TextureLayerNoExtraCommitForMailboxTest
virtual void SetupTree() OVERRIDE {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
- root->SetAnchorPoint(gfx::PointF());
root->SetIsDrawable(true);
texture_layer_ = TextureLayer::CreateForMailbox(this);
texture_layer_->SetBounds(gfx::Size(10, 10));
- texture_layer_->SetAnchorPoint(gfx::PointF());
texture_layer_->SetIsDrawable(true);
root->AddChild(texture_layer_);
@@ -1229,7 +1223,6 @@ class TextureLayerChangeInvisibleMailboxTest
virtual void SetupTree() OVERRIDE {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
- root->SetAnchorPoint(gfx::PointF());
root->SetIsDrawable(true);
solid_layer_ = SolidColorLayer::Create();
@@ -1245,7 +1238,6 @@ class TextureLayerChangeInvisibleMailboxTest
texture_layer_ = TextureLayer::CreateForMailbox(this);
texture_layer_->SetBounds(gfx::Size(10, 10));
- texture_layer_->SetAnchorPoint(gfx::PointF());
texture_layer_->SetIsDrawable(true);
parent_layer_->AddChild(texture_layer_);
@@ -1364,7 +1356,6 @@ class TextureLayerReleaseResourcesBase
scoped_refptr<TextureLayer> texture_layer =
TextureLayer::CreateForMailbox(this);
texture_layer->SetBounds(gfx::Size(10, 10));
- texture_layer->SetAnchorPoint(gfx::PointF());
texture_layer->SetIsDrawable(true);
layer_tree_host()->root_layer()->AddChild(texture_layer);
@@ -1435,12 +1426,10 @@ class TextureLayerWithMailboxMainThreadDeleted : public LayerTreeTest {
virtual void SetupTree() OVERRIDE {
gfx::Size bounds(100, 100);
root_ = Layer::Create();
- root_->SetAnchorPoint(gfx::PointF());
root_->SetBounds(bounds);
layer_ = TextureLayer::CreateForMailbox(NULL);
layer_->SetIsDrawable(true);
- layer_->SetAnchorPoint(gfx::PointF());
layer_->SetBounds(bounds);
root_->AddChild(layer_);
@@ -1508,12 +1497,10 @@ class TextureLayerWithMailboxImplThreadDeleted : public LayerTreeTest {
virtual void SetupTree() OVERRIDE {
gfx::Size bounds(100, 100);
root_ = Layer::Create();
- root_->SetAnchorPoint(gfx::PointF());
root_->SetBounds(bounds);
layer_ = TextureLayer::CreateForMailbox(NULL);
layer_->SetIsDrawable(true);
- layer_->SetAnchorPoint(gfx::PointF());
layer_->SetBounds(bounds);
root_->AddChild(layer_);
diff --git a/cc/layers/tiled_layer_impl_unittest.cc b/cc/layers/tiled_layer_impl_unittest.cc
index d00fd62..e470eff 100644
--- a/cc/layers/tiled_layer_impl_unittest.cc
+++ b/cc/layers/tiled_layer_impl_unittest.cc
@@ -317,7 +317,6 @@ TEST_F(TiledLayerImplTest, Occlusion) {
LayerTestCommon::LayerImplTest impl;
TiledLayerImpl* tiled_layer = impl.AddChildToRoot<TiledLayerImpl>();
- tiled_layer->SetAnchorPoint(gfx::PointF());
tiled_layer->SetBounds(layer_bounds);
tiled_layer->SetContentBounds(layer_bounds);
tiled_layer->SetDrawsContent(true);
diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc
index bc83743..bd15f2f 100644
--- a/cc/layers/tiled_layer_unittest.cc
+++ b/cc/layers/tiled_layer_unittest.cc
@@ -1385,7 +1385,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) {
// This makes sure the painting works when the content space is scaled to
// a different layer space.
layer_tree_host_->SetViewportSize(gfx::Size(600, 600));
- layer->SetAnchorPoint(gfx::PointF());
layer->SetBounds(gfx::Size(300, 300));
scale_layer->AddChild(layer);
CalcDrawProps(&render_surface_layer_list);
@@ -1554,25 +1553,21 @@ TEST_F(TiledLayerTest, DontAllocateContentsWhenTargetSurfaceCantBeAllocated) {
new FakeTiledLayer(layer_tree_host_->contents_texture_manager()));
root->SetBounds(root_rect.size());
- root->SetAnchorPoint(gfx::PointF());
root->draw_properties().drawable_content_rect = root_rect;
root->draw_properties().visible_content_rect = root_rect;
root->AddChild(surface);
surface->SetForceRenderSurface(true);
- surface->SetAnchorPoint(gfx::PointF());
surface->SetOpacity(0.5);
surface->AddChild(child);
surface->AddChild(child2);
child->SetBounds(child_rect.size());
- child->SetAnchorPoint(gfx::PointF());
child->SetPosition(child_rect.origin());
child->draw_properties().visible_content_rect = child_rect;
child->draw_properties().drawable_content_rect = root_rect;
child2->SetBounds(child2_rect.size());
- child2->SetAnchorPoint(gfx::PointF());
child2->SetPosition(child2_rect.origin());
child2->draw_properties().visible_content_rect = child2_rect;
child2->draw_properties().drawable_content_rect = root_rect;
diff --git a/cc/layers/ui_resource_layer_impl_unittest.cc b/cc/layers/ui_resource_layer_impl_unittest.cc
index e5eacc5..a46f1e4 100644
--- a/cc/layers/ui_resource_layer_impl_unittest.cc
+++ b/cc/layers/ui_resource_layer_impl_unittest.cc
@@ -159,7 +159,6 @@ TEST(UIResourceLayerImplTest, Occlusion) {
UIResourceLayerImpl* ui_resource_layer_impl =
impl.AddChildToRoot<UIResourceLayerImpl>();
- ui_resource_layer_impl->SetAnchorPoint(gfx::PointF());
ui_resource_layer_impl->SetBounds(layer_size);
ui_resource_layer_impl->SetContentBounds(layer_size);
ui_resource_layer_impl->SetDrawsContent(true);
diff --git a/cc/layers/video_layer_impl_unittest.cc b/cc/layers/video_layer_impl_unittest.cc
index 68a2b2e..7a17eef 100644
--- a/cc/layers/video_layer_impl_unittest.cc
+++ b/cc/layers/video_layer_impl_unittest.cc
@@ -34,7 +34,6 @@ TEST(VideoLayerImplTest, Occlusion) {
VideoLayerImpl* video_layer_impl =
impl.AddChildToRoot<VideoLayerImpl>(&provider);
- video_layer_impl->SetAnchorPoint(gfx::PointF());
video_layer_impl->SetBounds(layer_size);
video_layer_impl->SetContentBounds(layer_size);
video_layer_impl->SetDrawsContent(true);
diff --git a/cc/test/fake_content_layer.cc b/cc/test/fake_content_layer.cc
index ebeff11..5f144e9 100644
--- a/cc/test/fake_content_layer.cc
+++ b/cc/test/fake_content_layer.cc
@@ -24,7 +24,6 @@ FakeContentLayer::FakeContentLayer(ContentLayerClient* client)
push_properties_count_(0),
output_surface_created_count_(0),
always_update_resources_(false) {
- SetAnchorPoint(gfx::PointF(0.f, 0.f));
SetBounds(gfx::Size(1, 1));
SetIsDrawable(true);
}
diff --git a/cc/test/fake_painted_scrollbar_layer.cc b/cc/test/fake_painted_scrollbar_layer.cc
index b238d80..88dd010 100644
--- a/cc/test/fake_painted_scrollbar_layer.cc
+++ b/cc/test/fake_painted_scrollbar_layer.cc
@@ -28,7 +28,6 @@ FakePaintedScrollbarLayer::FakePaintedScrollbarLayer(
update_count_(0),
push_properties_count_(0),
fake_scrollbar_(fake_scrollbar) {
- SetAnchorPoint(gfx::PointF(0.f, 0.f));
SetBounds(gfx::Size(1, 1));
SetIsDrawable(true);
}
diff --git a/cc/test/fake_picture_layer.cc b/cc/test/fake_picture_layer.cc
index 98e658e..2a5d2e9 100644
--- a/cc/test/fake_picture_layer.cc
+++ b/cc/test/fake_picture_layer.cc
@@ -13,7 +13,6 @@ FakePictureLayer::FakePictureLayer(ContentLayerClient* client)
update_count_(0),
push_properties_count_(0),
always_update_resources_(false) {
- SetAnchorPoint(gfx::PointF(0.f, 0.f));
SetBounds(gfx::Size(1, 1));
SetIsDrawable(true);
}
diff --git a/cc/test/layer_tree_host_common_test.cc b/cc/test/layer_tree_host_common_test.cc
index 61dd401..3b6b14b 100644
--- a/cc/test/layer_tree_host_common_test.cc
+++ b/cc/test/layer_tree_host_common_test.cc
@@ -20,14 +20,14 @@ LayerTreeHostCommonTestBase::~LayerTreeHostCommonTestBase() {
void LayerTreeHostCommonTestBase::SetLayerPropertiesForTesting(
Layer* layer,
const gfx::Transform& transform,
- const gfx::PointF& anchor,
+ const gfx::Point3F& transform_origin,
const gfx::PointF& position,
const gfx::Size& bounds,
bool flatten_transform,
bool is_3d_sorted) {
SetLayerPropertiesForTestingInternal<Layer>(layer,
transform,
- anchor,
+ transform_origin,
position,
bounds,
flatten_transform,
@@ -37,14 +37,14 @@ void LayerTreeHostCommonTestBase::SetLayerPropertiesForTesting(
void LayerTreeHostCommonTestBase::SetLayerPropertiesForTesting(
LayerImpl* layer,
const gfx::Transform& transform,
- const gfx::PointF& anchor,
+ const gfx::Point3F& transform_origin,
const gfx::PointF& position,
const gfx::Size& bounds,
bool flatten_transform,
bool is_3d_sorted) {
SetLayerPropertiesForTestingInternal<LayerImpl>(layer,
transform,
- anchor,
+ transform_origin,
position,
bounds,
flatten_transform,
diff --git a/cc/test/layer_tree_host_common_test.h b/cc/test/layer_tree_host_common_test.h
index 896388e..38dd85a 100644
--- a/cc/test/layer_tree_host_common_test.h
+++ b/cc/test/layer_tree_host_common_test.h
@@ -13,6 +13,7 @@
namespace gfx {
class PointF;
+class Point3F;
class Size;
class Transform;
}
@@ -29,15 +30,16 @@ class LayerTreeHostCommonTestBase {
virtual ~LayerTreeHostCommonTestBase();
template <typename LayerType>
- void SetLayerPropertiesForTestingInternal(LayerType* layer,
- const gfx::Transform& transform,
- const gfx::PointF& anchor,
- const gfx::PointF& position,
- const gfx::Size& bounds,
- bool flatten_transform,
- bool is_3d_sorted) {
+ void SetLayerPropertiesForTestingInternal(
+ LayerType* layer,
+ const gfx::Transform& transform,
+ const gfx::Point3F& transform_origin,
+ const gfx::PointF& position,
+ const gfx::Size& bounds,
+ bool flatten_transform,
+ bool is_3d_sorted) {
layer->SetTransform(transform);
- layer->SetAnchorPoint(anchor);
+ layer->SetTransformOrigin(transform_origin);
layer->SetPosition(position);
layer->SetBounds(bounds);
layer->SetShouldFlattenTransform(flatten_transform);
@@ -46,7 +48,7 @@ class LayerTreeHostCommonTestBase {
void SetLayerPropertiesForTesting(Layer* layer,
const gfx::Transform& transform,
- const gfx::PointF& anchor,
+ const gfx::Point3F& transform_origin,
const gfx::PointF& position,
const gfx::Size& bounds,
bool flatten_transform,
@@ -54,7 +56,7 @@ class LayerTreeHostCommonTestBase {
void SetLayerPropertiesForTesting(LayerImpl* layer,
const gfx::Transform& transform,
- const gfx::PointF& anchor,
+ const gfx::Point3F& transform_origin,
const gfx::PointF& position,
const gfx::Size& bounds,
bool flatten_transform,
diff --git a/cc/test/layer_tree_json_parser.cc b/cc/test/layer_tree_json_parser.cc
index 6e3164c..c54335a 100644
--- a/cc/test/layer_tree_json_parser.cc
+++ b/cc/test/layer_tree_json_parser.cc
@@ -86,7 +86,6 @@ scoped_refptr<Layer> ParseTreeFromValue(base::Value* val,
} else { // Type "Layer" or "unknown"
new_layer = Layer::Create();
}
- new_layer->SetAnchorPoint(gfx::Point());
new_layer->SetPosition(gfx::PointF(position_x, position_y));
new_layer->SetBounds(gfx::Size(width, height));
new_layer->SetIsDrawable(draws_content);
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc
index 3237c1a..0e5f50b 100644
--- a/cc/test/layer_tree_pixel_test.cc
+++ b/cc/test/layer_tree_pixel_test.cc
@@ -105,7 +105,6 @@ void LayerTreePixelTest::AfterTest() {
CommandLine* cmd = CommandLine::ForCurrentProcess();
if (cmd->HasSwitch(switches::kCCRebaselinePixeltests))
EXPECT_TRUE(WritePNGFile(*result_bitmap_, ref_file_path, true));
-
EXPECT_TRUE(MatchesPNGFile(*result_bitmap_,
ref_file_path,
*pixel_comparator_));
@@ -115,7 +114,6 @@ scoped_refptr<SolidColorLayer> LayerTreePixelTest::CreateSolidColorLayer(
const gfx::Rect& rect, SkColor color) {
scoped_refptr<SolidColorLayer> layer = SolidColorLayer::Create();
layer->SetIsDrawable(true);
- layer->SetAnchorPoint(gfx::PointF());
layer->SetBounds(rect.size());
layer->SetPosition(rect.origin());
layer->SetBackgroundColor(color);
@@ -174,7 +172,6 @@ scoped_refptr<TextureLayer> LayerTreePixelTest::CreateTextureLayer(
const gfx::Rect& rect, const SkBitmap& bitmap) {
scoped_refptr<TextureLayer> layer = TextureLayer::CreateForMailbox(NULL);
layer->SetIsDrawable(true);
- layer->SetAnchorPoint(gfx::PointF());
layer->SetBounds(rect.size());
layer->SetPosition(rect.origin());
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 2aab75c..d21d43e 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -537,7 +537,6 @@ void LayerTreeTest::DoBeginTest() {
void LayerTreeTest::SetupTree() {
if (!layer_tree_host_->root_layer()) {
scoped_refptr<Layer> root_layer = Layer::Create();
- root_layer->SetAnchorPoint(gfx::PointF());
root_layer->SetBounds(gfx::Size(1, 1));
root_layer->SetIsDrawable(true);
layer_tree_host_->SetRootLayer(root_layer);
diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc
index d86b340..169eea4 100644
--- a/cc/trees/damage_tracker_unittest.cc
+++ b/cc/trees/damage_tracker_unittest.cc
@@ -23,15 +23,15 @@ namespace cc {
namespace {
void ExecuteCalculateDrawProperties(LayerImpl* root,
- LayerImplList& render_surface_layer_list) {
+ LayerImplList* render_surface_layer_list) {
// Sanity check: The test itself should create the root layer's render
// surface, so that the surface (and its damage tracker) can
// persist across multiple calls to this function.
ASSERT_TRUE(root->render_surface());
- ASSERT_FALSE(render_surface_layer_list.size());
+ ASSERT_FALSE(render_surface_layer_list->size());
LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
- root, root->bounds(), &render_surface_layer_list);
+ root, root->bounds(), render_surface_layer_list);
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
}
@@ -52,7 +52,7 @@ void EmulateDrawingOneFrame(LayerImpl* root) {
// and surfaces.
LayerImplList render_surface_layer_list;
- ExecuteCalculateDrawProperties(root, render_surface_layer_list);
+ ExecuteCalculateDrawProperties(root, &render_surface_layer_list);
// Iterate back-to-front, so that damage correctly propagates from descendant
// surfaces to ancestors.
@@ -82,7 +82,6 @@ class DamageTrackerTest : public testing::Test {
LayerImpl::Create(host_impl_.active_tree(), 2);
root->SetPosition(gfx::PointF());
- root->SetAnchorPoint(gfx::PointF());
root->SetBounds(gfx::Size(500, 500));
root->SetContentBounds(gfx::Size(500, 500));
root->SetDrawsContent(true);
@@ -90,7 +89,6 @@ class DamageTrackerTest : public testing::Test {
root->render_surface()->SetContentRect(gfx::Rect(0, 0, 500, 500));
child->SetPosition(gfx::PointF(100.f, 100.f));
- child->SetAnchorPoint(gfx::PointF());
child->SetBounds(gfx::Size(30, 30));
child->SetContentBounds(gfx::Size(30, 30));
child->SetDrawsContent(true);
@@ -116,7 +114,6 @@ class DamageTrackerTest : public testing::Test {
LayerImpl::Create(host_impl_.active_tree(), 5);
root->SetPosition(gfx::PointF());
- root->SetAnchorPoint(gfx::PointF());
root->SetBounds(gfx::Size(500, 500));
root->SetContentBounds(gfx::Size(500, 500));
root->SetDrawsContent(true);
@@ -124,7 +121,6 @@ class DamageTrackerTest : public testing::Test {
root->render_surface()->SetContentRect(gfx::Rect(0, 0, 500, 500));
child1->SetPosition(gfx::PointF(100.f, 100.f));
- child1->SetAnchorPoint(gfx::PointF());
child1->SetBounds(gfx::Size(30, 30));
child1->SetContentBounds(gfx::Size(30, 30));
// With a child that draws_content, opacity will cause the layer to create
@@ -136,19 +132,16 @@ class DamageTrackerTest : public testing::Test {
child1->SetForceRenderSurface(true);
child2->SetPosition(gfx::PointF(11.f, 11.f));
- child2->SetAnchorPoint(gfx::PointF());
child2->SetBounds(gfx::Size(18, 18));
child2->SetContentBounds(gfx::Size(18, 18));
child2->SetDrawsContent(true);
grand_child1->SetPosition(gfx::PointF(200.f, 200.f));
- grand_child1->SetAnchorPoint(gfx::PointF());
grand_child1->SetBounds(gfx::Size(6, 8));
grand_child1->SetContentBounds(gfx::Size(6, 8));
grand_child1->SetDrawsContent(true);
grand_child2->SetPosition(gfx::PointF(190.f, 190.f));
- grand_child2->SetAnchorPoint(gfx::PointF());
grand_child2->SetBounds(gfx::Size(6, 8));
grand_child2->SetContentBounds(gfx::Size(6, 8));
grand_child2->SetDrawsContent(true);
@@ -419,7 +412,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForTransformedLayer) {
rotation.Rotate(45.0);
ClearDamageForAllSurfaces(root.get());
- child->SetAnchorPoint(gfx::PointF(0.5f, 0.5f));
+ child->SetTransformOrigin(gfx::Point3F(
+ child->bounds().width() * 0.5f, child->bounds().height() * 0.5f, 0.f));
child->SetPosition(gfx::PointF(85.f, 85.f));
EmulateDrawingOneFrame(root.get());
@@ -709,7 +703,6 @@ TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingLayer) {
scoped_ptr<LayerImpl> child2 =
LayerImpl::Create(host_impl_.active_tree(), 3);
child2->SetPosition(gfx::PointF(400.f, 380.f));
- child2->SetAnchorPoint(gfx::PointF());
child2->SetBounds(gfx::Size(6, 8));
child2->SetContentBounds(gfx::Size(6, 8));
child2->SetDrawsContent(true);
@@ -759,7 +752,6 @@ TEST_F(DamageTrackerTest, VerifyDamageForNewUnchangedLayer) {
scoped_ptr<LayerImpl> child2 =
LayerImpl::Create(host_impl_.active_tree(), 3);
child2->SetPosition(gfx::PointF(400.f, 380.f));
- child2->SetAnchorPoint(gfx::PointF());
child2->SetBounds(gfx::Size(6, 8));
child2->SetContentBounds(gfx::Size(6, 8));
child2->SetDrawsContent(true);
@@ -793,7 +785,6 @@ TEST_F(DamageTrackerTest, VerifyDamageForMultipleLayers) {
scoped_ptr<LayerImpl> child2 =
LayerImpl::Create(host_impl_.active_tree(), 3);
child2->SetPosition(gfx::PointF(400.f, 380.f));
- child2->SetAnchorPoint(gfx::PointF());
child2->SetBounds(gfx::Size(6, 8));
child2->SetContentBounds(gfx::Size(6, 8));
child2->SetDrawsContent(true);
@@ -1045,7 +1036,6 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplica) {
scoped_ptr<LayerImpl> grand_child3 =
LayerImpl::Create(host_impl_.active_tree(), 6);
grand_child3->SetPosition(gfx::PointF(240.f, 240.f));
- grand_child3->SetAnchorPoint(gfx::PointF());
grand_child3->SetBounds(gfx::Size(10, 10));
grand_child3->SetContentBounds(gfx::Size(10, 10));
grand_child3->SetDrawsContent(true);
@@ -1061,7 +1051,6 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplica) {
scoped_ptr<LayerImpl> grand_child1_replica =
LayerImpl::Create(host_impl_.active_tree(), 7);
grand_child1_replica->SetPosition(gfx::PointF());
- grand_child1_replica->SetAnchorPoint(gfx::PointF());
gfx::Transform reflection;
reflection.Scale3d(-1.0, 1.0, 1.0);
grand_child1_replica->SetTransform(reflection);
@@ -1147,7 +1136,6 @@ TEST_F(DamageTrackerTest, VerifyDamageForMask) {
scoped_ptr<LayerImpl> mask_layer =
LayerImpl::Create(host_impl_.active_tree(), 3);
mask_layer->SetPosition(child->position());
- mask_layer->SetAnchorPoint(gfx::PointF());
mask_layer->SetBounds(child->bounds());
mask_layer->SetContentBounds(child->bounds());
child->SetMaskLayer(mask_layer.Pass());
@@ -1161,7 +1149,6 @@ TEST_F(DamageTrackerTest, VerifyDamageForMask) {
scoped_ptr<LayerImpl> grand_child =
LayerImpl::Create(host_impl_.active_tree(), 4);
grand_child->SetPosition(gfx::PointF(2.f, 2.f));
- grand_child->SetAnchorPoint(gfx::PointF());
grand_child->SetBounds(gfx::Size(2, 2));
grand_child->SetContentBounds(gfx::Size(2, 2));
grand_child->SetDrawsContent(true);
@@ -1241,7 +1228,6 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) {
scoped_ptr<LayerImpl> grand_child1_replica =
LayerImpl::Create(host_impl_.active_tree(), 6);
grand_child1_replica->SetPosition(gfx::PointF());
- grand_child1_replica->SetAnchorPoint(gfx::PointF());
gfx::Transform reflection;
reflection.Scale3d(-1.0, 1.0, 1.0);
grand_child1_replica->SetTransform(reflection);
@@ -1254,7 +1240,6 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) {
scoped_ptr<LayerImpl> replica_mask_layer =
LayerImpl::Create(host_impl_.active_tree(), 7);
replica_mask_layer->SetPosition(gfx::PointF());
- replica_mask_layer->SetAnchorPoint(gfx::PointF());
replica_mask_layer->SetBounds(grand_child1->bounds());
replica_mask_layer->SetContentBounds(grand_child1->bounds());
grand_child1_replica->SetMaskLayer(replica_mask_layer.Pass());
@@ -1297,7 +1282,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) {
EXPECT_EQ(gfx::Rect(194, 200, 6, 8).ToString(), child_damage_rect.ToString());
}
-TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithAnchor) {
+TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithTransformOrigin) {
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces();
LayerImpl* child1 = root->children()[0];
LayerImpl* grand_child1 = child1->children()[0];
@@ -1306,9 +1291,11 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithAnchor) {
// replica_mask.
ClearDamageForAllSurfaces(root.get());
- // This is not actually the anchor point being tested, but by convention its
+ // This is not actually the transform origin point being tested, but by
+ // convention its
// expected to be the same as the replica's anchor point.
- grand_child1->SetAnchorPoint(gfx::PointF(1.f, 0.f));
+ grand_child1->SetTransformOrigin(
+ gfx::Point3F(grand_child1->bounds().width(), 0.f, 0.f));
{
scoped_ptr<LayerImpl> grand_child1_replica =
@@ -1316,7 +1303,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithAnchor) {
grand_child1_replica->SetPosition(gfx::PointF());
// This is the anchor being tested.
- grand_child1_replica->SetAnchorPoint(gfx::PointF(1.f, 0.f));
+ grand_child1_replica->SetTransformOrigin(
+ gfx::Point3F(grand_child1->bounds().width(), 0.f, 0.f));
gfx::Transform reflection;
reflection.Scale3d(-1.0, 1.0, 1.0);
grand_child1_replica->SetTransform(reflection);
@@ -1329,8 +1317,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithAnchor) {
scoped_ptr<LayerImpl> replica_mask_layer =
LayerImpl::Create(host_impl_.active_tree(), 7);
replica_mask_layer->SetPosition(gfx::PointF());
- // Note: this is not the anchor being tested.
- replica_mask_layer->SetAnchorPoint(gfx::PointF());
+ // Note: this is not the transform origin being tested.
replica_mask_layer->SetBounds(grand_child1->bounds());
replica_mask_layer->SetContentBounds(grand_child1->bounds());
grand_child1_replica->SetMaskLayer(replica_mask_layer.Pass());
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 34f4553..2335f4e 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -1651,25 +1651,21 @@ static void CalculateDrawPropertiesInternal(
animating_transform_to_screen |=
layer->parent()->screen_space_transform_is_animating();
}
-
- gfx::Size bounds = layer->bounds();
- gfx::PointF anchor_point = layer->anchor_point();
+ gfx::Point3F transform_origin = layer->transform_origin();
gfx::Vector2dF scroll_offset = GetEffectiveTotalScrollOffset(layer);
gfx::PointF position = layer->position() - scroll_offset;
-
gfx::Transform combined_transform = data_from_ancestor.parent_matrix;
if (!layer->transform().IsIdentity()) {
- // LT = Tr[origin] * Tr[origin2anchor]
- combined_transform.Translate3d(
- position.x() + anchor_point.x() * bounds.width(),
- position.y() + anchor_point.y() * bounds.height(),
- layer->anchor_point_z());
- // LT = Tr[origin] * Tr[origin2anchor] * M[layer]
+ // LT = Tr[origin] * Tr[origin2transformOrigin]
+ combined_transform.Translate3d(position.x() + transform_origin.x(),
+ position.y() + transform_origin.y(),
+ transform_origin.z());
+ // LT = Tr[origin] * Tr[origin2origin] * M[layer]
combined_transform.PreconcatTransform(layer->transform());
- // LT = Tr[origin] * Tr[origin2anchor] * M[layer] * Tr[anchor2origin]
- combined_transform.Translate3d(-anchor_point.x() * bounds.width(),
- -anchor_point.y() * bounds.height(),
- -layer->anchor_point_z());
+ // LT = Tr[origin] * Tr[origin2origin] * M[layer] *
+ // Tr[transformOrigin2origin]
+ combined_transform.Translate3d(
+ -transform_origin.x(), -transform_origin.y(), -transform_origin.z());
} else {
combined_transform.Translate(position.x(), position.y());
}
@@ -2250,14 +2246,14 @@ static void CalculateDrawPropertiesInternal(
render_surface_sublayer_scale.x(), render_surface_sublayer_scale.y());
surface_origin_to_replica_origin_transform.Translate(
layer->replica_layer()->position().x() +
- layer->replica_layer()->anchor_point().x() * bounds.width(),
+ layer->replica_layer()->transform_origin().x(),
layer->replica_layer()->position().y() +
- layer->replica_layer()->anchor_point().y() * bounds.height());
+ layer->replica_layer()->transform_origin().y());
surface_origin_to_replica_origin_transform.PreconcatTransform(
layer->replica_layer()->transform());
surface_origin_to_replica_origin_transform.Translate(
- -layer->replica_layer()->anchor_point().x() * bounds.width(),
- -layer->replica_layer()->anchor_point().y() * bounds.height());
+ -layer->replica_layer()->transform_origin().x(),
+ -layer->replica_layer()->transform_origin().y());
surface_origin_to_replica_origin_transform.Scale(
1.0 / render_surface_sublayer_scale.x(),
1.0 / render_surface_sublayer_scale.y());
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 43d94da..1c85081 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -125,21 +125,21 @@ TEST_F(LayerTreeHostCommonTest, TransformsForNoOpLayer) {
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(),
true,
@@ -163,7 +163,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) {
scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
@@ -179,7 +179,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) {
translation_to_center.Translate(5.0, 6.0);
SetLayerPropertiesForTesting(layer.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 12),
true,
@@ -193,7 +193,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) {
// no effect on the transforms.
SetLayerPropertiesForTesting(layer.get(),
identity_matrix,
- gfx::PointF(0.25f, 0.25f),
+ gfx::Point3F(2.5f, 3.0f, 0.f),
gfx::PointF(),
gfx::Size(10, 12),
true,
@@ -209,7 +209,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) {
position_transform.Translate(0.f, 1.2f);
SetLayerPropertiesForTesting(layer.get(),
identity_matrix,
- gfx::PointF(0.25f, 0.25f),
+ gfx::Point3F(2.5f, 3.0f, 0.f),
gfx::PointF(0.f, 1.2f),
gfx::Size(10, 12),
true,
@@ -226,7 +226,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) {
layer_transform.Scale3d(2.0, 2.0, 1.0);
SetLayerPropertiesForTesting(layer.get(),
layer_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 12),
true,
@@ -243,7 +243,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) {
translation_to_anchor * layer_transform * Inverse(translation_to_anchor);
SetLayerPropertiesForTesting(layer.get(),
layer_transform,
- gfx::PointF(0.5f, 0.f),
+ gfx::Point3F(5.0f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 12),
true,
@@ -260,7 +260,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) {
layer_transform * Inverse(translation_to_anchor);
SetLayerPropertiesForTesting(layer.get(),
layer_transform,
- gfx::PointF(0.5f, 0.f),
+ gfx::Point3F(5.0f, 0.f, 0.f),
gfx::PointF(0.f, 1.2f),
gfx::Size(10, 12),
true,
@@ -292,7 +292,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsAboutScrollOffset) {
kPageScale * kDeviceScale);
SetLayerPropertiesForTesting(sublayer,
identity_matrix,
- gfx::Point(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(500, 500),
true,
@@ -303,7 +303,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsAboutScrollOffset) {
LayerImpl* scroll_layer = scroll_layer_scoped_ptr.get();
SetLayerPropertiesForTesting(scroll_layer,
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 20),
true,
@@ -327,7 +327,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsAboutScrollOffset) {
scoped_ptr<LayerImpl> root(LayerImpl::Create(host_impl.active_tree(), 3));
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(3, 4),
true,
@@ -352,7 +352,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsAboutScrollOffset) {
arbitrary_translate.Translate(kTranslateX, kTranslateY);
SetLayerPropertiesForTesting(scroll_layer,
arbitrary_translate,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 20),
true,
@@ -385,7 +385,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSimpleHierarchy) {
// One-time setup of root layer
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
@@ -394,21 +394,21 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSimpleHierarchy) {
// Case 1: parent's anchor point should not affect child or grand_child.
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(0.25f, 0.25f),
+ gfx::Point3F(2.5f, 3.0f, 0.f),
gfx::PointF(),
gfx::Size(10, 12),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(16, 18),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(76, 78),
true,
@@ -427,21 +427,21 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSimpleHierarchy) {
parent_position_transform.Translate(0.f, 1.2f);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(0.25f, 0.25f),
+ gfx::Point3F(2.5f, 3.0f, 0.f),
gfx::PointF(0.f, 1.2f),
gfx::Size(10, 12),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(16, 18),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(76, 78),
true,
@@ -466,21 +466,21 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSimpleHierarchy) {
Inverse(parent_translation_to_anchor);
SetLayerPropertiesForTesting(parent.get(),
parent_layer_transform,
- gfx::PointF(0.25f, 0.25f),
+ gfx::Point3F(2.5f, 3.0f, 0.f),
gfx::PointF(),
gfx::Size(10, 12),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(16, 18),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(76, 78),
true,
@@ -513,7 +513,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSingleRenderSurface) {
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
@@ -545,21 +545,21 @@ TEST_F(LayerTreeHostCommonTest, TransformsForSingleRenderSurface) {
SetLayerPropertiesForTesting(parent.get(),
parent_layer_transform,
- gfx::PointF(0.25f, 0.25f),
+ gfx::Point3F(25.0f, 30.0f, 0.f),
gfx::PointF(),
gfx::Size(100, 120),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(16, 18),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(8, 10),
true,
@@ -610,7 +610,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForReplica) {
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
@@ -643,28 +643,28 @@ TEST_F(LayerTreeHostCommonTest, TransformsForReplica) {
SetLayerPropertiesForTesting(parent.get(),
parent_layer_transform,
- gfx::PointF(0.25f, 0.25f),
+ gfx::Point3F(2.5f, 3.0f, 0.f),
gfx::PointF(),
gfx::Size(10, 12),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(16, 18),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(-0.5f, -0.5f),
gfx::Size(1, 1),
true,
false);
SetLayerPropertiesForTesting(child_replica.get(),
replica_layer_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(),
true,
@@ -736,7 +736,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForRenderSurfaceHierarchy) {
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
@@ -783,77 +783,77 @@ TEST_F(LayerTreeHostCommonTest, TransformsForRenderSurfaceHierarchy) {
SetLayerPropertiesForTesting(parent.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(render_surface2.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(child_of_root.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(child_of_rs1.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(child_of_rs2.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child_of_root.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child_of_rs1.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child_of_rs2.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(replica_of_rs1.get(),
replica_layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(),
true,
false);
SetLayerPropertiesForTesting(replica_of_rs2.get(),
replica_layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(2.5f, 0.f, 0.f),
gfx::PointF(),
gfx::Size(),
true,
@@ -995,21 +995,21 @@ TEST_F(LayerTreeHostCommonTest, TransformsForFlatteningLayer) {
const gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
rotation_about_y_axis,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
rotation_about_y_axis,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
@@ -1074,21 +1074,21 @@ TEST_F(LayerTreeHostCommonTest, TransformsForDegenerateIntermediateLayer) {
const gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 0),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
@@ -1128,14 +1128,14 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) {
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
@@ -1275,21 +1275,21 @@ TEST_F(LayerTreeHostCommonTest,
const gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(30.f, 30.f),
gfx::Size(10, 10),
true,
@@ -1329,14 +1329,14 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceListForTransparentChild) {
const gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(render_surface1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
@@ -1376,21 +1376,21 @@ TEST_F(LayerTreeHostCommonTest, ForceRenderSurface) {
const gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
@@ -1470,42 +1470,42 @@ TEST_F(LayerTreeHostCommonTest, ClipRectCullsRenderSurfaces) {
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(500, 500),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(45.f, 45.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(great_grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(leaf_node1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(500, 500),
true,
false);
SetLayerPropertiesForTesting(leaf_node2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
@@ -1562,28 +1562,28 @@ TEST_F(LayerTreeHostCommonTest, ClipRectCullsSurfaceWithoutVisibleContent) {
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(200.f, 200.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(leaf_node.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
@@ -1666,49 +1666,49 @@ TEST_F(LayerTreeHostCommonTest, IsClippedIsSetCorrectly) {
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(leaf_node1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(leaf_node2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -1822,42 +1822,42 @@ TEST_F(LayerTreeHostCommonTest, DrawableContentRectForLayers) {
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(500, 500),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
false);
SetLayerPropertiesForTesting(grand_child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(15.f, 15.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child3.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(15.f, 15.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child4.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(45.f, 45.f),
gfx::Size(10, 10),
true,
@@ -1930,70 +1930,70 @@ TEST_F(LayerTreeHostCommonTest, ClipRectIsPropagatedCorrectlyToSurfaces) {
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(500, 500),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
false);
SetLayerPropertiesForTesting(grand_child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(15.f, 15.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child3.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(15.f, 15.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child4.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(45.f, 45.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(leaf_node1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(leaf_node2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(leaf_node3.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(leaf_node4.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
@@ -2067,63 +2067,63 @@ TEST_F(LayerTreeHostCommonTest, AnimationsForRenderSurfaceHierarchy) {
SetLayerPropertiesForTesting(parent.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(0.25f, 0.f, 0.f),
gfx::PointF(2.5f, 0.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(0.25f, 0.f, 0.f),
gfx::PointF(2.5f, 0.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(render_surface2.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(0.25f, 0.f, 0.f),
gfx::PointF(2.5f, 0.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(child_of_root.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(0.25f, 0.f, 0.f),
gfx::PointF(2.5f, 0.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(child_of_rs1.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(0.25f, 0.f, 0.f),
gfx::PointF(2.5f, 0.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(child_of_rs2.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(0.25f, 0.f, 0.f),
gfx::PointF(2.5f, 0.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child_of_root.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(0.25f, 0.f, 0.f),
gfx::PointF(2.5f, 0.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child_of_rs1.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(0.25f, 0.f, 0.f),
gfx::PointF(2.5f, 0.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child_of_rs2.get(),
layer_transform,
- gfx::PointF(0.25f, 0.f),
+ gfx::Point3F(0.25f, 0.f, 0.f),
gfx::PointF(2.5f, 0.f),
gfx::Size(10, 10),
true,
@@ -2549,28 +2549,28 @@ TEST_F(LayerTreeHostCommonTest, DrawableAndVisibleContentRectsForSimpleLayers) {
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(75.f, 75.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child3.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(125.f, 125.f),
gfx::Size(50, 50),
true,
@@ -2617,35 +2617,35 @@ TEST_F(LayerTreeHostCommonTest,
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(grand_child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(grand_child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(75.f, 75.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(grand_child3.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(125.f, 125.f),
gfx::Size(50, 50),
true,
@@ -2698,35 +2698,35 @@ TEST_F(LayerTreeHostCommonTest,
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(3, 4),
true,
false);
SetLayerPropertiesForTesting(child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(75.f, 75.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child3.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(125.f, 125.f),
gfx::Size(50, 50),
true,
@@ -2778,14 +2778,14 @@ TEST_F(LayerTreeHostCommonTest,
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
uninvertible_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(50, 50),
true,
@@ -2804,7 +2804,7 @@ TEST_F(LayerTreeHostCommonTest,
SetLayerPropertiesForTesting(child.get(),
uninvertible_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(50, 50),
true,
@@ -2823,7 +2823,7 @@ TEST_F(LayerTreeHostCommonTest,
SetLayerPropertiesForTesting(child.get(),
uninvertible_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(50, 50),
true,
@@ -2851,14 +2851,14 @@ TEST_F(LayerTreeHostCommonTest,
SetLayerPropertiesForTesting(root.get(),
uninvertible_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(50, 50),
true,
@@ -2895,7 +2895,7 @@ TEST_F(LayerTreeHostCommonTest,
SetLayerPropertiesForTesting(root.get(),
uninvertible_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -2931,35 +2931,35 @@ TEST_F(LayerTreeHostCommonTest,
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(3, 4),
true,
false);
SetLayerPropertiesForTesting(child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(75.f, 75.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child3.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(125.f, 125.f),
gfx::Size(50, 50),
true,
@@ -3021,42 +3021,42 @@ TEST_F(LayerTreeHostCommonTest,
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(3, 4),
true,
false);
SetLayerPropertiesForTesting(render_surface2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(7, 13),
true,
false);
SetLayerPropertiesForTesting(child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(75.f, 75.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child3.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(125.f, 125.f),
gfx::Size(50, 50),
true,
@@ -3123,21 +3123,21 @@ TEST_F(LayerTreeHostCommonTest,
child_rotation.Rotate(45.0);
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(3, 4),
true,
false);
SetLayerPropertiesForTesting(child1.get(),
child_rotation,
- gfx::PointF(0.5f, 0.5f),
+ gfx::Point3F(25, 25, 0.f),
gfx::PointF(25.f, 25.f),
gfx::Size(50, 50),
true,
@@ -3194,21 +3194,22 @@ TEST_F(LayerTreeHostCommonTest,
child_rotation.Rotate(45.0);
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(3, 4),
true,
false);
+
SetLayerPropertiesForTesting(child1.get(),
child_rotation,
- gfx::PointF(0.5f, 0.5f),
+ gfx::Point3F(25, 25, 0.f),
gfx::PointF(25.f, 25.f),
gfx::Size(50, 50),
true,
@@ -3266,42 +3267,42 @@ TEST_F(LayerTreeHostCommonTest, DrawableAndVisibleContentRectsInHighDPI) {
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(3, 4),
true,
false);
SetLayerPropertiesForTesting(render_surface2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(7, 13),
true,
false);
SetLayerPropertiesForTesting(child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5.f, 5.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(75.f, 75.f),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(child3.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(125.f, 125.f),
gfx::Size(50, 50),
true,
@@ -3414,63 +3415,63 @@ TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithoutPreserves3d) {
// back-face culling.
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(front_facing_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(back_facing_child.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(front_facing_surface.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(back_facing_surface.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(front_facing_child_of_front_facing_surface.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(back_facing_child_of_front_facing_surface.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(front_facing_child_of_back_facing_surface.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(back_facing_child_of_back_facing_surface.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -3624,21 +3625,21 @@ TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithPreserves3d) {
// and (b) the layer's transform style is preserve-3d.
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false); // parent transform style is flat.
SetLayerPropertiesForTesting(front_facing_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(back_facing_child.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -3646,7 +3647,7 @@ TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithPreserves3d) {
// surface transform style is preserve-3d.
SetLayerPropertiesForTesting(front_facing_surface.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
@@ -3654,35 +3655,35 @@ TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithPreserves3d) {
// surface transform style is preserve-3d.
SetLayerPropertiesForTesting(back_facing_surface.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
true);
SetLayerPropertiesForTesting(front_facing_child_of_front_facing_surface.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
true);
SetLayerPropertiesForTesting(back_facing_child_of_front_facing_surface.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
true);
SetLayerPropertiesForTesting(front_facing_child_of_back_facing_surface.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
true);
SetLayerPropertiesForTesting(back_facing_child_of_back_facing_surface.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -3786,42 +3787,42 @@ TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithAnimatingTransforms) {
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(animating_surface.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child_of_animating_surface.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(animating_child.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -3919,35 +3920,35 @@ TEST_F(LayerTreeHostCommonTest,
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
true); // parent transform style is preserve3d.
SetLayerPropertiesForTesting(front_facing_surface.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
true); // surface transform style is flat.
SetLayerPropertiesForTesting(back_facing_surface.get(),
backface_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
true); // surface transform style is flat.
SetLayerPropertiesForTesting(child1.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child2.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -4042,7 +4043,7 @@ TEST_F(LayerTreeHostCommonTest, LayerTransformsInHighDPI) {
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
@@ -4051,7 +4052,7 @@ TEST_F(LayerTreeHostCommonTest, LayerTransformsInHighDPI) {
scoped_refptr<ContentLayer> child = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -4061,7 +4062,7 @@ TEST_F(LayerTreeHostCommonTest, LayerTransformsInHighDPI) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_empty.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(),
false,
@@ -4071,7 +4072,7 @@ TEST_F(LayerTreeHostCommonTest, LayerTransformsInHighDPI) {
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_no_scale.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -4186,7 +4187,7 @@ TEST_F(LayerTreeHostCommonTest, SurfaceLayerTransformsInHighDPI) {
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
@@ -4196,7 +4197,7 @@ TEST_F(LayerTreeHostCommonTest, SurfaceLayerTransformsInHighDPI) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(perspective_surface.get(),
perspective_matrix * scale_small_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -4206,7 +4207,7 @@ TEST_F(LayerTreeHostCommonTest, SurfaceLayerTransformsInHighDPI) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(scale_surface.get(),
scale_small_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -4290,7 +4291,7 @@ TEST_F(LayerTreeHostCommonTest,
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(133, 133),
false,
@@ -4299,7 +4300,7 @@ TEST_F(LayerTreeHostCommonTest,
scoped_refptr<ContentLayer> child = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(13, 13),
false,
@@ -4309,7 +4310,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_no_scale.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(13, 13),
false,
@@ -4414,7 +4415,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScale) {
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
parent_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
@@ -4424,7 +4425,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScale) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -4434,7 +4435,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScale) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_empty.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(),
false,
@@ -4444,7 +4445,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScale) {
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_no_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(12.f, 12.f),
gfx::Size(10, 10),
false,
@@ -4598,7 +4599,7 @@ TEST_F(LayerTreeHostCommonTest,
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
parent_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
@@ -4608,7 +4609,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -4618,7 +4619,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_empty.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(),
false,
@@ -4628,7 +4629,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_no_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(12.f, 12.f),
gfx::Size(10, 10),
false,
@@ -4702,7 +4703,7 @@ TEST_F(LayerTreeHostCommonTest, SmallContentsScale) {
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
parent_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
@@ -4712,7 +4713,7 @@ TEST_F(LayerTreeHostCommonTest, SmallContentsScale) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -4791,7 +4792,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForSurfaces) {
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
parent_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
@@ -4801,7 +4802,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForSurfaces) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -4811,7 +4812,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForSurfaces) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_scale_child_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
false,
@@ -4821,7 +4822,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForSurfaces) {
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_scale_child_no_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
false,
@@ -4831,7 +4832,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForSurfaces) {
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_no_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(12.f, 12.f),
gfx::Size(10, 10),
false,
@@ -4841,7 +4842,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForSurfaces) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_no_scale_child_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
false,
@@ -4851,7 +4852,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForSurfaces) {
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_no_scale_child_no_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
false,
@@ -4992,7 +4993,7 @@ TEST_F(LayerTreeHostCommonTest,
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
parent_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
@@ -5002,7 +5003,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -5012,7 +5013,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_scale_child_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
false,
@@ -5022,7 +5023,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_scale_child_no_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
false,
@@ -5032,7 +5033,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_no_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(12.f, 12.f),
gfx::Size(10, 10),
false,
@@ -5042,7 +5043,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_no_scale_child_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
false,
@@ -5052,7 +5053,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateNoScaleDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(surface_no_scale_child_no_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
false,
@@ -5194,7 +5195,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForAnimatingLayer) {
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
parent_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
false,
@@ -5204,7 +5205,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForAnimatingLayer) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child_scale.get(),
child_scale_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -5265,14 +5266,14 @@ TEST_F(LayerTreeHostCommonTest,
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -5311,7 +5312,7 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceTransformsInHighDPI) {
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
false,
@@ -5320,7 +5321,7 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceTransformsInHighDPI) {
scoped_refptr<ContentLayer> child = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -5331,7 +5332,7 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceTransformsInHighDPI) {
scoped_refptr<ContentLayer> replica = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(replica.get(),
replica_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(2.f, 2.f),
gfx::Size(10, 10),
false,
@@ -5343,7 +5344,7 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceTransformsInHighDPI) {
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(duplicate_child_non_owner.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
false,
@@ -5446,7 +5447,7 @@ TEST_F(LayerTreeHostCommonTest,
scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(33, 31),
false,
@@ -5455,7 +5456,7 @@ TEST_F(LayerTreeHostCommonTest,
scoped_refptr<ContentLayer> child = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(13, 11),
false,
@@ -5466,7 +5467,7 @@ TEST_F(LayerTreeHostCommonTest,
scoped_refptr<ContentLayer> replica = CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(replica.get(),
replica_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(13, 11),
false,
@@ -5478,7 +5479,7 @@ TEST_F(LayerTreeHostCommonTest,
CreateDrawableContentLayer(&delegate);
SetLayerPropertiesForTesting(duplicate_child_non_owner.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(13, 11),
false,
@@ -5583,21 +5584,21 @@ TEST_F(LayerTreeHostCommonTest, TransparentChildRenderSurfaceCreation) {
const gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
@@ -5625,7 +5626,7 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) {
const gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -5635,7 +5636,7 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) {
scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.pending_tree(), 2);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -5678,21 +5679,21 @@ class LCDTextTest
gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root_.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 1),
true,
false);
SetLayerPropertiesForTesting(child_.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 1),
true,
false);
SetLayerPropertiesForTesting(grand_child_.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 1),
true,
@@ -5825,7 +5826,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayer) {
scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -5835,7 +5836,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayer) {
scoped_refptr<Layer> child = Layer::Create();
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
@@ -5845,7 +5846,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayer) {
scoped_refptr<Layer> grand_child = Layer::Create();
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
@@ -5883,7 +5884,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) {
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.pending_tree(), 1);
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -5893,7 +5894,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) {
scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.pending_tree(), 2);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
@@ -5904,7 +5905,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) {
LayerImpl::Create(host_impl.pending_tree(), 3);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
@@ -5939,7 +5940,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayers) {
scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -5949,7 +5950,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayers) {
scoped_refptr<Layer> child = Layer::Create();
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
@@ -5960,7 +5961,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayers) {
scoped_refptr<Layer> grand_child = Layer::Create();
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
@@ -5996,7 +5997,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayersImpl) {
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.pending_tree(), 1);
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -6006,7 +6007,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayersImpl) {
scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.pending_tree(), 2);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
@@ -6018,7 +6019,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayersImpl) {
LayerImpl::Create(host_impl.pending_tree(), 3);
SetLayerPropertiesForTesting(grand_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
@@ -6053,7 +6054,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -6063,7 +6064,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
scoped_refptr<Layer> copy_grand_parent = Layer::Create();
SetLayerPropertiesForTesting(copy_grand_parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
@@ -6073,7 +6074,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
scoped_refptr<Layer> copy_parent = Layer::Create();
SetLayerPropertiesForTesting(copy_parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
@@ -6084,7 +6085,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
scoped_refptr<Layer> copy_layer = Layer::Create();
SetLayerPropertiesForTesting(copy_layer.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
@@ -6094,7 +6095,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
scoped_refptr<Layer> copy_child = Layer::Create();
SetLayerPropertiesForTesting(copy_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
@@ -6104,7 +6105,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
scoped_refptr<Layer> copy_grand_parent_sibling_before = Layer::Create();
SetLayerPropertiesForTesting(copy_grand_parent_sibling_before.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
@@ -6114,7 +6115,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
scoped_refptr<Layer> copy_grand_parent_sibling_after = Layer::Create();
SetLayerPropertiesForTesting(copy_grand_parent_sibling_after.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
@@ -6200,7 +6201,7 @@ TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) {
scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -6210,7 +6211,7 @@ TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) {
scoped_refptr<Layer> copy_parent = Layer::Create();
SetLayerPropertiesForTesting(copy_parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(),
true,
@@ -6221,7 +6222,7 @@ TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) {
scoped_refptr<Layer> copy_layer = Layer::Create();
SetLayerPropertiesForTesting(copy_layer.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
@@ -6231,7 +6232,7 @@ TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) {
scoped_refptr<Layer> copy_child = Layer::Create();
SetLayerPropertiesForTesting(copy_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
@@ -6275,7 +6276,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectInsideSurface) {
scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -6286,7 +6287,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectInsideSurface) {
scoped_refptr<Layer> surface = Layer::Create();
SetLayerPropertiesForTesting(surface.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(-10, -20),
gfx::Size(),
true,
@@ -6296,7 +6297,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectInsideSurface) {
scoped_refptr<Layer> surface_child = Layer::Create();
SetLayerPropertiesForTesting(surface_child.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -6359,35 +6360,35 @@ TEST_F(LayerTreeHostCommonTest, TransformedClipParent) {
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(render_surface.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(clip_parent.get(),
scale_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(1.f, 1.f),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(intervening.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(1.f, 1.f),
gfx::Size(5, 5),
true,
false);
SetLayerPropertiesForTesting(clip_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(1.f, 1.f),
gfx::Size(10, 10),
true,
@@ -6463,42 +6464,42 @@ TEST_F(LayerTreeHostCommonTest, ClipParentWithInterveningRenderSurface) {
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(clip_parent.get(),
translation_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(1.f, 1.f),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(intervening.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(1.f, 1.f),
gfx::Size(5, 5),
true,
false);
SetLayerPropertiesForTesting(render_surface2.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(clip_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(-10.f, -10.f),
gfx::Size(60, 60),
true,
@@ -6592,42 +6593,42 @@ TEST_F(LayerTreeHostCommonTest, ClipParentScrolledInterveningLayer) {
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(clip_parent.get(),
translation_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(1.f, 1.f),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(intervening.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(1.f, 1.f),
gfx::Size(5, 5),
true,
false);
SetLayerPropertiesForTesting(render_surface2.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(clip_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(-10.f, -10.f),
gfx::Size(60, 60),
true,
@@ -6708,35 +6709,35 @@ TEST_F(LayerTreeHostCommonTest, DescendantsOfClipChildren) {
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(clip_parent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(intervening.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(5, 5),
true,
false);
SetLayerPropertiesForTesting(clip_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(60, 60),
true,
false);
SetLayerPropertiesForTesting(child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(60, 60),
true,
@@ -6795,42 +6796,42 @@ TEST_F(LayerTreeHostCommonTest,
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(15, 15),
true,
false);
SetLayerPropertiesForTesting(clip_parent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(5, 5),
gfx::Size(5, 5),
true,
false);
SetLayerPropertiesForTesting(render_surface2.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(5, 5),
true,
false);
SetLayerPropertiesForTesting(clip_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(-1, 1),
gfx::Size(10, 10),
true,
false);
SetLayerPropertiesForTesting(non_clip_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(5, 5),
true,
@@ -6890,12 +6891,12 @@ TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) {
LayerImpl::Create(host_impl.active_tree(), 12345678);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -6906,7 +6907,7 @@ TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) {
// behavior.
SetLayerPropertiesForTesting(child1.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
false,
@@ -6914,7 +6915,7 @@ TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) {
child1->SetDrawsContent(true);
SetLayerPropertiesForTesting(child2.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -6922,7 +6923,7 @@ TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) {
child2->SetDrawsContent(true);
SetLayerPropertiesForTesting(child3.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -6969,21 +6970,21 @@ TEST_F(LayerTreeHostCommonTest, DoNotIncludeBackfaceInvisibleSurfaces) {
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(render_surface.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
false,
true);
SetLayerPropertiesForTesting(child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
@@ -7051,35 +7052,35 @@ TEST_F(LayerTreeHostCommonTest, ClippedByScrollParent) {
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_border.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_clip.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
false);
SetLayerPropertiesForTesting(scroll_parent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -7111,7 +7112,7 @@ TEST_F(LayerTreeHostCommonTest, SingularTransformSubtreesDoNotDraw) {
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -7119,7 +7120,7 @@ TEST_F(LayerTreeHostCommonTest, SingularTransformSubtreesDoNotDraw) {
root->SetForceRenderSurface(true);
SetLayerPropertiesForTesting(parent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
@@ -7127,7 +7128,7 @@ TEST_F(LayerTreeHostCommonTest, SingularTransformSubtreesDoNotDraw) {
parent->SetForceRenderSurface(true);
SetLayerPropertiesForTesting(child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
@@ -7192,35 +7193,35 @@ TEST_F(LayerTreeHostCommonTest, ClippedByOutOfOrderScrollParent) {
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_border.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_clip.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
false);
SetLayerPropertiesForTesting(scroll_parent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -7284,56 +7285,56 @@ TEST_F(LayerTreeHostCommonTest, ClippedByOutOfOrderScrollGrandparent) {
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_grandparent_border.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(scroll_grandparent_clip.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
false);
SetLayerPropertiesForTesting(scroll_grandparent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_border.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_clip.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
false);
SetLayerPropertiesForTesting(scroll_parent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -7419,70 +7420,70 @@ TEST_F(LayerTreeHostCommonTest, OutOfOrderClippingRequiresRSLLSorting) {
gfx::Transform identity_transform;
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_grandparent_border.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(scroll_grandparent_clip.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(20, 20),
true,
false);
SetLayerPropertiesForTesting(scroll_grandparent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(render_surface1.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_border.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_clip.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
false);
SetLayerPropertiesForTesting(scroll_parent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(render_surface2.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -7569,49 +7570,49 @@ TEST_F(LayerTreeHostCommonTest, DoNotClobberSorting) {
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_border.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(scroll_parent_clip.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
false);
SetLayerPropertiesForTesting(scroll_parent.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(scroll_child.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(top_content.get(),
top_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
false,
true);
SetLayerPropertiesForTesting(bottom_content.get(),
bottom_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
false,
@@ -7687,28 +7688,28 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) {
SetLayerPropertiesForTesting(root.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
false);
SetLayerPropertiesForTesting(container.get(),
container_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(40, 40),
true,
false);
SetLayerPropertiesForTesting(scroller.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(30, 30),
true,
false);
SetLayerPropertiesForTesting(fixed.get(),
identity_transform,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(50, 50),
true,
@@ -7876,28 +7877,28 @@ TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
SetLayerPropertiesForTesting(grand_parent.get(),
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
false);
SetLayerPropertiesForTesting(parent_raw,
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
false);
SetLayerPropertiesForTesting(child_raw,
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
false);
SetLayerPropertiesForTesting(grand_child_raw,
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
@@ -8080,35 +8081,35 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceLayerListMembership) {
SetLayerPropertiesForTesting(grand_parent_raw,
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
false);
SetLayerPropertiesForTesting(parent_raw,
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
false);
SetLayerPropertiesForTesting(child_raw,
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
false);
SetLayerPropertiesForTesting(grand_child1_raw,
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
false);
SetLayerPropertiesForTesting(grand_child2_raw,
identity_matrix,
- gfx::PointF(),
+ gfx::Point3F(),
gfx::PointF(),
gfx::Size(1, 2),
true,
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 919382f..45d533b 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -182,7 +182,6 @@ class LayerTreeHostImplTest : public testing::Test,
}
void SetupRootLayerImpl(scoped_ptr<LayerImpl> root) {
- root->SetAnchorPoint(gfx::PointF());
root->SetPosition(gfx::PointF());
root->SetBounds(gfx::Size(10, 10));
root->SetContentBounds(gfx::Size(10, 10));
@@ -234,7 +233,6 @@ class LayerTreeHostImplTest : public testing::Test,
root->SetBounds(content_size);
root->SetContentBounds(content_size);
root->SetPosition(gfx::PointF());
- root->SetAnchorPoint(gfx::PointF());
scoped_ptr<LayerImpl> scroll =
LayerImpl::Create(layer_tree_impl, kInnerViewportScrollLayerId);
@@ -254,7 +252,6 @@ class LayerTreeHostImplTest : public testing::Test,
scroll->SetBounds(content_size);
scroll->SetContentBounds(content_size);
scroll->SetPosition(gfx::PointF());
- scroll->SetAnchorPoint(gfx::PointF());
scroll->SetIsContainerForFixedPositionLayers(true);
scoped_ptr<LayerImpl> contents =
@@ -263,7 +260,6 @@ class LayerTreeHostImplTest : public testing::Test,
contents->SetBounds(content_size);
contents->SetContentBounds(content_size);
contents->SetPosition(gfx::PointF());
- contents->SetAnchorPoint(gfx::PointF());
scroll->AddChild(contents.Pass());
page_scale->AddChild(scroll.Pass());
@@ -845,7 +841,6 @@ TEST_F(LayerTreeHostImplTest, DISABLED_ScrollWithUserUnscrollableLayers) {
overflow->SetScrollClipLayer(scroll_layer->parent()->id());
overflow->SetScrollOffset(gfx::Vector2d());
overflow->SetPosition(gfx::PointF());
- overflow->SetAnchorPoint(gfx::PointF());
DrawFrame();
gfx::Point scroll_position(10, 10);
@@ -1691,7 +1686,6 @@ class DidDrawCheckLayer : public TiledLayerImpl {
will_draw_called_(false),
append_quads_called_(false),
did_draw_called_(false) {
- SetAnchorPoint(gfx::PointF());
SetBounds(gfx::Size(10, 10));
SetContentBounds(gfx::Size(10, 10));
SetDrawsContent(true);
@@ -2135,7 +2129,6 @@ class LayerTreeHostImplTopControlsTest : public LayerTreeHostImplTest {
root->SetBounds(layer_size_);
root->SetContentBounds(layer_size_);
root->SetPosition(gfx::PointF());
- root->SetAnchorPoint(gfx::PointF());
root->SetDrawsContent(false);
root->SetIsContainerForFixedPositionLayers(true);
int inner_viewport_scroll_layer_id = root->id();
@@ -2274,7 +2267,6 @@ TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) {
LayerImpl::Create(host_impl_->active_tree(), 1);
content_layer->SetDrawsContent(true);
content_layer->SetPosition(gfx::PointF());
- content_layer->SetAnchorPoint(gfx::PointF());
content_layer->SetBounds(contents_size);
content_layer->SetContentBounds(contents_size);
content_layer->SetContentsScale(2.f, 2.f);
@@ -2289,7 +2281,6 @@ TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) {
scroll_layer->SetBounds(contents_size);
scroll_layer->SetContentBounds(contents_size);
scroll_layer->SetPosition(gfx::PointF());
- scroll_layer->SetAnchorPoint(gfx::PointF());
scroll_layer->AddChild(content_layer.Pass());
scroll_clip_layer->AddChild(scroll_layer.Pass());
@@ -2900,10 +2891,11 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) {
// Only allow vertical scrolling.
clip_layer->SetBounds(
gfx::Size(child->bounds().width(), child->bounds().height() / 2));
- // The rotation depends on the layer's anchor point, and the child layer is a
- // different size than the clip, so make sure the clip layer's anchor lines
- // up over the child.
- clip_layer->SetAnchorPoint(gfx::PointF(0.5, 1.0));
+ // The rotation depends on the layer's transform origin, and the child layer
+ // is a different size than the clip, so make sure the clip layer's origin
+ // lines up over the child.
+ clip_layer->SetTransformOrigin(gfx::Point3F(
+ clip_layer->bounds().width() * 0.5f, clip_layer->bounds().height(), 0.f));
LayerImpl* child_ptr = child.get();
clip_layer->AddChild(child.Pass());
scroll_layer->AddChild(clip_layer.Pass());
@@ -3495,7 +3487,6 @@ class BlendStateCheckLayer : public LayerImpl {
ResourceProvider::TextureUsageAny,
RGBA_8888)) {
resource_provider->AllocateForTesting(resource_id_);
- SetAnchorPoint(gfx::PointF());
SetBounds(gfx::Size(10, 10));
SetContentBounds(gfx::Size(10, 10));
SetDrawsContent(true);
@@ -3514,7 +3505,6 @@ TEST_F(LayerTreeHostImplTest, BlendingOffWhenDrawingOpaqueLayers) {
{
scoped_ptr<LayerImpl> root =
LayerImpl::Create(host_impl_->active_tree(), 1);
- root->SetAnchorPoint(gfx::PointF());
root->SetBounds(gfx::Size(10, 10));
root->SetContentBounds(root->bounds());
root->SetDrawsContent(false);
@@ -4041,7 +4031,6 @@ TEST_F(LayerTreeHostImplTest, ReshapeNotCalledUntilDraw) {
scoped_ptr<LayerImpl> root =
FakeDrawableLayerImpl::Create(host_impl_->active_tree(), 1);
- root->SetAnchorPoint(gfx::PointF());
root->SetBounds(gfx::Size(10, 10));
root->SetContentBounds(gfx::Size(10, 10));
root->SetDrawsContent(true);
@@ -4114,11 +4103,9 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
scoped_ptr<LayerImpl> child =
FakeDrawableLayerImpl::Create(layer_tree_host_impl->active_tree(), 2);
child->SetPosition(gfx::PointF(12.f, 13.f));
- child->SetAnchorPoint(gfx::PointF());
child->SetBounds(gfx::Size(14, 15));
child->SetContentBounds(gfx::Size(14, 15));
child->SetDrawsContent(true);
- root->SetAnchorPoint(gfx::PointF());
root->SetBounds(gfx::Size(500, 500));
root->SetContentBounds(gfx::Size(500, 500));
root->SetDrawsContent(true);
@@ -4174,11 +4161,9 @@ TEST_F(LayerTreeHostImplTest, RootLayerDoesntCreateExtraSurface) {
FakeDrawableLayerImpl::Create(host_impl_->active_tree(), 1);
scoped_ptr<LayerImpl> child =
FakeDrawableLayerImpl::Create(host_impl_->active_tree(), 2);
- child->SetAnchorPoint(gfx::PointF());
child->SetBounds(gfx::Size(10, 10));
child->SetContentBounds(gfx::Size(10, 10));
child->SetDrawsContent(true);
- root->SetAnchorPoint(gfx::PointF());
root->SetBounds(gfx::Size(10, 10));
root->SetContentBounds(gfx::Size(10, 10));
root->SetDrawsContent(true);
@@ -4434,7 +4419,6 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity(
gfx::Rect grand_child_rect(5, 5, 150, 150);
root->CreateRenderSurface();
- root->SetAnchorPoint(gfx::PointF());
root->SetPosition(root_rect.origin());
root->SetBounds(root_rect.size());
root->SetContentBounds(root->bounds());
@@ -4442,7 +4426,6 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity(
root->SetDrawsContent(false);
root->render_surface()->SetContentRect(gfx::Rect(root_rect.size()));
- child->SetAnchorPoint(gfx::PointF());
child->SetPosition(gfx::PointF(child_rect.x(), child_rect.y()));
child->SetOpacity(0.5f);
child->SetBounds(gfx::Size(child_rect.width(), child_rect.height()));
@@ -4451,7 +4434,6 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity(
child->SetDrawsContent(false);
child->SetForceRenderSurface(true);
- grand_child->SetAnchorPoint(gfx::PointF());
grand_child->SetPosition(grand_child_rect.origin());
grand_child->SetBounds(grand_child_rect.size());
grand_child->SetContentBounds(grand_child->bounds());
@@ -4530,7 +4512,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
scoped_ptr<LayerImpl> root_layer =
LayerImpl::Create(host_impl_->active_tree(), 1);
root_layer->SetBounds(gfx::Size(10, 10));
- root_layer->SetAnchorPoint(gfx::PointF());
scoped_refptr<VideoFrame> softwareFrame =
media::VideoFrame::CreateColorFrame(
@@ -4540,7 +4521,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
scoped_ptr<VideoLayerImpl> video_layer =
VideoLayerImpl::Create(host_impl_->active_tree(), 4, &provider);
video_layer->SetBounds(gfx::Size(10, 10));
- video_layer->SetAnchorPoint(gfx::PointF());
video_layer->SetContentBounds(gfx::Size(10, 10));
video_layer->SetDrawsContent(true);
root_layer->AddChild(video_layer.PassAs<LayerImpl>());
@@ -4548,7 +4528,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
scoped_ptr<IOSurfaceLayerImpl> io_surface_layer =
IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5);
io_surface_layer->SetBounds(gfx::Size(10, 10));
- io_surface_layer->SetAnchorPoint(gfx::PointF());
io_surface_layer->SetContentBounds(gfx::Size(10, 10));
io_surface_layer->SetDrawsContent(true);
io_surface_layer->SetIOSurfaceProperties(1, gfx::Size(10, 10));
@@ -4705,7 +4684,6 @@ class LayerTreeHostImplTestWithDelegatingRenderer
TEST_F(LayerTreeHostImplTestWithDelegatingRenderer, FrameIncludesDamageRect) {
scoped_ptr<SolidColorLayerImpl> root =
SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
- root->SetAnchorPoint(gfx::PointF());
root->SetPosition(gfx::PointF());
root->SetBounds(gfx::Size(10, 10));
root->SetContentBounds(gfx::Size(10, 10));
@@ -4714,7 +4692,6 @@ TEST_F(LayerTreeHostImplTestWithDelegatingRenderer, FrameIncludesDamageRect) {
// Child layer is in the bottom right corner.
scoped_ptr<SolidColorLayerImpl> child =
SolidColorLayerImpl::Create(host_impl_->active_tree(), 2);
- child->SetAnchorPoint(gfx::PointF(0.f, 0.f));
child->SetPosition(gfx::PointF(9.f, 9.f));
child->SetBounds(gfx::Size(1, 1));
child->SetContentBounds(gfx::Size(1, 1));
@@ -4797,13 +4774,11 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithScaling) {
root->SetBounds(root_size);
root->SetContentBounds(root_size);
root->SetPosition(gfx::PointF());
- root->SetAnchorPoint(gfx::PointF());
gfx::Size scaling_layer_size(50, 50);
scaling_layer->SetBounds(scaling_layer_size);
scaling_layer->SetContentBounds(scaling_layer_size);
scaling_layer->SetPosition(gfx::PointF());
- scaling_layer->SetAnchorPoint(gfx::PointF());
gfx::Transform scale;
scale.Scale(2.f, 2.f);
scaling_layer->SetTransform(scale);
@@ -4811,13 +4786,11 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithScaling) {
content_layer->SetBounds(scaling_layer_size);
content_layer->SetContentBounds(scaling_layer_size);
content_layer->SetPosition(gfx::PointF());
- content_layer->SetAnchorPoint(gfx::PointF());
content_layer->SetDrawsContent(true);
mask_layer->SetBounds(scaling_layer_size);
mask_layer->SetContentBounds(scaling_layer_size);
mask_layer->SetPosition(gfx::PointF());
- mask_layer->SetAnchorPoint(gfx::PointF());
mask_layer->SetDrawsContent(true);
@@ -4927,20 +4900,17 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithDifferentBounds) {
root->SetBounds(root_size);
root->SetContentBounds(root_size);
root->SetPosition(gfx::PointF());
- root->SetAnchorPoint(gfx::PointF());
gfx::Size layer_size(50, 50);
content_layer->SetBounds(layer_size);
content_layer->SetContentBounds(layer_size);
content_layer->SetPosition(gfx::PointF());
- content_layer->SetAnchorPoint(gfx::PointF());
content_layer->SetDrawsContent(true);
gfx::Size mask_size(100, 100);
mask_layer->SetBounds(mask_size);
mask_layer->SetContentBounds(mask_size);
mask_layer->SetPosition(gfx::PointF());
- mask_layer->SetAnchorPoint(gfx::PointF());
mask_layer->SetDrawsContent(true);
// Check that the mask fills the surface.
@@ -5077,20 +5047,17 @@ TEST_F(LayerTreeHostImplTest, ReflectionMaskLayerWithDifferentBounds) {
root->SetBounds(root_size);
root->SetContentBounds(root_size);
root->SetPosition(gfx::PointF());
- root->SetAnchorPoint(gfx::PointF());
gfx::Size layer_size(50, 50);
content_layer->SetBounds(layer_size);
content_layer->SetContentBounds(layer_size);
content_layer->SetPosition(gfx::PointF());
- content_layer->SetAnchorPoint(gfx::PointF());
content_layer->SetDrawsContent(true);
gfx::Size mask_size(100, 100);
mask_layer->SetBounds(mask_size);
mask_layer->SetContentBounds(mask_size);
mask_layer->SetPosition(gfx::PointF());
- mask_layer->SetAnchorPoint(gfx::PointF());
mask_layer->SetDrawsContent(true);
// Check that the mask fills the surface.
@@ -5236,27 +5203,23 @@ TEST_F(LayerTreeHostImplTest, ReflectionMaskLayerForSurfaceWithUnclippedChild) {
root->SetBounds(root_size);
root->SetContentBounds(root_size);
root->SetPosition(gfx::PointF());
- root->SetAnchorPoint(gfx::PointF());
gfx::Size layer_size(50, 50);
content_layer->SetBounds(layer_size);
content_layer->SetContentBounds(layer_size);
content_layer->SetPosition(gfx::PointF());
- content_layer->SetAnchorPoint(gfx::PointF());
content_layer->SetDrawsContent(true);
gfx::Size child_size(50, 50);
content_child_layer->SetBounds(child_size);
content_child_layer->SetContentBounds(child_size);
content_child_layer->SetPosition(gfx::Point(50, 0));
- content_child_layer->SetAnchorPoint(gfx::PointF());
content_child_layer->SetDrawsContent(true);
gfx::Size mask_size(50, 50);
mask_layer->SetBounds(mask_size);
mask_layer->SetContentBounds(mask_size);
mask_layer->SetPosition(gfx::PointF());
- mask_layer->SetAnchorPoint(gfx::PointF());
mask_layer->SetDrawsContent(true);
float device_scale_factor = 1.f;
@@ -5362,34 +5325,29 @@ TEST_F(LayerTreeHostImplTest, MaskLayerForSurfaceWithClippedLayer) {
root->SetBounds(root_size);
root->SetContentBounds(root_size);
root->SetPosition(gfx::PointF());
- root->SetAnchorPoint(gfx::PointF());
gfx::Rect clipping_rect(20, 10, 10, 20);
clipping_layer->SetBounds(clipping_rect.size());
clipping_layer->SetContentBounds(clipping_rect.size());
clipping_layer->SetPosition(clipping_rect.origin());
- clipping_layer->SetAnchorPoint(gfx::PointF());
clipping_layer->SetMasksToBounds(true);
gfx::Size layer_size(50, 50);
content_layer->SetBounds(layer_size);
content_layer->SetContentBounds(layer_size);
content_layer->SetPosition(gfx::Point() - clipping_rect.OffsetFromOrigin());
- content_layer->SetAnchorPoint(gfx::PointF());
content_layer->SetDrawsContent(true);
gfx::Size child_size(50, 50);
content_child_layer->SetBounds(child_size);
content_child_layer->SetContentBounds(child_size);
content_child_layer->SetPosition(gfx::Point(50, 0));
- content_child_layer->SetAnchorPoint(gfx::PointF());
content_child_layer->SetDrawsContent(true);
gfx::Size mask_size(100, 100);
mask_layer->SetBounds(mask_size);
mask_layer->SetContentBounds(mask_size);
mask_layer->SetPosition(gfx::PointF());
- mask_layer->SetAnchorPoint(gfx::PointF());
mask_layer->SetDrawsContent(true);
float device_scale_factor = 1.f;
@@ -6098,7 +6056,6 @@ TEST_F(LayerTreeHostImplTest, ScrollUnknownNotOnAncestorChain) {
occluder_layer->SetBounds(content_size);
occluder_layer->SetContentBounds(content_size);
occluder_layer->SetPosition(gfx::PointF());
- occluder_layer->SetAnchorPoint(gfx::PointF());
// The parent of the occluder is *above* the scroller.
page_scale_layer->AddChild(occluder_layer.Pass());
@@ -6128,7 +6085,6 @@ TEST_F(LayerTreeHostImplTest, ScrollUnknownScrollAncestorMismatch) {
occluder_layer->SetBounds(content_size);
occluder_layer->SetContentBounds(content_size);
occluder_layer->SetPosition(gfx::PointF(-10.f, -10.f));
- occluder_layer->SetAnchorPoint(gfx::PointF());
int child_scroll_clip_layer_id = 7;
scoped_ptr<LayerImpl> child_scroll_clip =
@@ -6202,7 +6158,6 @@ TEST_F(LayerTreeHostImplTest, ScrollInvisibleScrollerWithVisibleScrollChild) {
scroll_child->SetContentBounds(content_size);
// Move the scroll child so it's not hit by our test point.
scroll_child->SetPosition(gfx::PointF(10.f, 10.f));
- scroll_child->SetAnchorPoint(gfx::PointF());
int invisible_scroll_layer_id = 7;
scoped_ptr<LayerImpl> invisible_scroll =
@@ -6243,7 +6198,6 @@ TEST_F(LayerTreeHostImplTest, ScrollInvisibleScrollerWithVisibleScrollChild) {
TEST_F(LayerTreeHostImplTest, LatencyInfoPassedToCompositorFrameMetadata) {
scoped_ptr<SolidColorLayerImpl> root =
SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
- root->SetAnchorPoint(gfx::PointF());
root->SetPosition(gfx::PointF());
root->SetBounds(gfx::Size(10, 10));
root->SetContentBounds(gfx::Size(10, 10));
@@ -6460,7 +6414,6 @@ class LayerTreeHostImplVirtualViewportTest : public LayerTreeHostImplTest {
inner_scroll->SetBounds(outer_viewport);
inner_scroll->SetContentBounds(outer_viewport);
inner_scroll->SetPosition(gfx::PointF());
- inner_scroll->SetAnchorPoint(gfx::PointF());
scoped_ptr<LayerImpl> outer_clip =
LayerImpl::Create(layer_tree_impl, kOuterViewportClipLayerId);
@@ -6474,7 +6427,6 @@ class LayerTreeHostImplVirtualViewportTest : public LayerTreeHostImplTest {
outer_scroll->SetBounds(content_size);
outer_scroll->SetContentBounds(content_size);
outer_scroll->SetPosition(gfx::PointF());
- outer_scroll->SetAnchorPoint(gfx::PointF());
scoped_ptr<LayerImpl> contents =
LayerImpl::Create(layer_tree_impl, 8);
@@ -6482,7 +6434,6 @@ class LayerTreeHostImplVirtualViewportTest : public LayerTreeHostImplTest {
contents->SetBounds(content_size);
contents->SetContentBounds(content_size);
contents->SetPosition(gfx::PointF());
- contents->SetAnchorPoint(gfx::PointF());
outer_scroll->AddChild(contents.Pass());
outer_clip->AddChild(outer_scroll.Pass());
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc
index 54c95da..9b38686 100644
--- a/cc/trees/layer_tree_host_pixeltest_masks.cc
+++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -107,7 +107,6 @@ TEST_F(LayerTreeHostMasksPixelTest, MaskOfClippedLayer) {
// Clip to the top half of the green layer.
scoped_refptr<Layer> clip = Layer::Create();
- clip->SetAnchorPoint(gfx::PointF(0.f, 0.f));
clip->SetPosition(gfx::Point(0, 0));
clip->SetBounds(gfx::Size(200, 100));
clip->SetMasksToBounds(true);
@@ -149,7 +148,7 @@ TEST_F(LayerTreeHostMasksPixelTest, MaskWithReplica) {
replica_transform.Rotate(-90.0);
scoped_refptr<Layer> replica = Layer::Create();
- replica->SetAnchorPoint(gfx::PointF(0.5f, 0.5f));
+ replica->SetTransformOrigin(gfx::Point3F(50.f, 50.f, 0.f));
replica->SetPosition(gfx::Point(100, 100));
replica->SetTransform(replica_transform);
green->SetReplicaLayer(replica.get());
@@ -173,7 +172,6 @@ TEST_F(LayerTreeHostMasksPixelTest, MaskWithReplicaOfClippedLayer) {
// Clip to the bottom half of the green layer, and the left half of the
// replica.
scoped_refptr<Layer> clip = Layer::Create();
- clip->SetAnchorPoint(gfx::PointF(0.f, 0.f));
clip->SetPosition(gfx::Point(0, 50));
clip->SetBounds(gfx::Size(150, 150));
clip->SetMasksToBounds(true);
@@ -188,7 +186,7 @@ TEST_F(LayerTreeHostMasksPixelTest, MaskWithReplicaOfClippedLayer) {
replica_transform.Rotate(-90.0);
scoped_refptr<Layer> replica = Layer::Create();
- replica->SetAnchorPoint(gfx::PointF(0.5f, 0.5f));
+ replica->SetTransformOrigin(gfx::Point3F(50.f, 50.f, 0.f));
replica->SetPosition(gfx::Point(100, 100));
replica->SetTransform(replica_transform);
green->SetReplicaLayer(replica.get());
@@ -223,7 +221,7 @@ TEST_F(LayerTreeHostMasksPixelTest, MaskOfReplica) {
replica_transform.Translate(100.0, 0.0);
scoped_refptr<Layer> replica = Layer::Create();
- replica->SetAnchorPoint(gfx::PointF(1.f, 1.f));
+ replica->SetTransformOrigin(gfx::Point3F(100.f, 100.f, 0.f));
replica->SetPosition(gfx::Point());
replica->SetTransform(replica_transform);
replica->SetMaskLayer(mask.get());
@@ -247,7 +245,6 @@ TEST_F(LayerTreeHostMasksPixelTest, MaskOfReplicaOfClippedLayer) {
// Clip to the bottom 3/4 of the green layer, and the top 3/4 of the replica.
scoped_refptr<Layer> clip = Layer::Create();
- clip->SetAnchorPoint(gfx::PointF(0.f, 0.f));
clip->SetPosition(gfx::Point(0, 25));
clip->SetBounds(gfx::Size(200, 150));
clip->SetMasksToBounds(true);
@@ -266,7 +263,7 @@ TEST_F(LayerTreeHostMasksPixelTest, MaskOfReplicaOfClippedLayer) {
replica_transform.Translate(100.0, 0.0);
scoped_refptr<Layer> replica = Layer::Create();
- replica->SetAnchorPoint(gfx::PointF(1.f, 1.f));
+ replica->SetTransformOrigin(gfx::Point3F(100.f, 100.f, 0.f));
replica->SetPosition(gfx::Point());
replica->SetTransform(replica_transform);
replica->SetMaskLayer(mask.get());
diff --git a/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc b/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
index 47964fd..5bc2f31 100644
--- a/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
+++ b/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
@@ -98,7 +98,6 @@ TEST_F(LayerTreeHostOnDemandRasterPixelTest, RasterPictureLayer) {
scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client);
layer->SetIsDrawable(true);
- layer->SetAnchorPoint(gfx::PointF());
layer->SetBounds(layer_rect.size());
layer->SetPosition(layer_rect.origin());
diff --git a/cc/trees/layer_tree_host_pixeltest_readback.cc b/cc/trees/layer_tree_host_pixeltest_readback.cc
index 2377da8..4c80839 100644
--- a/cc/trees/layer_tree_host_pixeltest_readback.cc
+++ b/cc/trees/layer_tree_host_pixeltest_readback.cc
@@ -954,18 +954,15 @@ class LayerTreeHostReadbackDeviceScalePixelTest
TEST_F(LayerTreeHostReadbackDeviceScalePixelTest,
ReadbackSubrect_Software) {
scoped_refptr<ContentLayer> background = ContentLayer::Create(&white_client_);
- background->SetAnchorPoint(gfx::PointF());
background->SetBounds(gfx::Size(100, 100));
background->SetIsDrawable(true);
scoped_refptr<ContentLayer> green = ContentLayer::Create(&green_client_);
- green->SetAnchorPoint(gfx::PointF());
green->SetBounds(gfx::Size(100, 100));
green->SetIsDrawable(true);
background->AddChild(green);
scoped_refptr<ContentLayer> blue = ContentLayer::Create(&blue_client_);
- blue->SetAnchorPoint(gfx::PointF());
blue->SetPosition(gfx::Point(50, 50));
blue->SetBounds(gfx::Size(25, 25));
blue->SetIsDrawable(true);
@@ -985,18 +982,15 @@ TEST_F(LayerTreeHostReadbackDeviceScalePixelTest,
TEST_F(LayerTreeHostReadbackDeviceScalePixelTest,
ReadbackSubrect_GL) {
scoped_refptr<ContentLayer> background = ContentLayer::Create(&white_client_);
- background->SetAnchorPoint(gfx::PointF());
background->SetBounds(gfx::Size(100, 100));
background->SetIsDrawable(true);
scoped_refptr<ContentLayer> green = ContentLayer::Create(&green_client_);
- green->SetAnchorPoint(gfx::PointF());
green->SetBounds(gfx::Size(100, 100));
green->SetIsDrawable(true);
background->AddChild(green);
scoped_refptr<ContentLayer> blue = ContentLayer::Create(&blue_client_);
- blue->SetAnchorPoint(gfx::PointF());
blue->SetPosition(gfx::Point(50, 50));
blue->SetBounds(gfx::Size(25, 25));
blue->SetIsDrawable(true);
@@ -1016,19 +1010,16 @@ TEST_F(LayerTreeHostReadbackDeviceScalePixelTest,
TEST_F(LayerTreeHostReadbackDeviceScalePixelTest,
ReadbackNonRootLayerSubrect_Software) {
scoped_refptr<ContentLayer> background = ContentLayer::Create(&white_client_);
- background->SetAnchorPoint(gfx::PointF());
background->SetBounds(gfx::Size(100, 100));
background->SetIsDrawable(true);
scoped_refptr<ContentLayer> green = ContentLayer::Create(&green_client_);
- green->SetAnchorPoint(gfx::PointF());
green->SetPosition(gfx::Point(10, 20));
green->SetBounds(gfx::Size(90, 80));
green->SetIsDrawable(true);
background->AddChild(green);
scoped_refptr<ContentLayer> blue = ContentLayer::Create(&blue_client_);
- blue->SetAnchorPoint(gfx::PointF());
blue->SetPosition(gfx::Point(50, 50));
blue->SetBounds(gfx::Size(25, 25));
blue->SetIsDrawable(true);
@@ -1049,19 +1040,16 @@ TEST_F(LayerTreeHostReadbackDeviceScalePixelTest,
TEST_F(LayerTreeHostReadbackDeviceScalePixelTest,
ReadbackNonRootLayerSubrect_GL) {
scoped_refptr<ContentLayer> background = ContentLayer::Create(&white_client_);
- background->SetAnchorPoint(gfx::PointF());
background->SetBounds(gfx::Size(100, 100));
background->SetIsDrawable(true);
scoped_refptr<ContentLayer> green = ContentLayer::Create(&green_client_);
- green->SetAnchorPoint(gfx::PointF());
green->SetPosition(gfx::Point(10, 20));
green->SetBounds(gfx::Size(90, 80));
green->SetIsDrawable(true);
background->AddChild(green);
scoped_refptr<ContentLayer> blue = ContentLayer::Create(&blue_client_);
- blue->SetAnchorPoint(gfx::PointF());
blue->SetPosition(gfx::Point(50, 50));
blue->SetBounds(gfx::Size(25, 25));
blue->SetIsDrawable(true);
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 472477b..870f2df 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -1004,7 +1004,6 @@ class ContentLayerWithUpdateTracking : public ContentLayer {
private:
explicit ContentLayerWithUpdateTracking(ContentLayerClient* client)
: ContentLayer(client), paint_contents_count_(0) {
- SetAnchorPoint(gfx::PointF(0.f, 0.f));
SetBounds(gfx::Size(10, 10));
SetIsDrawable(true);
}
@@ -1094,12 +1093,10 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(gfx::Size(30, 30));
- root_layer_->SetAnchorPoint(gfx::PointF(0.f, 0.f));
child_layer_->SetIsDrawable(true);
child_layer_->SetPosition(gfx::Point(2, 2));
child_layer_->SetBounds(gfx::Size(10, 10));
- child_layer_->SetAnchorPoint(gfx::PointF(0.f, 0.f));
layer_tree_host()->SetRootLayer(root_layer_);
@@ -1343,7 +1340,7 @@ MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(
static void SetLayerPropertiesForTesting(Layer* layer,
Layer* parent,
const gfx::Transform& transform,
- const gfx::PointF& anchor,
+ const gfx::Point3F& transform_origin,
const gfx::PointF& position,
const gfx::Size& bounds,
bool opaque) {
@@ -1351,7 +1348,7 @@ static void SetLayerPropertiesForTesting(Layer* layer,
if (parent)
parent->AddChild(layer);
layer->SetTransform(transform);
- layer->SetAnchorPoint(anchor);
+ layer->SetTransformOrigin(transform_origin);
layer->SetPosition(position);
layer->SetBounds(bounds);
layer->SetContentsOpaque(opaque);
@@ -1729,7 +1726,7 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest {
SetLayerPropertiesForTesting(layer_.get(),
0,
identity_matrix,
- gfx::PointF(0.f, 0.f),
+ gfx::Point3F(0.f, 0.f, 0.f),
gfx::PointF(0.f, 0.f),
gfx::Size(10, 20),
true);
@@ -1896,7 +1893,6 @@ class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest {
content_layer_ = ContentLayer::Create(&client_);
content_layer_->SetBounds(gfx::Size(10, 10));
content_layer_->SetPosition(gfx::PointF(0.f, 0.f));
- content_layer_->SetAnchorPoint(gfx::PointF(0.f, 0.f));
content_layer_->SetIsDrawable(true);
layer_tree_host()->root_layer()->AddChild(content_layer_);
@@ -2548,7 +2544,6 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest {
scoped_refptr<IOSurfaceLayer> io_surface_layer = IOSurfaceLayer::Create();
io_surface_layer->SetBounds(gfx::Size(10, 10));
- io_surface_layer->SetAnchorPoint(gfx::PointF());
io_surface_layer->SetIsDrawable(true);
io_surface_layer->SetContentsOpaque(true);
io_surface_layer->SetIOSurfaceProperties(io_surface_id_, io_surface_size_);
@@ -2956,7 +2951,6 @@ class PushPropertiesCountingLayerImpl : public LayerImpl {
PushPropertiesCountingLayerImpl(LayerTreeImpl* tree_impl, int id)
: LayerImpl(tree_impl, id),
push_properties_count_(0) {
- SetAnchorPoint(gfx::PointF());
SetBounds(gfx::Size(1, 1));
}
};
@@ -2990,7 +2984,6 @@ class PushPropertiesCountingLayer : public Layer {
private:
PushPropertiesCountingLayer()
: push_properties_count_(0), persist_needs_push_properties_(false) {
- SetAnchorPoint(gfx::PointF());
SetBounds(gfx::Size(1, 1));
SetIsDrawable(true);
}
@@ -4016,19 +4009,16 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
protected:
virtual void SetupTree() OVERRIDE {
root_layer_ = Layer::Create();
- root_layer_->SetAnchorPoint(gfx::PointF());
root_layer_->SetPosition(gfx::Point());
root_layer_->SetBounds(gfx::Size(10, 10));
parent_layer_ = SolidColorLayer::Create();
- parent_layer_->SetAnchorPoint(gfx::PointF());
parent_layer_->SetPosition(gfx::Point());
parent_layer_->SetBounds(gfx::Size(10, 10));
parent_layer_->SetIsDrawable(true);
root_layer_->AddChild(parent_layer_);
child_layer_ = SolidColorLayer::Create();
- child_layer_->SetAnchorPoint(gfx::PointF());
child_layer_->SetPosition(gfx::Point());
child_layer_->SetBounds(gfx::Size(10, 10));
child_layer_->SetIsDrawable(true);
@@ -4089,7 +4079,6 @@ class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest {
virtual void SetupTree() OVERRIDE {
root_layer_ = FakePictureLayer::Create(&client_);
- root_layer_->SetAnchorPoint(gfx::PointF());
root_layer_->SetBounds(gfx::Size(10, 10));
layer_tree_host()->SetRootLayer(root_layer_);
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 3128f47..47edbb1 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -308,12 +308,10 @@ class LayerTreeHostContextTestLostContextSucceedsWithContent
virtual void SetupTree() OVERRIDE {
root_ = Layer::Create();
root_->SetBounds(gfx::Size(10, 10));
- root_->SetAnchorPoint(gfx::PointF());
root_->SetIsDrawable(true);
content_ = FakeContentLayer::Create(&client_);
content_->SetBounds(gfx::Size(10, 10));
- content_->SetAnchorPoint(gfx::PointF());
content_->SetIsDrawable(true);
root_->AddChild(content_);
@@ -729,25 +727,21 @@ class LayerTreeHostContextTestDontUseLostResources
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
- root->SetAnchorPoint(gfx::PointF());
root->SetIsDrawable(true);
scoped_refptr<FakeDelegatedRendererLayer> delegated =
FakeDelegatedRendererLayer::Create(delegated_frame_provider_.get());
delegated->SetBounds(gfx::Size(10, 10));
- delegated->SetAnchorPoint(gfx::PointF());
delegated->SetIsDrawable(true);
root->AddChild(delegated);
scoped_refptr<ContentLayer> content = ContentLayer::Create(&client_);
content->SetBounds(gfx::Size(10, 10));
- content->SetAnchorPoint(gfx::PointF());
content->SetIsDrawable(true);
root->AddChild(content);
scoped_refptr<TextureLayer> texture = TextureLayer::CreateForMailbox(NULL);
texture->SetBounds(gfx::Size(10, 10));
- texture->SetAnchorPoint(gfx::PointF());
texture->SetIsDrawable(true);
texture->SetTextureMailbox(
TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point),
@@ -758,12 +752,10 @@ class LayerTreeHostContextTestDontUseLostResources
scoped_refptr<ContentLayer> mask = ContentLayer::Create(&client_);
mask->SetBounds(gfx::Size(10, 10));
- mask->SetAnchorPoint(gfx::PointF());
scoped_refptr<ContentLayer> content_with_mask =
ContentLayer::Create(&client_);
content_with_mask->SetBounds(gfx::Size(10, 10));
- content_with_mask->SetAnchorPoint(gfx::PointF());
content_with_mask->SetIsDrawable(true);
content_with_mask->SetMaskLayer(mask.get());
root->AddChild(content_with_mask);
@@ -771,21 +763,18 @@ class LayerTreeHostContextTestDontUseLostResources
scoped_refptr<VideoLayer> video_color =
VideoLayer::Create(&color_frame_provider_);
video_color->SetBounds(gfx::Size(10, 10));
- video_color->SetAnchorPoint(gfx::PointF());
video_color->SetIsDrawable(true);
root->AddChild(video_color);
scoped_refptr<VideoLayer> video_hw =
VideoLayer::Create(&hw_frame_provider_);
video_hw->SetBounds(gfx::Size(10, 10));
- video_hw->SetAnchorPoint(gfx::PointF());
video_hw->SetIsDrawable(true);
root->AddChild(video_hw);
scoped_refptr<VideoLayer> video_scaled_hw =
VideoLayer::Create(&scaled_hw_frame_provider_);
video_scaled_hw->SetBounds(gfx::Size(10, 10));
- video_scaled_hw->SetAnchorPoint(gfx::PointF());
video_scaled_hw->SetIsDrawable(true);
root->AddChild(video_scaled_hw);
@@ -818,7 +807,6 @@ class LayerTreeHostContextTestDontUseLostResources
// TODO(danakj): IOSurface layer can not be transported. crbug.com/239335
scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create();
io_surface->SetBounds(gfx::Size(10, 10));
- io_surface->SetAnchorPoint(gfx::PointF());
io_surface->SetIsDrawable(true);
io_surface->SetIOSurfaceProperties(1, gfx::Size(10, 10));
root->AddChild(io_surface);
@@ -833,7 +821,6 @@ class LayerTreeHostContextTestDontUseLostResources
PaintedScrollbarLayer::Create(
scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content->id());
scrollbar->SetBounds(gfx::Size(10, 10));
- scrollbar->SetAnchorPoint(gfx::PointF());
scrollbar->SetIsDrawable(true);
root->AddChild(scrollbar);
@@ -929,12 +916,10 @@ class LayerTreeHostContextTestImplSidePainting
virtual void SetupTree() OVERRIDE {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
- root->SetAnchorPoint(gfx::PointF());
root->SetIsDrawable(true);
scoped_refptr<PictureLayer> picture = PictureLayer::Create(&client_);
picture->SetBounds(gfx::Size(10, 10));
- picture->SetAnchorPoint(gfx::PointF());
picture->SetIsDrawable(true);
root->AddChild(picture);
diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc
index 7ef3c1f..abd5e4b 100644
--- a/cc/trees/layer_tree_host_unittest_delegated.cc
+++ b/cc/trees/layer_tree_host_unittest_delegated.cc
@@ -254,7 +254,6 @@ class LayerTreeHostDelegatedTestCaseSingleDelegatedLayer
virtual void SetupTree() OVERRIDE {
root_ = Layer::Create();
- root_->SetAnchorPoint(gfx::PointF());
root_->SetBounds(gfx::Size(15, 15));
layer_tree_host()->SetRootLayer(root_);
@@ -291,7 +290,6 @@ class LayerTreeHostDelegatedTestCaseSingleDelegatedLayer
DelegatedFrameProvider* frame_provider) {
scoped_refptr<DelegatedRendererLayer> delegated =
FakeDelegatedRendererLayer::Create(frame_provider);
- delegated->SetAnchorPoint(gfx::PointF());
delegated->SetBounds(gfx::Size(10, 10));
delegated->SetIsDrawable(true);
diff --git a/cc/trees/layer_tree_host_unittest_occlusion.cc b/cc/trees/layer_tree_host_unittest_occlusion.cc
index 352b5cf..cb6a5d3 100644
--- a/cc/trees/layer_tree_host_unittest_occlusion.cc
+++ b/cc/trees/layer_tree_host_unittest_occlusion.cc
@@ -95,8 +95,6 @@ class LayerTreeHostOcclusionTest : public LayerTreeTest {
layer->SetPosition(position);
layer->SetBounds(bounds);
layer->SetContentsOpaque(opaque);
-
- layer->SetAnchorPoint(gfx::PointF());
}
protected:
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 6d4fb52..05a5876 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -453,7 +453,6 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
root_scroll_layer_->SetBounds(gfx::Size(110, 110));
root_scroll_layer_->SetPosition(gfx::Point());
- root_scroll_layer_->SetAnchorPoint(gfx::PointF());
root_scroll_layer_->SetIsDrawable(true);
root_scroll_layer_->SetScrollClipLayerId(root_layer->id());
@@ -475,7 +474,6 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
// Adjust the child layer horizontally so that scrolls will never hit it.
child_layer_->SetPosition(gfx::Point(60, 5));
}
- child_layer_->SetAnchorPoint(gfx::PointF());
child_layer_->SetIsDrawable(true);
child_layer_->SetScrollClipLayerId(root_layer->id());
@@ -1209,7 +1207,6 @@ class LayerTreeHostScrollTestLayerStructureChange
ContentLayer::Create(&fake_content_layer_client_);
scroll_layer->SetBounds(gfx::Size(110, 110));
scroll_layer->SetPosition(gfx::Point(0, 0));
- scroll_layer->SetAnchorPoint(gfx::PointF());
scroll_layer->SetIsDrawable(true);
scroll_layer->SetScrollClipLayerId(parent->id());
scroll_layer->SetBounds(gfx::Size(parent->bounds().width() + 100,
diff --git a/cc/trees/layer_tree_host_unittest_video.cc b/cc/trees/layer_tree_host_unittest_video.cc
index 1941018..5484e4c 100644
--- a/cc/trees/layer_tree_host_unittest_video.cc
+++ b/cc/trees/layer_tree_host_unittest_video.cc
@@ -25,14 +25,12 @@ class LayerTreeHostVideoTestSetNeedsDisplay
virtual void SetupTree() OVERRIDE {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
- root->SetAnchorPoint(gfx::PointF());
root->SetIsDrawable(true);
scoped_refptr<VideoLayer> video = VideoLayer::Create(
&video_frame_provider_);
video->SetPosition(gfx::PointF(3.f, 3.f));
video->SetBounds(gfx::Size(4, 4));
- video->SetAnchorPoint(gfx::PointF());
video->SetIsDrawable(true);
root->AddChild(video);
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc
index 4a8259e..8db2b95 100644
--- a/cc/trees/layer_tree_impl_unittest.cc
+++ b/cc/trees/layer_tree_impl_unittest.cc
@@ -48,11 +48,16 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayer) {
LayerImpl::Create(host_impl().active_tree(), 12345);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
- SetLayerPropertiesForTesting(
- root.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(root.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
root->SetDrawsContent(true);
host_impl().SetViewportSize(root->bounds());
@@ -95,17 +100,27 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) {
HeadsUpDisplayLayerImpl::Create(host_impl().active_tree(), 11111);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
- SetLayerPropertiesForTesting(
- root.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(root.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
root->SetDrawsContent(true);
// Create hud and add it as a child of root.
gfx::Size hud_bounds(200, 200);
- SetLayerPropertiesForTesting(
- hud.get(), identity_matrix, anchor, position, hud_bounds, true, false);
+ SetLayerPropertiesForTesting(hud.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ hud_bounds,
+ true,
+ false);
hud->SetDrawsContent(true);
host_impl().active_tree()->set_hud_layer(hud.get());
@@ -157,12 +172,12 @@ TEST_F(LayerTreeImplTest, HitTestingForUninvertibleTransform) {
ASSERT_FALSE(uninvertible_transform.IsInvertible());
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
SetLayerPropertiesForTesting(root.get(),
uninvertible_transform,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -221,13 +236,18 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePositionedLayer) {
LayerImpl::Create(host_impl().active_tree(), 12345);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
// this layer is positioned, and hit testing should correctly know where the
// layer is located.
gfx::PointF position(50.f, 50.f);
gfx::Size bounds(100, 100);
- SetLayerPropertiesForTesting(
- root.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(root.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
root->SetDrawsContent(true);
host_impl().SetViewportSize(root->bounds());
@@ -274,12 +294,12 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleRotatedLayer) {
rotation45_degrees_about_center.Translate(50.0, 50.0);
rotation45_degrees_about_center.RotateAboutZAxis(45.0);
rotation45_degrees_about_center.Translate(-50.0, -50.0);
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
SetLayerPropertiesForTesting(root.get(),
rotation45_degrees_about_center,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -342,13 +362,13 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePerspectiveLayer) {
gfx::Transform translation_by_z;
translation_by_z.Translate3d(0.0, 0.0, -1.0);
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
SetLayerPropertiesForTesting(
root.get(),
perspective_projection_about_center * translation_by_z,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -405,11 +425,11 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerWithScaledContents) {
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- anchor,
+ transform_origin,
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -421,7 +441,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerWithScaledContents) {
LayerImpl::Create(host_impl().active_tree(), 12345);
SetLayerPropertiesForTesting(test_layer.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -484,12 +504,12 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) {
// and not the entire layer bounds. Here we just test the simple axis-aligned
// case.
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- anchor,
+ transform_origin,
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -503,7 +523,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) {
gfx::Size bounds(50, 50);
SetLayerPropertiesForTesting(clipping_layer.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -514,8 +534,13 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) {
LayerImpl::Create(host_impl().active_tree(), 456);
position = gfx::PointF(-50.f, -50.f);
bounds = gfx::Size(300, 300);
- SetLayerPropertiesForTesting(
- child.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child->SetDrawsContent(true);
clipping_layer->AddChild(child.Pass());
root->AddChild(clipping_layer.Pass());
@@ -574,11 +599,16 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
LayerImpl::Create(host_impl().active_tree(), 123);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
- SetLayerPropertiesForTesting(
- root.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(root.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
root->SetMasksToBounds(true);
{
scoped_ptr<LayerImpl> child =
@@ -590,8 +620,13 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
position = gfx::PointF(10.f, 10.f);
bounds = gfx::Size(80, 80);
- SetLayerPropertiesForTesting(
- child.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child->SetMasksToBounds(true);
gfx::Transform rotation45_degrees_about_corner;
@@ -604,7 +639,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
gfx::Size(200, 200); // to ensure it covers at least sqrt(2) * 100.
SetLayerPropertiesForTesting(grand_child.get(),
rotation45_degrees_about_corner,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -624,7 +659,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
bounds = gfx::Size(100, 100);
SetLayerPropertiesForTesting(rotated_leaf.get(),
rotated_leaf_transform,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -712,12 +747,12 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) {
// This test checks that hit testing code does not accidentally clip to layer
// bounds for a layer that actually does not clip.
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- anchor,
+ transform_origin,
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -731,7 +766,7 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) {
gfx::Size bounds(50, 50);
SetLayerPropertiesForTesting(intermediate_layer.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -747,8 +782,13 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) {
LayerImpl::Create(host_impl().active_tree(), 456);
position = gfx::PointF(60.f, 60.f); // 70, 70 in screen space
bounds = gfx::Size(20, 20);
- SetLayerPropertiesForTesting(
- child.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child->SetDrawsContent(true);
intermediate_layer->AddChild(child.Pass());
root->AddChild(intermediate_layer.Pass());
@@ -792,11 +832,16 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) {
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
- SetLayerPropertiesForTesting(
- root.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(root.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
root->SetDrawsContent(true);
{
// child 1 and child2 are initialized to overlap between x=50 and x=60.
@@ -814,14 +859,24 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) {
position = gfx::PointF(10.f, 10.f);
bounds = gfx::Size(50, 50);
- SetLayerPropertiesForTesting(
- child1.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child1.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child1->SetDrawsContent(true);
position = gfx::PointF(50.f, 10.f);
bounds = gfx::Size(50, 50);
- SetLayerPropertiesForTesting(
- child2.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child2.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child2->SetDrawsContent(true);
// Remember that grand_child is positioned with respect to its parent (i.e.
@@ -831,7 +886,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) {
bounds = gfx::Size(100, 50);
SetLayerPropertiesForTesting(grand_child1.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -916,11 +971,16 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) {
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
- SetLayerPropertiesForTesting(
- root.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(root.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
root->SetDrawsContent(true);
root->SetShouldFlattenTransform(false);
root->SetIs3dSorted(true);
@@ -940,8 +1000,13 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) {
position = gfx::PointF(10.f, 10.f);
bounds = gfx::Size(50, 50);
- SetLayerPropertiesForTesting(
- child1.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child1.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child1->SetDrawsContent(true);
child1->SetShouldFlattenTransform(false);
child1->SetIs3dSorted(true);
@@ -950,8 +1015,13 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) {
bounds = gfx::Size(50, 50);
gfx::Transform translate_z;
translate_z.Translate3d(0, 0, -10.f);
- SetLayerPropertiesForTesting(
- child2.get(), translate_z, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child2.get(),
+ translate_z,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child2->SetDrawsContent(true);
child2->SetShouldFlattenTransform(false);
child2->SetIs3dSorted(true);
@@ -963,7 +1033,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) {
bounds = gfx::Size(100, 50);
SetLayerPropertiesForTesting(grand_child1.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -1055,11 +1125,16 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) {
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
- SetLayerPropertiesForTesting(
- root.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(root.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
root->SetDrawsContent(true);
{
// child 1 and child2 are initialized to overlap between x=50 and x=60.
@@ -1077,15 +1152,25 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) {
position = gfx::PointF(10.f, 10.f);
bounds = gfx::Size(50, 50);
- SetLayerPropertiesForTesting(
- child1.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child1.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child1->SetDrawsContent(true);
child1->SetForceRenderSurface(true);
position = gfx::PointF(50.f, 10.f);
bounds = gfx::Size(50, 50);
- SetLayerPropertiesForTesting(
- child2.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child2.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child2->SetDrawsContent(true);
child2->SetForceRenderSurface(true);
@@ -1096,7 +1181,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) {
bounds = gfx::Size(100, 50);
SetLayerPropertiesForTesting(grand_child1.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -1191,11 +1276,16 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) {
gfx::Transform identity_matrix;
Region touch_handler_region(gfx::Rect(10, 10, 50, 50));
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
- SetLayerPropertiesForTesting(
- root.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(root.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
root->SetDrawsContent(true);
host_impl().SetViewportSize(root->bounds());
@@ -1274,12 +1364,12 @@ TEST_F(LayerTreeImplTest,
gfx::Transform identity_matrix;
Region touch_handler_region(gfx::Rect(10, 10, 50, 50));
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
gfx::PointF position;
gfx::Size bounds(100, 100);
SetLayerPropertiesForTesting(root.get(),
uninvertible_transform,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -1350,13 +1440,18 @@ TEST_F(LayerTreeImplTest,
gfx::Transform identity_matrix;
Region touch_handler_region(gfx::Rect(10, 10, 50, 50));
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
// this layer is positioned, and hit testing should correctly know where the
// layer is located.
gfx::PointF position(50.f, 50.f);
gfx::Size bounds(100, 100);
- SetLayerPropertiesForTesting(
- root.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(root.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
root->SetDrawsContent(true);
root->SetTouchEventHandlerRegion(touch_handler_region);
@@ -1424,11 +1519,11 @@ TEST_F(LayerTreeImplTest,
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- anchor,
+ transform_origin,
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -1441,7 +1536,7 @@ TEST_F(LayerTreeImplTest,
LayerImpl::Create(host_impl().active_tree(), 12345);
SetLayerPropertiesForTesting(test_layer.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -1528,11 +1623,11 @@ TEST_F(LayerTreeImplTest,
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
// Set the bounds of the root layer big enough to fit the child when scaled.
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- anchor,
+ transform_origin,
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -1545,7 +1640,7 @@ TEST_F(LayerTreeImplTest,
LayerImpl::Create(host_impl().active_tree(), 12345);
SetLayerPropertiesForTesting(test_layer.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -1651,12 +1746,12 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) {
// and not the entire layer bounds. Here we just test the simple axis-aligned
// case.
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- anchor,
+ transform_origin,
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -1670,7 +1765,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) {
gfx::Size bounds(50, 50);
SetLayerPropertiesForTesting(clipping_layer.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -1682,8 +1777,13 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) {
Region touch_handler_region(gfx::Rect(10, 10, 50, 50));
position = gfx::PointF(-50.f, -50.f);
bounds = gfx::Size(300, 300);
- SetLayerPropertiesForTesting(
- child.get(), identity_matrix, anchor, position, bounds, true, false);
+ SetLayerPropertiesForTesting(child.get(),
+ identity_matrix,
+ transform_origin,
+ position,
+ bounds,
+ true,
+ false);
child->SetDrawsContent(true);
child->SetTouchEventHandlerRegion(touch_handler_region);
clipping_layer->AddChild(child.Pass());
@@ -1741,12 +1841,12 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) {
TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) {
gfx::Transform identity_matrix;
- gfx::PointF anchor;
+ gfx::Point3F transform_origin;
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
- anchor,
+ transform_origin,
gfx::PointF(),
gfx::Size(100, 100),
true,
@@ -1760,7 +1860,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) {
gfx::Size bounds(50, 50);
SetLayerPropertiesForTesting(touch_layer.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
@@ -1779,7 +1879,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) {
gfx::Size bounds(50, 50);
SetLayerPropertiesForTesting(notouch_layer.get(),
identity_matrix,
- anchor,
+ transform_origin,
position,
bounds,
true,
diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc
index 4687dab..6ce2781 100644
--- a/cc/trees/occlusion_tracker_unittest.cc
+++ b/cc/trees/occlusion_tracker_unittest.cc
@@ -393,7 +393,6 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test {
const gfx::PointF& position,
const gfx::Size& bounds) {
layer->SetTransform(transform);
- layer->SetAnchorPoint(gfx::PointF());
layer->SetPosition(position);
layer->SetBounds(bounds);
}
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index b511e6d..51b8e66 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -88,7 +88,6 @@ Compositor::Compositor(gfx::AcceleratedWidget widget,
layer_animator_collection_(this),
schedule_draw_factory_(this) {
root_web_layer_ = cc::Layer::Create();
- root_web_layer_->SetAnchorPoint(gfx::PointF(0.f, 0.f));
CommandLine* command_line = CommandLine::ForCurrentProcess();
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index d57cc3b..17ab899 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -497,7 +497,7 @@ void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) {
cc_layer_->AddChild(children_[i]->cc_layer_);
}
cc_layer_->SetLayerClient(this);
- cc_layer_->SetAnchorPoint(gfx::PointF());
+ cc_layer_->SetTransformOrigin(gfx::Point3F());
cc_layer_->SetContentsOpaque(fills_bounds_opaquely_);
cc_layer_->SetForceRenderSurface(force_render_surface_);
cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
@@ -929,7 +929,7 @@ void Layer::CreateWebLayer() {
content_layer_ = cc::ContentLayer::Create(this);
cc_layer_ = content_layer_.get();
}
- cc_layer_->SetAnchorPoint(gfx::PointF());
+ cc_layer_->SetTransformOrigin(gfx::Point3F());
cc_layer_->SetContentsOpaque(true);
cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
cc_layer_->AddLayerAnimationEventObserver(this);
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index 9c4b8a0..cf36ad2 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -674,7 +674,7 @@ TEST_F(LayerWithNullDelegateTest, SwitchLayerPreservesCCLayerState) {
l1->SetVisible(false);
EXPECT_EQ(gfx::PointF().ToString(),
- l1->cc_layer()->anchor_point().ToString());
+ l1->cc_layer()->transform_origin().ToString());
EXPECT_TRUE(l1->cc_layer()->DrawsContent());
EXPECT_TRUE(l1->cc_layer()->contents_opaque());
EXPECT_TRUE(l1->cc_layer()->force_render_surface());
@@ -692,7 +692,7 @@ TEST_F(LayerWithNullDelegateTest, SwitchLayerPreservesCCLayerState) {
EXPECT_NE(before_layer, l1->cc_layer());
EXPECT_EQ(gfx::PointF().ToString(),
- l1->cc_layer()->anchor_point().ToString());
+ l1->cc_layer()->transform_origin().ToString());
EXPECT_TRUE(l1->cc_layer()->DrawsContent());
EXPECT_TRUE(l1->cc_layer()->contents_opaque());
EXPECT_TRUE(l1->cc_layer()->force_render_surface());
@@ -710,7 +710,7 @@ TEST_F(LayerWithNullDelegateTest, SwitchLayerPreservesCCLayerState) {
l1->SetShowPaintedContent();
EXPECT_EQ(gfx::PointF().ToString(),
- l1->cc_layer()->anchor_point().ToString());
+ l1->cc_layer()->transform_origin().ToString());
EXPECT_TRUE(l1->cc_layer()->DrawsContent());
EXPECT_TRUE(l1->cc_layer()->contents_opaque());
EXPECT_TRUE(l1->cc_layer()->force_render_surface());
diff --git a/webkit/renderer/compositor_bindings/web_layer_impl.cc b/webkit/renderer/compositor_bindings/web_layer_impl.cc
index bd1c772..7a39fe0 100644
--- a/webkit/renderer/compositor_bindings/web_layer_impl.cc
+++ b/webkit/renderer/compositor_bindings/web_layer_impl.cc
@@ -96,20 +96,6 @@ void WebLayerImpl::removeFromParent() { layer_->RemoveFromParent(); }
void WebLayerImpl::removeAllChildren() { layer_->RemoveAllChildren(); }
-void WebLayerImpl::setAnchorPoint(const WebFloatPoint& anchor_point) {
- layer_->SetAnchorPoint(anchor_point);
-}
-
-WebFloatPoint WebLayerImpl::anchorPoint() const {
- return layer_->anchor_point();
-}
-
-void WebLayerImpl::setAnchorPointZ(float anchor_point_z) {
- layer_->SetAnchorPointZ(anchor_point_z);
-}
-
-float WebLayerImpl::anchorPointZ() const { return layer_->anchor_point_z(); }
-
void WebLayerImpl::setBounds(const WebSize& size) { layer_->SetBounds(size); }
WebSize WebLayerImpl::bounds() const { return layer_->bounds(); }
@@ -166,6 +152,27 @@ void WebLayerImpl::setTransform(const SkMatrix44& matrix) {
layer_->SetTransform(transform);
}
+void WebLayerImpl::setTransformOrigin(const blink::WebFloatPoint3D& point) {
+ gfx::Point3F gfx_point = point;
+ layer_->SetTransformOrigin(gfx_point);
+}
+
+blink::WebFloatPoint3D WebLayerImpl::transformOrigin() const {
+ return layer_->transform_origin();
+}
+
+void WebLayerImpl::setAnchorPoint(const blink::WebFloatPoint&) {}
+
+blink::WebFloatPoint WebLayerImpl::anchorPoint() const {
+ return blink::WebFloatPoint();
+}
+
+void WebLayerImpl::setAnchorPointZ(float) {}
+
+float WebLayerImpl::anchorPointZ() const {
+ return 0.f;
+};
+
SkMatrix44 WebLayerImpl::transform() const {
return layer_->transform().matrix();
}
diff --git a/webkit/renderer/compositor_bindings/web_layer_impl.h b/webkit/renderer/compositor_bindings/web_layer_impl.h
index 4e46e30..f567dd6 100644
--- a/webkit/renderer/compositor_bindings/web_layer_impl.h
+++ b/webkit/renderer/compositor_bindings/web_layer_impl.h
@@ -64,10 +64,6 @@ class WebLayerImpl : public blink::WebLayer, public cc::LayerClient {
blink::WebLayer* new_layer);
virtual void removeFromParent();
virtual void removeAllChildren();
- virtual void setAnchorPoint(const blink::WebFloatPoint&);
- virtual blink::WebFloatPoint anchorPoint() const;
- virtual void setAnchorPointZ(float anchor_point_z);
- virtual float anchorPointZ() const;
virtual void setBounds(const blink::WebSize& bounds);
virtual blink::WebSize bounds() const;
virtual void setMasksToBounds(bool masks_to_bounds);
@@ -85,6 +81,15 @@ class WebLayerImpl : public blink::WebLayer, public cc::LayerClient {
virtual void setPosition(const blink::WebFloatPoint& position);
virtual blink::WebFloatPoint position() const;
virtual void setTransform(const SkMatrix44& transform);
+ virtual void setTransformOrigin(const blink::WebFloatPoint3D& point);
+ virtual blink::WebFloatPoint3D transformOrigin() const;
+
+ // FIXME: get rid of these once Blink is no longer using them.
+ virtual void setAnchorPoint(const blink::WebFloatPoint&);
+ virtual blink::WebFloatPoint anchorPoint() const;
+ virtual void setAnchorPointZ(float);
+ virtual float anchorPointZ() const ;
+
virtual SkMatrix44 transform() const;
virtual void setDrawsContent(bool draws_content);
virtual bool drawsContent() const;
diff --git a/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.cc b/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.cc
index ec6d743..134ce40 100644
--- a/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.cc
+++ b/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.cc
@@ -30,10 +30,10 @@ void WebLayerImplFixedBounds::invalidateRect(const blink::WebFloatRect& rect) {
invalidate();
}
-void WebLayerImplFixedBounds::setAnchorPoint(
- const blink::WebFloatPoint& anchor_point) {
- if (anchor_point != this->anchorPoint()) {
- layer_->SetAnchorPoint(anchor_point);
+void WebLayerImplFixedBounds::setTransformOrigin(
+ const blink::WebFloatPoint3D& transform_origin) {
+ if (transform_origin != this->transformOrigin()) {
+ layer_->SetTransformOrigin(transform_origin);
UpdateLayerBoundsAndTransform();
}
}
@@ -77,9 +77,10 @@ void WebLayerImplFixedBounds::SetTransformInternal(
void WebLayerImplFixedBounds::UpdateLayerBoundsAndTransform() {
if (fixed_bounds_.IsEmpty() || original_bounds_.IsEmpty() ||
fixed_bounds_ == original_bounds_ ||
- // For now fall back to non-fixed bounds for non-zero anchor point.
+ // For now fall back to non-fixed bounds for non-zero transform origin.
// TODO(wangxianzhu): Support non-zero anchor point for fixed bounds.
- anchorPoint().x || anchorPoint().y) {
+ transformOrigin().x ||
+ transformOrigin().y) {
layer_->SetBounds(original_bounds_);
layer_->SetTransform(original_transform_);
return;
diff --git a/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.h b/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.h
index f338cde..fbd709d 100644
--- a/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.h
+++ b/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.h
@@ -25,7 +25,8 @@ class WebLayerImplFixedBounds : public WebLayerImpl {
// WebLayerImpl overrides.
virtual void invalidateRect(const blink::WebFloatRect& rect);
- virtual void setAnchorPoint(const blink::WebFloatPoint& anchor_point);
+ virtual void setTransformOrigin(
+ const blink::WebFloatPoint3D& transform_origin);
virtual void setBounds(const blink::WebSize& bounds);
virtual blink::WebSize bounds() const;
virtual void setTransform(const SkMatrix44& transform);