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

Issue 7044062: Use SkMatrix44 for the underlying implementation of ui::Transform (Closed)

Created:
9 years, 6 months ago by Ian Vollick
Modified:
9 years, 5 months ago
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Use SkMatrix44 for the underlying implementation of ui::Transform BUG= TEST=ui_unittest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91855

Patch Set 1 #

Total comments: 11

Patch Set 2 : updates in response to reviews #

Patch Set 3 : removed unused header in gl compositor #

Total comments: 6

Patch Set 4 : Use raw data pointer from the SkMatrix44 #

Patch Set 5 : Removed unused headers #

Patch Set 6 : removed unnecessary calls to SkMatrix44::reset #

Patch Set 7 : Minor change: use a const reference to store the 3x3 SkMatrix in TransformRect* #

Patch Set 8 : Don't cache the inverse; TransformPoint, TransformPointReverse, etc are const #

Patch Set 9 : TransformPoint should return bool like the other Transform functions. #

Patch Set 10 : Use SkMatrix44 from utils rather than experimental #

Patch Set 11 : No need for skia/experimental #

Patch Set 12 : Skia has been rolled; no need to do this myself #

Patch Set 13 : Changed signature of TransformPoint -- now generic. #

Total comments: 6

Patch Set 14 : No SkMatrix44 for mac; Point3<T> coding style fixes; use row major ordering for d3d #

Patch Set 15 : Added 2D unittests #

Total comments: 11

Patch Set 16 : No more templates #

Total comments: 8

Patch Set 17 : Use generated copy/assign; rearrange function defns in transform.cc; #

Patch Set 18 : Gardened patch. #

Patch Set 19 : Updates after testing on Windows #

Patch Set 20 : Layer animator updates #

Total comments: 9

Patch Set 21 : Fixed formatting issues - updated tests #

Patch Set 22 : Attempt to fix mac build. #

Patch Set 23 : Gardened patch #

Patch Set 24 : ifdef'd out code that involves ui::Transform #

Patch Set 25 : Gardened patch again (for rev 90842) #

Patch Set 26 : Gardened patch #

Patch Set 27 : Gardening #

Patch Set 28 : Updated interpolated_transform_unittest; don't truncate double to float #

Patch Set 29 : Updating the views unittests #

Patch Set 30 : Don't run the interpolated transform tests on mac anymore. #

Patch Set 31 : Fixed a typo in a comment #

Total comments: 1

Patch Set 32 : Gardening patch #

