WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
113263
[BlackBerry] WebOverlay::pixelViewportRect() should return pixel viewport coordinates
https://bugs.webkit.org/show_bug.cgi?id=113263
Summary
[BlackBerry] WebOverlay::pixelViewportRect() should return pixel viewport coo...
Arvid Nilsson
Reported
2013-03-25 18:45:09 PDT
But today returns window coordinates, which sometimes happen to coincide with the pixel viewport coordinates, sometimes not. PR 312404
Attachments
Patch
(10.31 KB, patch)
2013-03-25 18:54 PDT
,
Arvid Nilsson
no flags
Details
Formatted Diff
Diff
Patch
(10.13 KB, patch)
2013-03-26 07:50 PDT
,
Arvid Nilsson
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Arvid Nilsson
Comment 1
2013-03-25 18:54:41 PDT
Created
attachment 194974
[details]
Patch
Mike Fenton
Comment 2
2013-03-26 07:36:38 PDT
Comment on
attachment 194974
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=194974&action=review
> Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp:573 > + FloatRect result = toPixelCoordinates(rect, m_viewport, surfaceHeight);
A more meaningful variable than result could be helpful here. pixelRect? As well, if the delta calculation was put ahead the calculation, adjustment and return would all be nicely grouped.
> Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp:583 > + FloatRect result = toPixelCoordinates(rect, m_viewport, surfaceHeight);
See other comment. Could this function be FloatRect pixelRect(toPixelViewCoordinates(rect); pixelRect.scale(1 / m_scale); return enclosingIntRect(pixelRect);
Arvid Nilsson
Comment 3
2013-03-26 07:44:09 PDT
Comment on
attachment 194974
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=194974&action=review
>> Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp:573 >> + FloatRect result = toPixelCoordinates(rect, m_viewport, surfaceHeight); > > A more meaningful variable than result could be helpful here. pixelRect? > > As well, if the delta calculation was put ahead the calculation, adjustment and return would all be nicely grouped.
Good point
>> Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp:583 >> + FloatRect result = toPixelCoordinates(rect, m_viewport, surfaceHeight); > > See other comment. > > Could this function be > FloatRect pixelRect(toPixelViewCoordinates(rect); > pixelRect.scale(1 / m_scale); > return enclosingIntRect(pixelRect);
The reason I opted for some code duplication here was to get floating point precision, unfortunately toPixelViewportCoordinates returns an IntPoint. However, the rounding should be harmless, I'll go for your suggestion instead to keep it DRY.
Arvid Nilsson
Comment 4
2013-03-26 07:50:35 PDT
Created
attachment 195086
[details]
Patch
Mike Fenton
Comment 5
2013-03-26 07:57:20 PDT
Comment on
attachment 195086
[details]
Patch Looks good to me.
Rob Buis
Comment 6
2013-03-26 08:03:17 PDT
Comment on
attachment 195086
[details]
Patch LGTM.
Arvid Nilsson
Comment 7
2013-03-26 10:43:12 PDT
Comment on
attachment 195086
[details]
Patch Thanks Rob and Jakob!
Arvid Nilsson
Comment 8
2013-03-26 10:43:31 PDT
(In reply to
comment #7
)
> (From update of
attachment 195086
[details]
) > Thanks Rob and Jakob!
Err, I mean Rob and Mike.
WebKit Review Bot
Comment 9
2013-03-26 10:46:52 PDT
Comment on
attachment 195086
[details]
Patch Clearing flags on attachment: 195086 Committed
r146906
: <
http://trac.webkit.org/changeset/146906
>
WebKit Review Bot
Comment 10
2013-03-26 10:46:55 PDT
All reviewed patches have been landed. Closing bug.
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