diff --git a/engine/core/painting/Paint.h b/engine/core/painting/Paint.h index f5df0440169..6d3451ae3fb 100644 --- a/engine/core/painting/Paint.h +++ b/engine/core/painting/Paint.h @@ -38,10 +38,6 @@ public: SkScalar strokeWidth() const { return m_paint.getStrokeWidth(); } void setStrokeWidth(SkScalar strokeWidth) { m_paint.setStrokeWidth(strokeWidth); } - void setARGB(unsigned a, unsigned r, unsigned g, unsigned b) - { - m_paint.setARGB(a, r, g, b); - } void setDrawLooper(DrawLooper* looper); void setColorFilter(ColorFilter* filter); void setMaskFilter(MaskFilter* filter); diff --git a/engine/core/painting/Paint.idl b/engine/core/painting/Paint.idl index 2f239df4561..ead34315235 100644 --- a/engine/core/painting/Paint.idl +++ b/engine/core/painting/Paint.idl @@ -9,8 +9,6 @@ attribute boolean isAntiAlias; attribute Color color; - // TODO(mpcomplete): remove this in favor of assigning to |color|. - void setARGB(unsigned long a, unsigned long r, unsigned long g, unsigned long b); void setDrawLooper(DrawLooper looper); void setColorFilter(ColorFilter filter); void setMaskFilter(MaskFilter filter); diff --git a/examples/game/lib/sprite.dart b/examples/game/lib/sprite.dart index 5a4efba1106..2ddbbfdc6a4 100644 --- a/examples/game/lib/sprite.dart +++ b/examples/game/lib/sprite.dart @@ -53,7 +53,7 @@ class Sprite extends NodeWithSize { // Setup paint object for opacity and transfer mode Paint paint = new Paint(); - paint.setARGB((255.0*_opacity).toInt(), 255, 255, 255); + paint.color = 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()..setARGB(255, 255, 0, 0)); + new Paint()..color = Color.fromARGB(255, 255, 0, 0)); } canvas.restore(); } diff --git a/examples/raw/circle.sky b/examples/raw/circle.sky index 224e2d92559..c5818c6aec6 100644 --- a/examples/raw/circle.sky +++ b/examples/raw/circle.sky @@ -14,7 +14,7 @@ void main() { var element = document.getElementById('canvas'); element.requestPaint((PaintingContext context) { Paint paint = new Paint(); - paint.setARGB(128, 0, 255, 0); + paint.color = 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(); diff --git a/examples/raw/custom_paint_without_element.sky b/examples/raw/custom_paint_without_element.sky index d18611070ed..72a6c2f41db 100644 --- a/examples/raw/custom_paint_without_element.sky +++ b/examples/raw/custom_paint_without_element.sky @@ -9,7 +9,7 @@ void main() { PictureRecorder recorder = new PictureRecorder(width, height); double radius = min(width, height) * 0.45; - Paint paint = new Paint()..setARGB(255, 0, 255, 0); + Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0); recorder.drawCircle(width / 2, height / 2, radius, paint); diff --git a/examples/raw/draw_picture_into_canvas.sky b/examples/raw/draw_picture_into_canvas.sky index 95f9ca19926..6b8024d9ba1 100644 --- a/examples/raw/draw_picture_into_canvas.sky +++ b/examples/raw/draw_picture_into_canvas.sky @@ -15,7 +15,7 @@ void main() { Picture stamp = stampRecorder.endRecording(); PictureRecorder recorder = new PictureRecorder(width, height); - Paint paint = new Paint()..setARGB(255, 0, 255, 0); + Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0); recorder.drawCircle(50.0, 50.0, 50.0, paint); recorder.translate(10.0, 10.0); recorder.drawPicture(stamp); diff --git a/examples/raw/hello_world.dart b/examples/raw/hello_world.dart index 61079b5927d..7e8e342bf2b 100644 --- a/examples/raw/hello_world.dart +++ b/examples/raw/hello_world.dart @@ -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()..setARGB(a, r, g, b); + Paint paint = new Paint()..color = Color.fromARGB(a, r, g, b); recorder.drawCircle(width / 2, height / 2, radius, paint); return recorder.endRecording(); } diff --git a/examples/raw/paint_element_into_displaylist.sky b/examples/raw/paint_element_into_displaylist.sky index c684836d0cd..1196436fb5c 100644 --- a/examples/raw/paint_element_into_displaylist.sky +++ b/examples/raw/paint_element_into_displaylist.sky @@ -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()..setARGB(255, 0, 255, 0); + Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0); recorder.drawCircle(50.0, 50.0, 50.0, paint); recorder.translate(10.0, 10.0); root.paint(recorder); diff --git a/examples/raw/spinning_arabic.dart b/examples/raw/spinning_arabic.dart index 25dea114028..29f2bfcb62d 100644 --- a/examples/raw/spinning_arabic.dart +++ b/examples/raw/spinning_arabic.dart @@ -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()..setARGB(255, 0, 255, 0)); + new Paint()..color = Color.fromARGB(255, 0, 255, 0)); double sin = math.sin(delta / 200); layoutRoot.maxWidth = 150.0 + (50 * sin); diff --git a/examples/raw/spinning_image.dart b/examples/raw/spinning_image.dart index cdbf7f67820..87ca8be6141 100644 --- a/examples/raw/spinning_image.dart +++ b/examples/raw/spinning_image.dart @@ -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()..setARGB(255, 0, 255, 0); + Paint paint = new Paint()..color = 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(); diff --git a/examples/raw/spinning_square.dart b/examples/raw/spinning_square.dart index 97c3c7ab413..5613248e4bd 100644 --- a/examples/raw/spinning_square.dart +++ b/examples/raw/spinning_square.dart @@ -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()..setARGB(255, 0, 255, 0)); + new Paint()..color = Color.fromARGB(255, 0, 255, 0)); view.picture = canvas.endRecording(); view.scheduleFrame(); tracing.end('beginFrame');