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

Unified Diff: ui/compositor/layer.cc

Issue 317633006: Move SnapToPhysicalPixelBoundary call to RWHVA::InternalSetBounds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 17ab8993305a0c0c5b0c49879f7185ba785ce29d..150e1efe5e0633c1e663f59cb73102f86b0d908c 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -243,6 +243,11 @@ void Layer::SetBounds(const gfx::Rect& bounds) {
GetAnimator()->SetBounds(bounds);
}
+void Layer::SetSubpixelPositionOffset(const gfx::Vector2dF offset) {
+ subpixel_position_offset_ = offset;
+ RecomputePosition();
+}
+
gfx::Rect Layer::GetTargetBounds() const {
if (animator_.get() && animator_->IsAnimatingProperty(
LayerAnimationElement::BOUNDS)) {
@@ -959,7 +964,7 @@ void Layer::RecomputeDrawsContentAndUVRect() {
}
void Layer::RecomputePosition() {
- cc_layer_->SetPosition(gfx::PointF(bounds_.x(), bounds_.y()));
+ cc_layer_->SetPosition(bounds_.origin() + subpixel_position_offset_);
}
void Layer::AddAnimatorsInTreeToCollection(
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698