Unified diffs Side-by-side diffs Delta from patch set Stats (+877 lines, -162 lines) Patch
M skia/skia.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +6 lines, -1 line 0 comments Download
M ui/gfx/canvas.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/canvas_skia.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/canvas_skia.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/compositor/compositor_gl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +1 line, -24 lines 0 comments Download
M ui/gfx/compositor/compositor_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2 chunks +10 lines, -15 lines 0 comments Download
M ui/gfx/compositor/layer_animator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +3 lines, -2 lines 0 comments Download
M ui/gfx/compositor/layer_animator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +32 lines, -18 lines 0 comments Download
M ui/gfx/interpolated_transform_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 3 chunks +11 lines, -7 lines 0 comments Download
A ui/gfx/point3.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +63 lines, -0 lines 0 comments Download
M ui/gfx/transform.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +43 lines, -27 lines 0 comments Download
M ui/gfx/transform.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +128 lines, -41 lines 0 comments Download
A ui/gfx/transform_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +515 lines, -0 lines 0 comments Download
M ui/ui_gfx.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +6 lines, -2 lines 0 comments Download
M ui/ui_unittests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2 chunks +6 lines, -1 line 0 comments Download
M views/view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3 chunks +7 lines, -2 lines 0 comments Download
M views/view_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 11 chunks +40 lines, -22 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
Ian Vollick
9 years, 6 months ago (2011-06-09 12:53:52 UTC) #1
sky
At a minimum you'll also need to update compositor_win. Not sure about the GL side. ...
9 years, 6 months ago (2011-06-09 17:20:29 UTC) #2
wjmaclean
I'm guessing this hasn't been compiled/tested with COMPOSITOR_2 defined, right? If so, that will need ...
9 years, 6 months ago (2011-06-09 17:20:57 UTC) #3
reed1
http://codereview.chromium.org/7044062/diff/1/ui/gfx/transform.cc File ui/gfx/transform.cc (left): http://codereview.chromium.org/7044062/diff/1/ui/gfx/transform.cc#oldcode22 ui/gfx/transform.cc:22: matrix_.setRotate(SkFloatToScalar(degree)); I think this can just be matrix.setRotateDegreesAbout(degree, 0, ...
9 years, 6 months ago (2011-06-09 19:22:47 UTC) #4
reed1
9 years, 6 months ago (2011-06-09 19:23:02 UTC) #5
rjkroege
http://codereview.chromium.org/7044062/diff/2007/ui/gfx/compositor/compositor_gl.cc File ui/gfx/compositor/compositor_gl.cc (right): http://codereview.chromium.org/7044062/diff/2007/ui/gfx/compositor/compositor_gl.cc#newcode164 ui/gfx/compositor/compositor_gl.cc:164: const SkMatrix44& matrix = t.matrix(); Given Ganesh, there should ...
9 years, 6 months ago (2011-06-10 17:52:14 UTC) #6
Ian Vollick
Both sky and rjkroege mentioned the cached inverse. It was probably premature optimization, but calculating ...
9 years, 6 months ago (2011-06-10 23:12:08 UTC) #7
sky
On Fri, Jun 10, 2011 at 4:12 PM, <vollick@chromium.org> wrote: > Both sky and rjkroege ...
9 years, 6 months ago (2011-06-10 23:20:54 UTC) #8
tomhudson
On 2011/06/10 17:52:14, rjkroege wrote: http://codereview.chromium.org/7044062/diff/2007/ui/gfx/compositor/compositor_gl.cc#newcode164 > ui/gfx/compositor/compositor_gl.cc:164: const SkMatrix44& matrix = t.matrix(); > Given ...
9 years, 6 months ago (2011-06-13 14:36:07 UTC) #9
reed1
skia rev. 1564 (soon to be rolled into chrome) provides getters for row and col ...
9 years, 6 months ago (2011-06-13 14:48:39 UTC) #10
Ian Vollick
Using SkMatrix44::asColMajorf instead of a pointer to the internal data seems like a good solution ...
9 years, 6 months ago (2011-06-13 17:47:51 UTC) #11
reed1
I will try to roll the DEPS as soon as possible. On Mon, Jun 13, ...
9 years, 6 months ago (2011-06-13 17:50:31 UTC) #12
Ian Vollick
reed: - this CL no longer contains code to roll skia sky: - Was the ...
9 years, 6 months ago (2011-06-14 22:28:28 UTC) #13
sky
On Tue, Jun 14, 2011 at 3:28 PM, <vollick@chromium.org> wrote: > reed: > - this ...
9 years, 6 months ago (2011-06-14 22:41:18 UTC) #14
reed1
SkMatrix44 has a companion SkVector4. Perhaps we could add a Vector/Point3 as well to skia. ...
9 years, 6 months ago (2011-06-15 12:11:37 UTC) #15
vollick1
I think we're in trouble if we convert to integers in object space at all, ...
9 years, 6 months ago (2011-06-15 14:31:35 UTC) #16
sky
On Wed, Jun 15, 2011 at 7:31 AM, Ian Vollick <vollick@google.com> wrote: > I think ...
9 years, 6 months ago (2011-06-15 17:26:21 UTC) #17
Ian Vollick
sky: - view now converts to floating point coordinates before transforming and then converts back ...
9 years, 6 months ago (2011-06-16 21:43:30 UTC) #18
sky
http://codereview.chromium.org/7044062/diff/16001/skia/skia.gyp File skia/skia.gyp (right): http://codereview.chromium.org/7044062/diff/16001/skia/skia.gyp#newcode512 skia/skia.gyp:512: '../third_party/skia/include/utils/SkMatrix44.h', Don't include these on the mac. http://codereview.chromium.org/7044062/diff/16001/ui/gfx/compositor/compositor_win.cc File ...
9 years, 6 months ago (2011-06-16 23:06:56 UTC) #19
vollick1
> > http://codereview.chromium.**org/7044062/diff/16001/skia/** > skia.gyp#newcode512<http://codereview.chromium.org/7044062/diff/16001/skia/skia.gyp#newcode512> > skia/skia.gyp:512: '../third_party/skia/include/**utils/SkMatrix44.h', > Don't include these on the mac. ...
9 years, 6 months ago (2011-06-17 16:04:08 UTC) #20
sky
>> http://codereview.chromium.org/7044062/diff/16001/ui/gfx/point3.h#newcode16 >> ui/gfx/point3.h:16: template <typename T> >> Do we really need a template here? ...
9 years, 6 months ago (2011-06-17 16:38:21 UTC) #21
sky
http://codereview.chromium.org/7044062/diff/29001/ui/gfx/point3.h File ui/gfx/point3.h (right): http://codereview.chromium.org/7044062/diff/29001/ui/gfx/point3.h#newcode21 ui/gfx/point3.h:21: : x_(0), y_(0), z_(0) Move the member initializer list ...
9 years, 6 months ago (2011-06-17 16:38:23 UTC) #22
wjmaclean
http://codereview.chromium.org/7044062/diff/29001/ui/gfx/point3.h File ui/gfx/point3.h (right): http://codereview.chromium.org/7044062/diff/29001/ui/gfx/point3.h#newcode68 ui/gfx/point3.h:68: T Dist2(const Point3<T>& other) const { On 2011/06/17 16:38:23, ...
9 years, 6 months ago (2011-06-17 16:58:06 UTC) #23
vollick1
I got rid of all templates. Hopefully the code is easier to read. > http://codereview.chromium.**org/7044062/diff/29001/ui/gfx/** ...
9 years, 6 months ago (2011-06-17 17:29:03 UTC) #24
sky
http://codereview.chromium.org/7044062/diff/25002/ui/gfx/point3.h File ui/gfx/point3.h (right): http://codereview.chromium.org/7044062/diff/25002/ui/gfx/point3.h#newcode19 ui/gfx/point3.h:19: {} Either { on the previous line, or {} ...
9 years, 6 months ago (2011-06-17 18:43:41 UTC) #25
Ian Vollick
sky: as you mentioned, the default copy ctor and assignment operator are fine. Removed mine. ...
9 years, 6 months ago (2011-06-17 19:17:57 UTC) #26
sky
LGTM
9 years, 6 months ago (2011-06-17 19:41:24 UTC) #27
Ian Vollick
Updated compositor_win.cc after testing on Windows. Also updated views_unittest.cc. Note: this test will not pass ...
9 years, 6 months ago (2011-06-24 15:39:52 UTC) #28
sky
Can you add operator==. Also, you'll need to sync up again and change LayerAnimator. Sorry.
9 years, 6 months ago (2011-06-24 16:03:35 UTC) #29
Ian Vollick
On 2011/06/24 16:03:35, sky wrote: > Can you add operator==. Also, you'll need to sync ...
9 years, 6 months ago (2011-06-24 20:18:47 UTC) #30
sky
LGTM with the following fixed. http://codereview.chromium.org/7044062/diff/41001/ui/gfx/compositor/compositor_win.cc File ui/gfx/compositor/compositor_win.cc (right): http://codereview.chromium.org/7044062/diff/41001/ui/gfx/compositor/compositor_win.cc#newcode344 ui/gfx/compositor/compositor_win.cc:344: std::swap(transform_matrix._12,transform_matrix._21); nit: space after ...
9 years, 6 months ago (2011-06-24 20:58:19 UTC) #31
tfarina
http://codereview.chromium.org/7044062/diff/41001/ui/gfx/transform_unittest.cc File ui/gfx/transform_unittest.cc (right): http://codereview.chromium.org/7044062/diff/41001/ui/gfx/transform_unittest.cc#newcode1 ui/gfx/transform_unittest.cc:1: // Copyright (c) 2006-2011 The Chromium Authors. All rights ...
9 years, 6 months ago (2011-06-25 00:19:19 UTC) #32
Ian Vollick
> http://codereview.chromium.org/7044062/diff/41001/ui/gfx/transform_unittest.cc#newcode1 > ui/gfx/transform_unittest.cc:1: // Copyright (c) 2006-2011 The Chromium Authors. > All rights reserved. ...
9 years, 5 months ago (2011-07-04 19:00:08 UTC) #33
tomhudson
http://codereview.chromium.org/7044062/diff/62001/ui/gfx/canvas.h File ui/gfx/canvas.h (right): http://codereview.chromium.org/7044062/diff/62001/ui/gfx/canvas.h#newcode217 ui/gfx/canvas.h:217: #if !defined(OS_MACOSX) OK, after so much work has been ...
9 years, 5 months ago (2011-07-06 14:18:15 UTC) #34
vollick1
Hi Tom, Transform and SkMatrix44 were not to be built as part of the mac ...
9 years, 5 months ago (2011-07-06 14:52:13 UTC) #35
tomhudson
On 2011/07/06 14:52:13, vollick_google.com wrote: > Hi Tom, > > Transform and SkMatrix44 were not ...
9 years, 5 months ago (2011-07-06 15:43:11 UTC) #36
sky
9 years, 5 months ago (2011-07-06 15:49:21 UTC) #37
On Wed, Jul 6, 2011 at 8:43 AM,  <tomhudson@google.com> wrote:
> On 2011/07/06 14:52:13, vollick_google.com wrote:
>>
>> Hi Tom,
>
>> Transform and SkMatrix44 were not to be built as part of the mac build and
>> #ifdef'ing out this function was a simple way of getting the canvas code
>> to
>> compile on the mac (this function isn't used on the mac right now). When
>> the
>> need arises, I think Transform, SkMatrix44 and this function can all be
>> pulled back in pretty easily.
>
> Ian,
>
> I'd just like to understand *why* these things don't belong in the Mac
> build,
> and how the interface makes sense if the Mac clients can use the class
> without
> calling transform(), while non-Mac clients need to call transform().
>
> http://codereview.chromium.org/7044062/
>

The code that uses this is currently windows/linux specific, which is
why it is ifdef'd there. If someone has a need for it on the mac side,
then we can make it be built there.

  -Scott

Powered by Google App Engine
This is Rietveld 408576698