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

Unified Diff: sky/engine/core/painting/Color.dart

Issue 1179413008: If Color constructor is passed a value > 0xFFFFFFFF, Sky crashes (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Now with tests Created 5 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 | sky/tests/raw/color_bounds.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/Color.dart
diff --git a/sky/engine/core/painting/Color.dart b/sky/engine/core/painting/Color.dart
index 65ed9be1db6cabc6fce24b5d471c2dc9def783db..266145ec18e7082d971a4d4dc9c508d2ba135c78 100644
--- a/sky/engine/core/painting/Color.dart
+++ b/sky/engine/core/painting/Color.dart
@@ -5,12 +5,12 @@
part of dart.sky;
class Color {
- const Color(this._value);
+ const Color(int value) : _value = (value & 0xFFFFFFFF);
const Color.fromARGB(int a, int r, int g, int b) :
- _value = (((a & 0xff) << 24) |
- ((r & 0xff) << 16) |
- ((g & 0xff) << 8) |
- ((b & 0xff) << 0));
+ _value = ((((a & 0xff) << 24) |
+ ((r & 0xff) << 16) |
+ ((g & 0xff) << 8) |
+ ((b & 0xff) << 0)) & 0xFFFFFFFF);
final int _value;
int get value => _value;
« no previous file with comments | « no previous file | sky/tests/raw/color_bounds.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698