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

Side by Side Diff: sky/examples/game/lib/sprite_box.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: Rework the API a bit 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 unified diff | Download patch
OLDNEW
1 part of sprites; 1 part of sprites;
2 2
3 enum SpriteBoxTransformMode { 3 enum SpriteBoxTransformMode {
4 nativePoints, 4 nativePoints,
5 letterbox, 5 letterbox,
6 stretch, 6 stretch,
7 scaleToFit, 7 scaleToFit,
8 fixedWidth, 8 fixedWidth,
9 fixedHeight, 9 fixedHeight,
10 } 10 }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 _transformMatrix.scale(scaleX, scaleY); 223 _transformMatrix.scale(scaleX, scaleY);
224 224
225 return _transformMatrix; 225 return _transformMatrix;
226 } 226 }
227 227
228 void _invalidateTransformMatrix() { 228 void _invalidateTransformMatrix() {
229 _transformMatrix = null; 229 _transformMatrix = null;
230 _rootNode._invalidateToBoxTransformMatrix(); 230 _rootNode._invalidateToBoxTransformMatrix();
231 } 231 }
232 232
233 void paint(RenderObjectDisplayList canvas) { 233 void paint(RenderCanvas canvas) {
234 canvas.save(); 234 canvas.save();
235 235
236 // Move to correct coordinate space before drawing 236 // Move to correct coordinate space before drawing
237 canvas.concat(transformMatrix.storage); 237 canvas.concat(transformMatrix.storage);
238 238
239 // Draw the sprite tree 239 // Draw the sprite tree
240 _rootNode._visit(canvas); 240 _rootNode._visit(canvas);
241 241
242 canvas.restore(); 242 canvas.restore();
243 } 243 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 SpriteBoxHitTestEntry(RenderBox target, Point localPosition) : super(target, l ocalPosition); 316 SpriteBoxHitTestEntry(RenderBox target, Point localPosition) : super(target, l ocalPosition);
317 } 317 }
318 318
319 class SpriteBoxEvent { 319 class SpriteBoxEvent {
320 Point boxPosition; 320 Point boxPosition;
321 String type; 321 String type;
322 int pointer; 322 int pointer;
323 323
324 SpriteBoxEvent(this.boxPosition, this.type, this.pointer); 324 SpriteBoxEvent(this.boxPosition, this.type, this.pointer);
325 } 325 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698