mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

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
27 lines
650 B
Dart
27 lines
650 B
Dart
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// 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");
|
|
|
|
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();
|
|
}
|