Index: sky/examples/raw/spinning_image.dart |
diff --git a/sky/examples/raw/spinning_image.dart b/sky/examples/raw/spinning_image.dart |
index a50f4c36f8c34e2801ed5530bf0cfa180733df2d..101c17ada2cbd73ed39b738b5795db5e5b85aedc 100644 |
--- a/sky/examples/raw/spinning_image.dart |
+++ b/sky/examples/raw/spinning_image.dart |
@@ -4,6 +4,7 @@ |
import 'dart:math' as math; |
import 'dart:sky'; |
+ |
import 'package:sky/mojo/net/image_cache.dart' as image_cache; |
double timeBase = null; |
@@ -15,14 +16,15 @@ String url2 = "http://i2.kym-cdn.com/photos/images/facebook/000/581/296/c09.jpg" |
void beginFrame(double timeStamp) { |
if (timeBase == null) timeBase = timeStamp; |
double delta = timeStamp - timeBase; |
- PictureRecorder canvas = new PictureRecorder(view.width, view.height); |
+ PictureRecorder recorder = new PictureRecorder(); |
+ Canvas canvas = new Canvas(recorder, view.width, view.height); |
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 = 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(); |
+ view.picture = recorder.endRecording(); |
view.scheduleFrame(); |
} |