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

Unified Diff: sky/examples/raw/painting.sky

Issue 1158693005: Add an API to set the ColorFilter on a Paint object. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: Created 5 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
Index: sky/examples/raw/painting.sky
diff --git a/sky/examples/raw/painting.sky b/sky/examples/raw/painting.sky
index e295abd3c6f784ca8c117c5d82492a90a7f43162..9e6d0301bbd3cf7ef458425504351d1226724cba 100644
--- a/sky/examples/raw/painting.sky
+++ b/sky/examples/raw/painting.sky
@@ -40,18 +40,25 @@ void main() {
context.restore();
+ context.translate(0.0, 50.0);
var builder = new LayerDrawLooperBuilder()
..addLayerOnTop(
- new DrawLooperLayerInfo()..setOffset(150.0, 0.0)..setPaintBits(-1),
+ new DrawLooperLayerInfo()
+ ..setOffset(150.0, 0.0)..setPaintBits(-1)..setColorMode(1),
(Paint layerPaint) {
- // TODO(mpcomplete): This won't do anything until we add support for
- // setting the color filter.
- layerPaint.setARGB(128, 0, 0, 255);
+ layerPaint.setARGB(128, 255, 255, 0);
+ layerPaint.setColorFilter(new ColorFilter(0x770000ff, 5));
})
..addLayerOnTop(
- new DrawLooperLayerInfo()..setOffset(75.0, 75.0)..setPaintBits(0),
+ new DrawLooperLayerInfo()..setOffset(75.0, 75.0)..setColorMode(1),
(Paint layerPaint) {
layerPaint.setARGB(128, 255, 0, 0);
+ })
+ ..addLayerOnTop(
+ new DrawLooperLayerInfo()..setOffset(225.0, 75.0),
+ (Paint layerPaint) {
+ // Since this layer uses a DST color mode, this has no effect.
+ layerPaint.setARGB(128, 255, 0, 0);
});
paint.setDrawLooper(builder.build());
context.drawCircle(0.0, 0.0, radius, paint);

Powered by Google App Engine
This is Rietveld 408576698