Fix bustage from my previous CL: "Color.fromARGB" becomes "new Color.fromARGB".
R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1184523002.
This commit is contained in:
@@ -53,7 +53,7 @@ class Sprite extends NodeWithSize {
|
|||||||
|
|
||||||
// Setup paint object for opacity and transfer mode
|
// Setup paint object for opacity and transfer mode
|
||||||
Paint paint = new Paint();
|
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) {
|
if (colorOverlay != null) {
|
||||||
paint.setColorFilter(new ColorFilter.mode(colorOverlay, TransferMode.srcATopMode));
|
paint.setColorFilter(new ColorFilter.mode(colorOverlay, TransferMode.srcATopMode));
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ class Sprite extends NodeWithSize {
|
|||||||
else {
|
else {
|
||||||
// Paint a red square for missing texture
|
// Paint a red square for missing texture
|
||||||
canvas.drawRect(new Rect.fromLTRB(0.0, 0.0, size.width, size.height),
|
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();
|
canvas.restore();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ void main() {
|
|||||||
var element = document.getElementById('canvas');
|
var element = document.getElementById('canvas');
|
||||||
element.requestPaint((PaintingContext context) {
|
element.requestPaint((PaintingContext context) {
|
||||||
Paint paint = new Paint();
|
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;
|
double radius = math.min(context.width, context.height) / 2.0;
|
||||||
context.drawCircle(context.width / 2.0, context.height / 2.0, radius, paint);
|
context.drawCircle(context.width / 2.0, context.height / 2.0, radius, paint);
|
||||||
context.commit();
|
context.commit();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ void main() {
|
|||||||
PictureRecorder recorder = new PictureRecorder(width, height);
|
PictureRecorder recorder = new PictureRecorder(width, height);
|
||||||
double radius = min(width, height) * 0.45;
|
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);
|
recorder.drawCircle(width / 2, height / 2, radius, paint);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ void main() {
|
|||||||
Picture stamp = stampRecorder.endRecording();
|
Picture stamp = stampRecorder.endRecording();
|
||||||
|
|
||||||
PictureRecorder recorder = new PictureRecorder(width, height);
|
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.drawCircle(50.0, 50.0, 50.0, paint);
|
||||||
recorder.translate(10.0, 10.0);
|
recorder.translate(10.0, 10.0);
|
||||||
recorder.drawPicture(stamp);
|
recorder.drawPicture(stamp);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Picture draw(int a, int r, int g, int b) {
|
|||||||
PictureRecorder recorder = new PictureRecorder(width, height);
|
PictureRecorder recorder = new PictureRecorder(width, height);
|
||||||
double radius = min(width, height) * 0.45;
|
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);
|
recorder.drawCircle(width / 2, height / 2, radius, paint);
|
||||||
return recorder.endRecording();
|
return recorder.endRecording();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ void main() {
|
|||||||
double width = window.innerWidth.toDouble();
|
double width = window.innerWidth.toDouble();
|
||||||
double height = window.innerHeight.toDouble();
|
double height = window.innerHeight.toDouble();
|
||||||
PictureRecorder recorder = new PictureRecorder(width, height);
|
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.drawCircle(50.0, 50.0, 50.0, paint);
|
||||||
recorder.translate(10.0, 10.0);
|
recorder.translate(10.0, 10.0);
|
||||||
root.paint(recorder);
|
root.paint(recorder);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void beginFrame(double timeStamp) {
|
|||||||
canvas.translate(view.width / 2.0, view.height / 2.0);
|
canvas.translate(view.width / 2.0, view.height / 2.0);
|
||||||
canvas.rotate(math.PI * delta / 1800);
|
canvas.rotate(math.PI * delta / 1800);
|
||||||
canvas.drawRect(new Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
|
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);
|
double sin = math.sin(delta / 200);
|
||||||
layoutRoot.maxWidth = 150.0 + (50 * sin);
|
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.translate(view.width / 2.0, view.height / 2.0);
|
||||||
canvas.rotate(math.PI * delta / 1800);
|
canvas.rotate(math.PI * delta / 1800);
|
||||||
canvas.scale(0.2, 0.2);
|
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)
|
if (image != null)
|
||||||
canvas.drawImage(image, -image.width / 2.0, -image.height / 2.0, paint);
|
canvas.drawImage(image, -image.width / 2.0, -image.height / 2.0, paint);
|
||||||
view.picture = canvas.endRecording();
|
view.picture = canvas.endRecording();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void beginFrame(double timeStamp) {
|
|||||||
canvas.translate(view.width / 2.0, view.height / 2.0);
|
canvas.translate(view.width / 2.0, view.height / 2.0);
|
||||||
canvas.rotate(math.PI * delta / 1800);
|
canvas.rotate(math.PI * delta / 1800);
|
||||||
canvas.drawRect(new Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
|
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.picture = canvas.endRecording();
|
||||||
view.scheduleFrame();
|
view.scheduleFrame();
|
||||||
tracing.end('beginFrame');
|
tracing.end('beginFrame');
|
||||||
|
|||||||
Reference in New Issue
Block a user