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

Unified Diff: content/browser/android/edge_effect.cc

Issue 319183011: [Android] Use SetTransformOrigin for glow-effect layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/edge_effect.cc
diff --git a/content/browser/android/edge_effect.cc b/content/browser/android/edge_effect.cc
index a23dff89e3c1a3f3d2bbfe6a0ad936687a4bc938..94e5b512e20505bf5ad12c59f9258e88f9fa41b1 100644
--- a/content/browser/android/edge_effect.cc
+++ b/content/browser/android/edge_effect.cc
@@ -133,8 +133,11 @@ void UpdateLayer(cc::Layer* layer,
float opacity) {
DCHECK(layer);
layer->SetIsDrawable(true);
+ gfx::Size bounds = ComputeBounds(edge, window_size, height);
+ layer->SetTransformOrigin(
+ gfx::Point3F(bounds.width() * 0.5f, bounds.height() * 0.5f, 0));
layer->SetTransform(ComputeTransform(edge, window_size, offset, height));
- layer->SetBounds(ComputeBounds(edge, window_size, height));
+ layer->SetBounds(bounds);
layer->SetOpacity(Clamp(opacity, 0.f, 1.f));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698