From 0b18d56d5a94c0737b74e5a0d1c80bfeb9ee284b Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 19 May 2015 14:20:04 -0700 Subject: [PATCH] Teach SkyView path to draw a circle This CL adds a global view object that can receive a Picture and be signaled to draw. When using SkyView, this Picture shows up on screen. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1134913003 --- examples/raw/hello_world.dart | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/examples/raw/hello_world.dart b/examples/raw/hello_world.dart index cbf03f0784..52cfc50c4f 100644 --- a/examples/raw/hello_world.dart +++ b/examples/raw/hello_world.dart @@ -2,6 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import "dart:math"; +import 'dart:sky'; + void main() { - print("Hello, world"); + print("Hello, world"); + + double width = 500.0; + double height = 500.0; + + PictureRecorder recorder = new PictureRecorder(width, height); + double radius = min(width, height) * 0.45; + + Paint paint = new Paint()..setARGB(255, 0, 255, 0); + + recorder.drawCircle(width / 2, height / 2, radius, paint); + + print("Storing picture"); + view.picture = recorder.endRecording(); + + print("Scheduling paint"); + view.schedulePaint(); }