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

Issue 1710633002: Pull up a subset of CanvasRenderingContext2D into BaseRenderingContext2D. (Closed)

Created:
4 years, 10 months ago by ikilpatrick
Modified:
4 years, 10 months ago
Reviewers:
sof, Justin Novosad
CC:
chromium-reviews, blink-reviews, ajuma+watch-canvas_chromium.org, Rik, dshwang
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Pull up a subset of CanvasRenderingContext2D into BaseRenderingContext2D. This will allow an additional sub-class of BaseRC2D called PaintRC2D. BaseRC2D contains the subset of APIs needed for PaintRC2D. See: https://drafts.css-houdini.org/css-paint-api/#paintrenderingcontext2d BUG=578252 Committed: https://crrev.com/4333ef80f90f702a0571c030f15f0e317931ee7d Cr-Commit-Position: refs/heads/master@{#377082}

Patch Set 1 #

Patch Set 2 : fixup. #

Total comments: 8

Patch Set 3 : now with moar copy detection. #

Total comments: 6

Patch Set 4 : moved templated functions into .h file. #

Total comments: 2

Patch Set 5 : move draw* out of class definition. #

Patch Set 6 : rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+357 lines, -2875 lines) Patch
A + third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h View 1 2 3 4 5 chunks +142 lines, -186 lines 1 comment Download
A + third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp View 1 2 3 61 chunks +131 lines, -1142 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h View 1 2 3 8 chunks +28 lines, -140 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp View 1 2 3 12 chunks +54 lines, -1407 lines 0 comments Download
M third_party/WebKit/Source/modules/modules.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (9 generated)
ikilpatrick
So this turned out to be easier than expected. There is a pretty nice subset ...
4 years, 10 months ago (2016-02-17 22:46:11 UTC) #2
Justin Novosad
This is great. It is exactly what I had in mind. lgtm with nits. https://codereview.chromium.org/1710633002/diff/20001/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h ...
4 years, 10 months ago (2016-02-18 03:52:09 UTC) #3
ikilpatrick
Now with moar copy detection! https://codereview.chromium.org/1710633002/diff/20001/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h File third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h (right): https://codereview.chromium.org/1710633002/diff/20001/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h#newcode66 third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h:66: class MODULES_EXPORT CanvasRenderingContext2D final ...
4 years, 10 months ago (2016-02-19 00:31:05 UTC) #5
ikilpatrick
PTAL also.
4 years, 10 months ago (2016-02-19 01:03:27 UTC) #6
Justin Novosad
https://codereview.chromium.org/1710633002/diff/40001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/1710633002/diff/40001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode552 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:552: void BaseRenderingContext2D::drawForText(const Font& font, const TextRunPaintInfo& textRunPaintInfo, const FloatPoint& ...
4 years, 10 months ago (2016-02-22 19:55:13 UTC) #7
ikilpatrick
https://codereview.chromium.org/1710633002/diff/40001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/1710633002/diff/40001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode552 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:552: void BaseRenderingContext2D::drawForText(const Font& font, const TextRunPaintInfo& textRunPaintInfo, const FloatPoint& ...
4 years, 10 months ago (2016-02-22 22:12:28 UTC) #8
Justin Novosad
lgtm with nit. https://codereview.chromium.org/1710633002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h (right): https://codereview.chromium.org/1710633002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h#newcode235 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h:235: void compositedDraw(const DrawFunc& drawFunc, SkCanvas* c, ...
4 years, 10 months ago (2016-02-22 22:50:55 UTC) #9
ikilpatrick
https://codereview.chromium.org/1710633002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h (right): https://codereview.chromium.org/1710633002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h#newcode235 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h:235: void compositedDraw(const DrawFunc& drawFunc, SkCanvas* c, CanvasRenderingContext2DState::PaintType paintType, CanvasRenderingContext2DState::ImageType ...
4 years, 10 months ago (2016-02-22 23:19:10 UTC) #10
Justin Novosad
On 2016/02/22 23:19:10, ikilpatrick wrote: > https://codereview.chromium.org/1710633002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h > File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h > (right): > > https://codereview.chromium.org/1710633002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h#newcode235 ...
4 years, 10 months ago (2016-02-23 14:48:29 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1710633002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1710633002/100001
4 years, 10 months ago (2016-02-23 17:38:52 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/178092)
4 years, 10 months ago (2016-02-23 18:44:50 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1710633002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1710633002/100001
4 years, 10 months ago (2016-02-23 20:45:10 UTC) #18
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 10 months ago (2016-02-23 20:58:48 UTC) #20
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/4333ef80f90f702a0571c030f15f0e317931ee7d Cr-Commit-Position: refs/heads/master@{#377082}
4 years, 10 months ago (2016-02-23 21:00:32 UTC) #22
sof
https://codereview.chromium.org/1710633002/diff/100001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h (right): https://codereview.chromium.org/1710633002/diff/100001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h#newcode181 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h:181: WillBeHeapVector<OwnPtrWillBeMember<CanvasRenderingContext2DState>> m_stateStack; This runs into MSVC compilation breakage non-Oilpan, ...
4 years, 10 months ago (2016-02-24 15:56:47 UTC) #24
engedy
A revert of this CL (patchset #6 id:100001) has been created in https://codereview.chromium.org/1732923002/ by engedy@chromium.org. ...
4 years, 10 months ago (2016-02-24 16:09:38 UTC) #25
Justin Novosad
On 2016/02/24 16:09:38, engedy wrote: > A revert of this CL (patchset #6 id:100001) has ...
4 years, 10 months ago (2016-02-24 16:51:08 UTC) #26
ikilpatrick
On 2016/02/24 16:51:08, Justin Novosad wrote: > On 2016/02/24 16:09:38, engedy wrote: > > A ...
4 years, 10 months ago (2016-02-24 18:16:57 UTC) #27
sof
4 years, 10 months ago (2016-02-24 18:25:12 UTC) #28
Message was sent while issue was closed.
On 2016/02/24 18:16:57, ikilpatrick wrote:
> On 2016/02/24 16:51:08, Justin Novosad wrote:
> > On 2016/02/24 16:09:38, engedy wrote:
> > > A revert of this CL (patchset #6 id:100001) has been created in
> > > https://codereview.chromium.org/1732923002/ by mailto:engedy@chromium.org.
> > > 
> > > The reason for reverting is: Speculative revert to fix WebKit Win
non-Oilpan
> > > (dbg) breakage..
> > 
> > I don't get why Vector<OwnPtr<xyz>> ever worked in the first place.
> > 
> > In VectorTraits.h we have this:
> > 
> > template <typename P>
> > struct VectorTraits<OwnPtr<P>> : SimpleClassVectorTraits<OwnPtr<P>> {
> >     // OwnPtr -> PassOwnPtr has a very particular structure that tricks the
> >     // normal type traits into thinking that the class is "trivially
> copyable".
> >     static const bool canCopyWithMemcpy = false;
> > };
> > 
> > That forces vector copying to go through the copy constructor... and in
> OwnPtr.h
> > the copy constructor is made private by WTF_MAKE_NONCOPYABLE(OwnPtr);
> 
> Thanks for the revert.
> 
> So this is pushing my c++ knowledge limits, but I've been looking at some
> similar issues.
> https://groups.google.com/a/chromium.org/forum/#!topic/cxx/lZ72n5oJhL8
> 
> I think the solution is to make CanvasRenderingContext2DState
> WTF_MAKE_NONCOPYABLE, but we'll find out.

I think that's it (not that I fully understand why), thanks for the pointer.

(WTF_MAKE_NONCOPYABLE(BaseRenderingContext2D) works out - tested locally.)

Powered by Google App Engine
This is Rietveld 408576698