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

Issue 27223008: Provide approximate type functions for SkMatrix44. (Closed)

Created:
7 years, 2 months ago by Dominik Grewe
Modified:
7 years, 2 months ago
Reviewers:
danakj, shawnsingh
CC:
chromium-reviews, cc-bugs_chromium.org, Tom Hudson
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Provide approximate type functions for SkMatrix44. Skia's SkMatrix44 class provides methods for computing the type of a matrix using exact computations, i.e. matrix values must be of exactly some value. However, in some cases some inaccuracy can be tolerated. This patch adds an implementation of IsApproximatelyIdentityOrTranslation() as part of the gfx::Transform class. This replaces the same computation in picture_layer_tiling.cc. Should any other approximate type computations on gfx::Transform matrices be necessary they should be added to gfx::Transform directly. BUG=293787 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=229609

Patch Set 1 #

Total comments: 16

Patch Set 2 : Clean up. #

Patch Set 3 : Rename functions taking gfx::Transform. #

Total comments: 2

Patch Set 4 : Remove IsApproximatelyIntegerTransform #

Patch Set 5 : Re-upload. #

Total comments: 4

Patch Set 6 : Move code to gfx::Transform class. #

Total comments: 3

Patch Set 7 : Clean up. #

Patch Set 8 : Pass constants as float not double in unit test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -31 lines) Patch
M cc/resources/picture_layer_tiling.cc View 1 2 3 4 5 2 chunks +4 lines, -31 lines 0 comments Download
M ui/gfx/transform.h View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gfx/transform.cc View 1 2 3 4 5 6 7 2 chunks +27 lines, -0 lines 0 comments Download
M ui/gfx/transform_unittest.cc View 1 2 3 4 5 6 7 2 chunks +77 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Dominik Grewe
PTAL. The approximate computation introduced by epenner@ in http://crrev.com/19271005 seems to have been removed. I've ...
7 years, 2 months ago (2013-10-15 14:03:39 UTC) #1
danakj
https://codereview.chromium.org/27223008/diff/1/cc/base/math_util.cc File cc/base/math_util.cc (right): https://codereview.chromium.org/27223008/diff/1/cc/base/math_util.cc#newcode22 cc/base/math_util.cc:22: static inline bool SkMScalarApproximatelyEqual(SkMScalar x, SkMScalar y, can you ...
7 years, 2 months ago (2013-10-15 15:34:35 UTC) #2
Dominik Grewe
Thanks for the feedback! https://codereview.chromium.org/27223008/diff/1/cc/base/math_util.cc File cc/base/math_util.cc (right): https://codereview.chromium.org/27223008/diff/1/cc/base/math_util.cc#newcode22 cc/base/math_util.cc:22: static inline bool SkMScalarApproximatelyEqual(SkMScalar x, ...
7 years, 2 months ago (2013-10-15 17:04:19 UTC) #3
Dominik Grewe
It turns out that IsMatrixApproximatelyIntegerTransform isn't currently needed any more. Shall I remove it from ...
7 years, 2 months ago (2013-10-16 08:54:38 UTC) #4
shawnsingh
I'm OK with removing IsMatrixApproximatelyIntegerTransform if you wish =) one comment below. But otherwise looks ...
7 years, 2 months ago (2013-10-16 11:43:34 UTC) #5
Dominik Grewe
https://codereview.chromium.org/27223008/diff/10001/cc/base/math_util.cc File cc/base/math_util.cc (right): https://codereview.chromium.org/27223008/diff/10001/cc/base/math_util.cc#newcode22 cc/base/math_util.cc:22: inline bool ApproximatelyEqual(SkMScalar x, SkMScalar y, SkMScalar tolerance) { ...
7 years, 2 months ago (2013-10-16 12:46:22 UTC) #6
Dominik Grewe
I removed IsApproximatelyIntegerTransform(). So there's no need for a generic ApproximatelyEquals() method any more and ...
7 years, 2 months ago (2013-10-16 16:00:23 UTC) #7
danakj
Can you upload again? Getting chunk mismatch errors. On Wed, Oct 16, 2013 at 12:00 ...
7 years, 2 months ago (2013-10-16 16:02:36 UTC) #8
Dominik Grewe
On 2013/10/16 16:02:36, danakj wrote: > Can you upload again? Getting chunk mismatch errors. Done.
7 years, 2 months ago (2013-10-16 16:13:07 UTC) #9
danakj
https://codereview.chromium.org/27223008/diff/27001/cc/base/math_util.cc File cc/base/math_util.cc (right): https://codereview.chromium.org/27223008/diff/27001/cc/base/math_util.cc#newcode29 cc/base/math_util.cc:29: return std::abs(x-SkDoubleToMScalar(1.0)) <= tolerance; spaces around - https://codereview.chromium.org/27223008/diff/27001/cc/base/math_util.h File ...
7 years, 2 months ago (2013-10-16 19:04:14 UTC) #10
shawnsingh
LGTM =) I'm concerned that the DCHECK will have a perf hit since we're putting ...
7 years, 2 months ago (2013-10-16 19:05:36 UTC) #11
shawnsingh
> The goal is to move everything in this class into ui/gfx/ and I don't ...
7 years, 2 months ago (2013-10-16 19:09:51 UTC) #12
danakj
On Wed, Oct 16, 2013 at 3:09 PM, <shawnsingh@chromium.org> wrote: > The goal is to ...
7 years, 2 months ago (2013-10-16 19:12:33 UTC) #13
shawnsingh
OK, SGTM I'm happy with that. In Dominik's defense, he was doing what several of ...
7 years, 2 months ago (2013-10-16 19:14:08 UTC) #14
Dominik Grewe
I've moved the code to the gfx::Transform class. Please have another look.
7 years, 2 months ago (2013-10-17 16:57:47 UTC) #15
danakj
LGTM with some style nits https://codereview.chromium.org/27223008/diff/37001/ui/gfx/transform.cc File ui/gfx/transform.cc (right): https://codereview.chromium.org/27223008/diff/37001/ui/gfx/transform.cc#newcode225 ui/gfx/transform.cc:225: ApproximatelyOne (matrix_.get(0, 0), tolerance) ...
7 years, 2 months ago (2013-10-17 17:43:17 UTC) #16
Dominik Grewe
Thanks!
7 years, 2 months ago (2013-10-17 18:27:41 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dominikg@chromium.org/27223008/42001
7 years, 2 months ago (2013-10-17 18:35:49 UTC) #18
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 2 months ago (2013-10-17 22:07:23 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dominikg@chromium.org/27223008/67001
7 years, 2 months ago (2013-10-18 21:30:44 UTC) #20
commit-bot: I haz the power
7 years, 2 months ago (2013-10-19 18:26:09 UTC) #21
Message was sent while issue was closed.
Change committed as 229609

Powered by Google App Engine
This is Rietveld 408576698