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

Side by Side Diff: sky/sdk/lib/painting/box_painter.dart

Issue 1211603003: Baby steps towards an odeon-like animation system. First victim: Drawer. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: abarth Created 5 years, 5 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
« no previous file with comments | « sky/sdk/lib/base/lerp.dart ('k') | sky/sdk/lib/widgets/animated_component.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 import 'dart:sky' show Point, Offset, Size, Rect, Color, Paint, Path; 7 import 'dart:sky' show Point, Offset, Size, Rect, Color, Paint, Path;
8 8
9 import '../base/lerp.dart';
9 import 'shadows.dart'; 10 import 'shadows.dart';
10 import 'package:sky/mojo/net/image_cache.dart' as image_cache; 11 import 'package:sky/mojo/net/image_cache.dart' as image_cache;
11 12
12 class BorderSide { 13 class BorderSide {
13 const BorderSide({ 14 const BorderSide({
14 this.color: const Color(0xFF000000), 15 this.color: const Color(0xFF000000),
15 this.width: 1.0 16 this.width: 1.0
16 }); 17 });
17 final Color color; 18 final Color color;
18 final double width; 19 final double width;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 this.blur 66 this.blur
66 }); 67 });
67 68
68 final Color color; 69 final Color color;
69 final Offset offset; 70 final Offset offset;
70 final double blur; 71 final double blur;
71 72
72 String toString() => 'BoxShadow($color, $offset, $blur)'; 73 String toString() => 'BoxShadow($color, $offset, $blur)';
73 } 74 }
74 75
76 BoxShadow lerpBoxShadow(BoxShadow a, BoxShadow b, double t) {
77 return new BoxShadow(
78 color: lerpColor(a.color, b.color, t),
79 offset: lerpOffset(a.offset, b.offset, t),
80 blur: lerpNum(a.blur, b.blur, t));
81 }
82
75 abstract class Gradient { 83 abstract class Gradient {
76 sky.Shader createShader(); 84 sky.Shader createShader();
77 } 85 }
78 86
79 class LinearGradient extends Gradient { 87 class LinearGradient extends Gradient {
80 LinearGradient({ 88 LinearGradient({
81 this.endPoints, 89 this.endPoints,
82 this.colors, 90 this.colors,
83 this.colorStops, 91 this.colorStops,
84 this.tileMode: sky.TileMode.clamp 92 this.tileMode: sky.TileMode.clamp
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 path.close(); 381 path.close();
374 canvas.drawPath(path, paint); 382 canvas.drawPath(path, paint);
375 } 383 }
376 384
377 void paint(sky.Canvas canvas, Rect rect) { 385 void paint(sky.Canvas canvas, Rect rect) {
378 _paintBackgroundColor(canvas, rect); 386 _paintBackgroundColor(canvas, rect);
379 _paintBackgroundImage(canvas, rect); 387 _paintBackgroundImage(canvas, rect);
380 _paintBorder(canvas, rect); 388 _paintBorder(canvas, rect);
381 } 389 }
382 } 390 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/base/lerp.dart ('k') | sky/sdk/lib/widgets/animated_component.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698