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

Unified Diff: sky/sdk/lib/widgets/icon.dart

Issue 1236043004: Improve drawer performance (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: cache paint 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/widgets/drawer_item.dart ('k') | sky/services/engine/input_event.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/icon.dart
diff --git a/sky/sdk/lib/widgets/icon.dart b/sky/sdk/lib/widgets/icon.dart
index 05bbcb8fc82cd9c0196877e5dd30805387029054..7229d9e17f0b238b4e128f4e742998e6278ec271 100644
--- a/sky/sdk/lib/widgets/icon.dart
+++ b/sky/sdk/lib/widgets/icon.dart
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import 'dart:sky' as sky;
+
import 'package:sky/mojo/asset_bundle.dart';
import 'package:sky/widgets/basic.dart';
import 'package:sky/widgets/theme.dart';
@@ -46,11 +48,18 @@ AssetBundle _initIconBundle() {
final AssetBundle _iconBundle = _initIconBundle();
class Icon extends Component {
- Icon({ String key, this.size, this.type: '', this.color }) : super(key: key);
+ Icon({
+ String key,
+ this.size,
+ this.type: '',
+ this.color,
+ this.colorFilter
+ }) : super(key: key);
final int size;
final String type;
final IconThemeColor color;
+ final sky.ColorFilter colorFilter;
String get colorSuffix {
IconThemeColor iconThemeColor = color;
@@ -84,7 +93,8 @@ class Icon extends Component {
return new AssetImage(
bundle: _iconBundle,
name: '${category}/${density}/ic_${subtype}_${colorSuffix}_${size}dp.png',
- size: new Size(size.toDouble(), size.toDouble())
+ size: new Size(size.toDouble(), size.toDouble()),
+ colorFilter: colorFilter
);
}
}
« no previous file with comments | « sky/sdk/lib/widgets/drawer_item.dart ('k') | sky/services/engine/input_event.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698