提交 502430f9 编写于 作者: M Matt Perry

Fix bustage from my previous CL: "Color.fromARGB" becomes "new Color.fromARGB".

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1184523002.
上级 b164b86e
......@@ -53,7 +53,7 @@ class Sprite extends NodeWithSize {
// Setup paint object for opacity and transfer mode
Paint paint = new Paint();
paint.color = Color.fromARGB((255.0*_opacity).toInt(), 255, 255, 255);
paint.color = new Color.fromARGB((255.0*_opacity).toInt(), 255, 255, 255);
if (colorOverlay != null) {
paint.setColorFilter(new ColorFilter.mode(colorOverlay, TransferMode.srcATopMode));
}
......@@ -66,7 +66,7 @@ class Sprite extends NodeWithSize {
else {
// Paint a red square for missing texture
canvas.drawRect(new Rect.fromLTRB(0.0, 0.0, size.width, size.height),
new Paint()..color = Color.fromARGB(255, 255, 0, 0));
new Paint()..color = const Color.fromARGB(255, 255, 0, 0));
}
canvas.restore();
}
......
......@@ -14,7 +14,7 @@ void main() {
var element = document.getElementById('canvas');
element.requestPaint((PaintingContext context) {
Paint paint = new Paint();
paint.color = Color.fromARGB(128, 0, 255, 0);
paint.color = const Color.fromARGB(128, 0, 255, 0);
double radius = math.min(context.width, context.height) / 2.0;
context.drawCircle(context.width / 2.0, context.height / 2.0, radius, paint);
context.commit();
......
......@@ -9,7 +9,7 @@ void main() {
PictureRecorder recorder = new PictureRecorder(width, height);
double radius = min(width, height) * 0.45;
Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0);
Paint paint = new Paint()..color = const Color.fromARGB(255, 0, 255, 0);
recorder.drawCircle(width / 2, height / 2, radius, paint);
......
......@@ -15,7 +15,7 @@ void main() {
Picture stamp = stampRecorder.endRecording();
PictureRecorder recorder = new PictureRecorder(width, height);
Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0);
Paint paint = new Paint()..color = const Color.fromARGB(255, 0, 255, 0);
recorder.drawCircle(50.0, 50.0, 50.0, paint);
recorder.translate(10.0, 10.0);
recorder.drawPicture(stamp);
......
......@@ -12,7 +12,7 @@ Picture draw(int a, int r, int g, int b) {
PictureRecorder recorder = new PictureRecorder(width, height);
double radius = min(width, height) * 0.45;
Paint paint = new Paint()..color = Color.fromARGB(a, r, g, b);
Paint paint = new Paint()..color = new Color.fromARGB(a, r, g, b);
recorder.drawCircle(width / 2, height / 2, radius, paint);
return recorder.endRecording();
}
......
......@@ -11,7 +11,7 @@ void main() {
double width = window.innerWidth.toDouble();
double height = window.innerHeight.toDouble();
PictureRecorder recorder = new PictureRecorder(width, height);
Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0);
Paint paint = new Paint()..color = const Color.fromARGB(255, 0, 255, 0);
recorder.drawCircle(50.0, 50.0, 50.0, paint);
recorder.translate(10.0, 10.0);
root.paint(recorder);
......
......@@ -16,7 +16,7 @@ void beginFrame(double timeStamp) {
canvas.translate(view.width / 2.0, view.height / 2.0);
canvas.rotate(math.PI * delta / 1800);
canvas.drawRect(new Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
new Paint()..color = Color.fromARGB(255, 0, 255, 0));
new Paint()..color = const Color.fromARGB(255, 0, 255, 0));
double sin = math.sin(delta / 200);
layoutRoot.maxWidth = 150.0 + (50 * sin);
......
......@@ -19,7 +19,7 @@ void beginFrame(double timeStamp) {
canvas.translate(view.width / 2.0, view.height / 2.0);
canvas.rotate(math.PI * delta / 1800);
canvas.scale(0.2, 0.2);
Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0);
Paint paint = new Paint()..color = const Color.fromARGB(255, 0, 255, 0);
if (image != null)
canvas.drawImage(image, -image.width / 2.0, -image.height / 2.0, paint);
view.picture = canvas.endRecording();
......
......@@ -16,7 +16,7 @@ void beginFrame(double timeStamp) {
canvas.translate(view.width / 2.0, view.height / 2.0);
canvas.rotate(math.PI * delta / 1800);
canvas.drawRect(new Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
new Paint()..color = Color.fromARGB(255, 0, 255, 0));
new Paint()..color = const Color.fromARGB(255, 0, 255, 0));
view.picture = canvas.endRecording();
view.scheduleFrame();
tracing.end('beginFrame');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册