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

Unified Diff: pkg/stm32/lib/lcd.dart

Issue 1996533003: Change framebuffer.clear to use background color (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Review feedback Created 4 years, 7 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 | « no previous file | samples/stm32f746g-discovery/disco-light.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/stm32/lib/lcd.dart
diff --git a/pkg/stm32/lib/lcd.dart b/pkg/stm32/lib/lcd.dart
index 9d1f84d7654fb9bb7afdabff4edf2c4bf71ff6e1..0dc6fc76d08f49b3633f0b363bb7057a1afa8ee8 100644
--- a/pkg/stm32/lib/lcd.dart
+++ b/pkg/stm32/lib/lcd.dart
@@ -81,18 +81,22 @@ class FrameBuffer {
int get height => _lcdHeight.icall$0();
int get width => _lcdWidth.icall$0();
- clear([Color color = Color.black]) {
- _lcdClear.icall$1(color.rgb8888);
- }
+ Color _backgroundColor = Color.white;
- set foregroundColor(Color color) {
- _lcdSetForegroundColor.icall$1(color.rgb8888);
+ clear([Color color]) {
+ color ??= _backgroundColor;
+ _lcdClear.icall$1(color.rgb8888);
}
set backgroundColor(Color color) {
+ _backgroundColor = color;
_lcdSetBackgroundColor.icall$1(color.rgb8888);
}
+ set foregroundColor(Color color) {
+ _lcdSetForegroundColor.icall$1(color.rgb8888);
+ }
+
Color readPixel(int x, int y) {
return new Color.fromRgb8888(_lcdReadPixel.icall$2(x, y));
}
« no previous file with comments | « no previous file | samples/stm32f746g-discovery/disco-light.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698