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

Unified Diff: ui/gfx/transform.h

Issue 2585263003: Avoid overflow when checking if a transform is integer translation. (Closed)
Patch Set: integer-transform Created 4 years 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 | ui/gfx/transform.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/transform.h
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 469f6e03c38c695f86cea1fa284300e82687f296..a942bd6c2a2f8d53add0927c26fb0b6445aa22bf 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -140,8 +140,10 @@ class GFX_EXPORT Transform {
matrix_.get(2, 2) > 0.0;
}
- // Returns true if the matrix is either identity or pure, non-fractional
- // translation.
+ // Returns true if the matrix is identity or, if the matrix consists only
+ // of a translation whose components can be represented as integers. Returns
+ // false if the translation contains a fractional component or is too large to
+ // fit in an integer.
bool IsIdentityOrIntegerTranslation() const;
// Returns true if the matrix had only scaling components.
« no previous file with comments | « no previous file | ui/gfx/transform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698