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

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

Issue 1152963009: Add support for linear gradients, implemented as skia shaders. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/tonic/dart_converter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/raw/painting.sky
diff --git a/sky/examples/raw/painting.sky b/sky/examples/raw/painting.sky
index 075867a8c6e0cd0ede15c1360c0dca42de0f1405..b0731a95594e355902cbb00aa228826bebc1e952 100644
--- a/sky/examples/raw/painting.sky
+++ b/sky/examples/raw/painting.sky
@@ -26,8 +26,12 @@ void main() {
paint.color = const Color.fromARGB(128, 255, 0, 255);
context.rotateDegrees(45.0);
+ Gradient yellowBlue = new Gradient.Linear(
+ [new Point(-radius, -radius), new Point(0.0, 0.0)],
+ [const Color(0xFFFFFF00), const Color(0xFF0000FF)],
+ null);
context.drawRect(new Rect.fromLTRB(-radius, -radius, radius, radius),
- paint);
+ new Paint()..setShader(yellowBlue));
// Scale x and y by 0.5.
var scaleMatrix = new Float32List.fromList([
« no previous file with comments | « sky/engine/tonic/dart_converter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698