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

Issue 1122423009: Make it possible to custom-paint without an Element. (Closed)

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

Description

Make it possible to custom-paint without an Element. This adds a new abstract 'Canvas' which is similar to SkCanvas. PaintContext implements Canvas while still having its own commit() method to cause the paint actions to apply to the Element for the next frame. This adds a new PictureRecorder which also implements Canvas and has an endRecording() method which returns a Picture (another new interface) which can be held from Dart. There is also now a rootPicture setter on Document which takes a Picture and will then make the Document draw that Picture until changed. This piggybacks on the existing custom painting system which adds the painting at background-and-borders paint time so technically if you both set rootPicture as well as construct a DOM you will draw the DOM on top of your picture. :) R=mpcomplete@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/197b907de769c8ddaabc5a8e2fa1d6a0c660e319

Patch Set 1 #

Patch Set 2 : Add example #

Patch Set 3 : Comment tweak #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+242 lines, -88 lines) Patch
M sky/engine/core/core.gni View 3 chunks +9 lines, -0 lines 0 comments Download
M sky/engine/core/dom/Document.h View 4 chunks +11 lines, -5 lines 0 comments Download
M sky/engine/core/dom/Document.cpp View 2 chunks +15 lines, -0 lines 0 comments Download
M sky/engine/core/dom/Document.idl View 1 chunk +2 lines, -0 lines 0 comments Download
A + sky/engine/core/painting/Canvas.h View 1 2 3 chunks +14 lines, -11 lines 1 comment Download
A + sky/engine/core/painting/Canvas.cpp View 3 chunks +10 lines, -17 lines 0 comments Download
A + sky/engine/core/painting/Canvas.idl View 1 chunk +3 lines, -3 lines 0 comments Download
M sky/engine/core/painting/PaintingContext.h View 1 chunk +2 lines, -13 lines 0 comments Download
M sky/engine/core/painting/PaintingContext.cpp View 2 chunks +4 lines, -18 lines 0 comments Download
M sky/engine/core/painting/PaintingContext.idl View 1 chunk +1 line, -5 lines 0 comments Download
M sky/engine/core/painting/PaintingTasks.h View 1 chunk +2 lines, -1 line 0 comments Download
M sky/engine/core/painting/PaintingTasks.cpp View 3 chunks +6 lines, -6 lines 0 comments Download
A sky/engine/core/painting/Picture.h View 1 chunk +31 lines, -0 lines 0 comments Download
A sky/engine/core/painting/Picture.cpp View 1 chunk +27 lines, -0 lines 0 comments Download
A + sky/engine/core/painting/Picture.idl View 1 chunk +2 lines, -0 lines 0 comments Download
A sky/engine/core/painting/PictureRecorder.h View 1 chunk +28 lines, -0 lines 0 comments Download
A sky/engine/core/painting/PictureRecorder.cpp View 1 chunk +33 lines, -0 lines 0 comments Download
A + sky/engine/core/painting/PictureRecorder.idl View 1 chunk +4 lines, -3 lines 0 comments Download
M sky/engine/core/rendering/RenderBox.h View 1 chunk +2 lines, -0 lines 0 comments Download
M sky/engine/core/rendering/RenderBox.cpp View 1 chunk +10 lines, -5 lines 0 comments Download
M sky/engine/core/rendering/RenderView.cpp View 2 chunks +2 lines, -1 line 0 comments Download
A sky/examples/display_list/full_screen_circle.dart View 1 1 chunk +16 lines, -0 lines 0 comments Download
A sky/examples/display_list/main.sky View 1 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (1 generated)
eseidel
5 years, 7 months ago (2015-05-13 00:35:48 UTC) #2
eseidel
This probably isn't ready for landing. But it does actually work! :) I was just ...
5 years, 7 months ago (2015-05-13 00:39:00 UTC) #3
Matt Perry
If you know it works, I assume you have a sample sky app using it. ...
5 years, 7 months ago (2015-05-13 17:02:48 UTC) #4
eseidel
I think this is ready for review.
5 years, 7 months ago (2015-05-13 18:01:21 UTC) #5
Matt Perry
LGTM https://codereview.chromium.org/1122423009/diff/40001/sky/engine/core/painting/Canvas.h File sky/engine/core/painting/Canvas.h (right): https://codereview.chromium.org/1122423009/diff/40001/sky/engine/core/painting/Canvas.h#newcode28 sky/engine/core/painting/Canvas.h:28: void drawCircle(double x, double y, double radius, Paint* ...
5 years, 7 months ago (2015-05-13 18:33:21 UTC) #6
Hixie
On 2015/05/13 at 18:33:21, mpcomplete wrote: > LGTM > > https://codereview.chromium.org/1122423009/diff/40001/sky/engine/core/painting/Canvas.h > File sky/engine/core/painting/Canvas.h (right): ...
5 years, 7 months ago (2015-05-13 19:20:58 UTC) #7
eseidel
Nope. Happy to change to float. Thanks!
5 years, 7 months ago (2015-05-13 19:23:34 UTC) #8
eseidel
5 years, 7 months ago (2015-05-13 20:16:52 UTC) #9
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
197b907de769c8ddaabc5a8e2fa1d6a0c660e319 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698