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

Issue 1144483002: Flesh out the Painting API a bit. (Closed)

Created:
5 years, 7 months ago by Matt Perry
Modified:
5 years, 7 months ago
Reviewers:
eseidel, reed2, reed1
CC:
abarth-chromium, gregsimon, mojo-reviews_chromium.org, ojan, qsr+mojo_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Flesh out the Painting API a bit. This exposes most methods from Skia's C canvas API to Dart. For now, SkRect and SkMatrix are represented simply as an array of floats, which requires a conversion at the bindings layer. More complex types like SkPath are still TODO.

Patch Set 1 #

Total comments: 5

Patch Set 2 : rebased to eseidel's canvas patch #

Total comments: 3

Patch Set 3 : double->float #

Total comments: 4

Patch Set 4 : constify #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -7 lines) Patch
M sky/engine/core/painting/Canvas.h View 1 2 3 1 chunk +18 lines, -3 lines 5 comments Download
M sky/engine/core/painting/Canvas.cpp View 1 2 3 2 chunks +115 lines, -1 line 0 comments Download
M sky/engine/core/painting/Canvas.idl View 1 2 3 1 chunk +20 lines, -3 lines 0 comments Download
M sky/engine/core/painting/PaintingContext.h View 1 1 chunk +1 line, -0 lines 0 comments Download
A sky/examples/raw/painting.sky View 1 2 3 1 chunk +46 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (6 generated)
Matt Perry
Here's a first step at the Painting API. Note to Eric: feel free to land ...
5 years, 7 months ago (2015-05-13 19:39:16 UTC) #2
eseidel
Landed. This generally looks fine. I suspect that we're going to want to create a ...
5 years, 7 months ago (2015-05-13 20:18:56 UTC) #3
robertphillips
https://codereview.chromium.org/1144483002/diff/1/sky/engine/core/painting/PaintingContext.idl File sky/engine/core/painting/PaintingContext.idl (right): https://codereview.chromium.org/1144483002/diff/1/sky/engine/core/painting/PaintingContext.idl#newcode15 sky/engine/core/painting/PaintingContext.idl:15: void scale(float sx, float sy); rotateDegrees ? to leave ...
5 years, 7 months ago (2015-05-13 20:22:06 UTC) #5
Matt Perry
Rebased. Also s/float/double on Canvas
5 years, 7 months ago (2015-05-13 20:23:12 UTC) #6
Matt Perry
On 2015/05/13 20:23:12, Matt Perry wrote: > Rebased. Also s/float/double on Canvas Er s/double/float
5 years, 7 months ago (2015-05-13 20:23:32 UTC) #7
eseidel
This looks great. lgtm https://codereview.chromium.org/1144483002/diff/10005/sky/engine/core/painting/Canvas.cpp File sky/engine/core/painting/Canvas.cpp (right): https://codereview.chromium.org/1144483002/diff/10005/sky/engine/core/painting/Canvas.cpp#newcode49 sky/engine/core/painting/Canvas.cpp:49: if (bounds.size() != 0) isEmpty() ...
5 years, 7 months ago (2015-05-13 20:24:38 UTC) #9
Matt Perry
I'll work on a Dart-ier wrapper next. https://codereview.chromium.org/1144483002/diff/1/sky/engine/core/painting/PaintingContext.idl File sky/engine/core/painting/PaintingContext.idl (right): https://codereview.chromium.org/1144483002/diff/1/sky/engine/core/painting/PaintingContext.idl#newcode15 sky/engine/core/painting/PaintingContext.idl:15: void scale(float ...
5 years, 7 months ago (2015-05-13 20:32:44 UTC) #10
commit-bot: I haz the power
Commit queue rejected this change because it did not recognize the base URL. Please commit ...
5 years, 7 months ago (2015-05-13 20:34:04 UTC) #13
reed1
https://codereview.chromium.org/1144483002/diff/1/sky/engine/core/painting/PaintingContext.idl File sky/engine/core/painting/PaintingContext.idl (right): https://codereview.chromium.org/1144483002/diff/1/sky/engine/core/painting/PaintingContext.idl#newcode26 sky/engine/core/painting/PaintingContext.idl:26: void drawCircle(double x, double y, double radius, Paint paint); ...
5 years, 7 months ago (2015-05-13 20:35:03 UTC) #15
reed1
comments for future CLs... 1. Matrix almost certainly should be a class, so we can ...
5 years, 7 months ago (2015-05-13 20:38:58 UTC) #16
Matt Perry
Thanks for the feedback. I agree on the class wrappers for Matrix/Rect - I'll work ...
5 years, 7 months ago (2015-05-13 21:02:05 UTC) #17
reed1
On 2015/05/13 21:02:05, Matt Perry wrote: > Thanks for the feedback. I agree on the ...
5 years, 7 months ago (2015-05-13 21:17:29 UTC) #18
Matt Perry
Committed patchset #4 (id:50001) manually as b1b0224dc9c5189344fa96101cb0cff8ef328f6b (presubmit successful).
5 years, 7 months ago (2015-05-13 21:17:30 UTC) #19
reed1
https://codereview.chromium.org/1144483002/diff/50001/sky/engine/core/painting/Canvas.h File sky/engine/core/painting/Canvas.h (right): https://codereview.chromium.org/1144483002/diff/50001/sky/engine/core/painting/Canvas.h#newcode29 sky/engine/core/painting/Canvas.h:29: void saveLayer(const Vector<float>& bounds, const Paint* paint); The bounds ...
5 years, 7 months ago (2015-05-13 21:20:11 UTC) #20
Matt Perry
https://codereview.chromium.org/1144483002/diff/50001/sky/engine/core/painting/Canvas.h File sky/engine/core/painting/Canvas.h (right): https://codereview.chromium.org/1144483002/diff/50001/sky/engine/core/painting/Canvas.h#newcode29 sky/engine/core/painting/Canvas.h:29: void saveLayer(const Vector<float>& bounds, const Paint* paint); On 2015/05/13 ...
5 years, 7 months ago (2015-05-13 21:22:00 UTC) #21
reed1
5 years, 7 months ago (2015-05-14 13:34:24 UTC) #22
Message was sent while issue was closed.
On 2015/05/13 21:22:00, Matt Perry wrote:
>
https://codereview.chromium.org/1144483002/diff/50001/sky/engine/core/paintin...
> File sky/engine/core/painting/Canvas.h (right):
> 
>
https://codereview.chromium.org/1144483002/diff/50001/sky/engine/core/paintin...
> sky/engine/core/painting/Canvas.h:29: void saveLayer(const Vector<float>&
> bounds, const Paint* paint);
> On 2015/05/13 21:20:10, reed1 wrote:
> > The bounds to saveLayer is optional (passing NULL should be fine), so we may
> > need this signature to be const * instead of &
> 
> The IDL compiler dictates the interface. But passing null does work - it shows
> up as an empty vector.

Interesting. That seems a little limiting, but I concede its not your issue.

> 
>
https://codereview.chromium.org/1144483002/diff/50001/sky/engine/core/paintin...
> sky/engine/core/painting/Canvas.h:40: void drawPaint(Paint* paint);
> On 2015/05/13 21:20:10, reed1 wrote:
> > const for drawPaint
> 
> Oops, thanks. Will fix in a future CL.

Powered by Google App Engine
This is Rietveld 408576698