Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: sky/examples/raw/launcher.dart

Issue 1190123003: Decouple Canvas from DisplayList and map Picture and PictureRecorder more directly to their Skia co… (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: j/k -- this one should actually be fully merged and testable Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/examples/raw/launcher.dart
diff --git a/sky/examples/raw/launcher.dart b/sky/examples/raw/launcher.dart
index 58341d184b1df9dd89a323f0fe5ac3ab460c972e..92d10480c79374733f91ae6b4973a6d409fdb2bd 100644
--- a/sky/examples/raw/launcher.dart
+++ b/sky/examples/raw/launcher.dart
@@ -6,17 +6,19 @@ import "dart:math";
import 'dart:sky';
import 'package:sky/framework/shell.dart' as shell;
+import 'package:sky/rendering/object.dart';
import 'package:mojom/intents/intents.mojom.dart';
Picture draw(int a, int r, int g, int b) {
double width = view.width;
double height = view.height;
- PictureRecorder recorder = new PictureRecorder(width, height);
+ PictureRecorder recorder = new PictureRecorder();
+ RenderCanvas canvas = new RenderCanvas(recorder, width, height);
abarth-chromium 2015/06/23 02:28:45 Again, regular Canvas is fine here. There's no ne
iansf 2015/06/23 22:46:09 Done.
double radius = min(width, height) * 0.45;
Paint paint = new Paint()..color = new Color.fromARGB(a, r, g, b);
- recorder.drawRect(new Rect.fromSize(new Size(width, height)), paint);
+ canvas.drawRect(new Rect.fromSize(new Size(width, height)), paint);
return recorder.endRecording();
}

Powered by Google App Engine
This is Rietveld 408576698