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

Unified Diff: ui/views/view.h

Issue 375693006: Snap layers in views to physical pixel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use cc::MathUtil::Round instead Created 6 years, 5 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
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 1bdee37cdbbaf3360fe8673a4ed79e3afcd9746b..5caf06fdff9348586d00bc2c7c2d59d167cf8455 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -380,6 +380,10 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
LayoutManager* GetLayoutManager() const;
void SetLayoutManager(LayoutManager* layout);
+ // Adjust the layer's offset so that it snaps to the physical pixel boundary.
+ // This has no effect if the view does not have an associated layer.
+ void SnapLayerToPixelBoundary();
+
// Attributes ----------------------------------------------------------------
// The view class name.
@@ -1526,6 +1530,9 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Views. The default is absolute positioning according to bounds_.
scoped_ptr<LayoutManager> layout_manager_;
+ // Whether this View's layer should be snapped to the pixel boundary.
+ bool snap_layer_to_pixel_boundary_;
+
// Painting ------------------------------------------------------------------
// Background

Powered by Google App Engine
This is Rietveld 408576698