WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
95526
[chromium] Consolidate geometry unit testing functions for cc
https://bugs.webkit.org/show_bug.cgi?id=95526
Summary
[chromium] Consolidate geometry unit testing functions for cc
James Robinson
Reported
2012-08-30 22:20:02 PDT
[chromium] Consolidate geometry unit testing functions for cc
Attachments
Patch
(179.54 KB, patch)
2012-08-30 22:25 PDT
,
James Robinson
no flags
Details
Formatted Diff
Diff
Patch
(143.44 KB, patch)
2012-08-31 14:28 PDT
,
James Robinson
no flags
Details
Formatted Diff
Diff
fix includes
(147.59 KB, patch)
2012-08-31 14:36 PDT
,
James Robinson
jchaffraix
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
James Robinson
Comment 1
2012-08-30 22:25:00 PDT
Created
attachment 161619
[details]
Patch
James Robinson
Comment 2
2012-08-30 22:27:05 PDT
This is a deceptively easy to review patch. If you review it, I'll take you out for a free lunch *! (*offer only applies to Googlers. Must provide own transporation to/from MTV and like BigTable)
Shawn Singh
Comment 3
2012-08-30 22:41:06 PDT
Are you comfortable with using EXPECT_EQ instead of EXPECT_FLOAT_EQ? EXPECT_FLOAT_EQ has some special semantics that use ulp thresholding instead of absolute thresholding. That's why there was originally an EXPECT_FLOAT_RECT_EQ and EXPECT_INT_RECT_EQ ... But I do agree that CCLayerTreeHost version of this macro is redundant.
James Robinson
Comment 4
2012-08-30 22:42:38 PDT
(In reply to
comment #3
)
> Are you comfortable with using EXPECT_EQ instead of EXPECT_FLOAT_EQ? EXPECT_FLOAT_EQ has some special semantics that use ulp thresholding instead of absolute thresholding. > > That's why there was originally an EXPECT_FLOAT_RECT_EQ and EXPECT_INT_RECT_EQ ... >
The tests all pass with this, so it doesn't seem that this is important. If it does become important we could make the assertions that need to be fuzzy fuzzy.
Shawn Singh
Comment 5
2012-08-30 23:25:14 PDT
OK, well aside from that issue, I looked through it and it unofficially LGTM. =) It makes sense from the perspective that many floating-point operations are clamp/intersect/union, which just shuffle values around by assignment without affecting precision. But as soon as we start transforming stuff... (and considering the possibility of migrating to a float valued matrix sometime soon...) I am surprised that exact equality works!
James Robinson
Comment 6
2012-08-31 14:28:51 PDT
Created
attachment 161775
[details]
Patch
James Robinson
Comment 7
2012-08-31 14:29:35 PDT
This leaves the float ones alone - no reason to change those, and it makes the patch a touch smaller.
James Robinson
Comment 8
2012-08-31 14:36:55 PDT
Created
attachment 161776
[details]
fix includes
Shawn Singh
Comment 9
2012-08-31 14:40:29 PDT
Comment on
attachment 161776
[details]
fix includes View in context:
https://bugs.webkit.org/attachment.cgi?id=161776&action=review
> Source/WebKit/chromium/tests/CCGeometryTestUtils.h:41 > +#define EXPECT_RECT_EQ(expected, actual) \
For me personally, the reason I liked EXPECT_INT_RECT_EQ instead of EXPECT_RECT_EQ was because its a little easier to make us aware when we accidentally use floatRects/intRects inside of the wrong EXPECT macro. Again, the patch unofficially LGTM other than this.
James Robinson
Comment 10
2012-08-31 14:46:07 PDT
(In reply to
comment #9
)
> (From update of
attachment 161776
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=161776&action=review
> > > Source/WebKit/chromium/tests/CCGeometryTestUtils.h:41 > > +#define EXPECT_RECT_EQ(expected, actual) \ > > For me personally, the reason I liked EXPECT_INT_RECT_EQ instead of EXPECT_RECT_EQ was because its a little easier to make us aware when we accidentally use floatRects/intRects inside of the wrong EXPECT macro. > > Again, the patch unofficially LGTM other than this.
Well, without this patch we were also using EXPECT_EQ_RECT all over the place too. I kind of like EXPECT_RECT_EQ() for where you don't really care and EXPECT_FLOAT_RECT_EQ where you explicitly want fuzzy matching. I think this is all temporary anyway since I anticipate we'll switch to different types and just write operator== so these will all turn into EXPECT_EQ() which does the right thing on the the types provided. The motivation for this (beyond cleanup) is moving the matrix equality operator out of CCLayerTreeHostCommonTest.cpp because currently I can't get cc_unittests and webkit_compositor_unittests linking at all downstream, so I'd like to get that resolved ASAPly and follow up on any other cleanups we want later.
Shawn Singh
Comment 11
2012-08-31 14:50:34 PDT
got it - thanks for explaining. I'm good with this, we can move on. So, a little ways down the road, are you saying you'd like to implement operator== as a fuzzy ulp error threshold equality --- in production code? or just in unit test code? Is there a reason to have a fuzzy equality check in production code?
James Robinson
Comment 12
2012-08-31 14:57:30 PDT
(In reply to
comment #11
)
> got it - thanks for explaining. I'm good with this, we can move on. > > So, a little ways down the road, are you saying you'd like to implement operator== as a fuzzy ulp error threshold equality --- in production code? or just in unit test code? Is there a reason to have a fuzzy equality check in production code?
In dream land, I'd define an operator== only for testing that's fuzzy. But I don't know if that is possible or not. We don't currently have a need for operator== in production that I know of.
Julien Chaffraix
Comment 13
2012-08-31 17:17:14 PDT
Comment on
attachment 161776
[details]
fix includes View in context:
https://bugs.webkit.org/attachment.cgi?id=161776&action=review
Provided it compiles on the EWS, r=me.
>>> Source/WebKit/chromium/tests/CCGeometryTestUtils.h:41 >>> +#define EXPECT_RECT_EQ(expected, actual) \ >> >> For me personally, the reason I liked EXPECT_INT_RECT_EQ instead of EXPECT_RECT_EQ was because its a little easier to make us aware when we accidentally use floatRects/intRects inside of the wrong EXPECT macro. >> >> Again, the patch unofficially LGTM other than this. > > Well, without this patch we were also using EXPECT_EQ_RECT all over the place too. I kind of like EXPECT_RECT_EQ() for where you don't really care and EXPECT_FLOAT_RECT_EQ where you explicitly want fuzzy matching. I think this is all temporary anyway since I anticipate we'll switch to different types and just write operator== so these will all turn into EXPECT_EQ() which does the right thing on the the types provided. > > The motivation for this (beyond cleanup) is moving the matrix equality operator out of CCLayerTreeHostCommonTest.cpp because currently I can't get cc_unittests and webkit_compositor_unittests linking at all downstream, so I'd like to get that resolved ASAPly and follow up on any other cleanups we want later.
Macros don't give much guarantees that the arguments are IntRects so it's probably better to use EXPECT_RECT_EQ from that perspective. This is just my 2 cents from someone not involved as strictly in the compositor code.
James Robinson
Comment 14
2012-08-31 17:20:24 PDT
Committed
r127340
: <
http://trac.webkit.org/changeset/127340
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug