WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
182999
[WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
https://bugs.webkit.org/show_bug.cgi?id=182999
Summary
[WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
Sergio Villar Senin
Reported
2018-02-21 05:02:15 PST
[WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
Attachments
Patch
(8.09 KB, patch)
2018-02-21 05:06 PST
,
Sergio Villar Senin
no flags
Details
Formatted Diff
Diff
Patch
(7.37 KB, patch)
2018-02-26 02:07 PST
,
Sergio Villar Senin
zan
: review+
Details
Formatted Diff
Diff
Patch
(7.35 KB, patch)
2018-02-26 03:57 PST
,
Sergio Villar Senin
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Sergio Villar Senin
Comment 1
2018-02-21 05:06:57 PST
Created
attachment 334365
[details]
Patch
Zan Dobersek
Comment 2
2018-02-22 06:28:16 PST
Comment on
attachment 334365
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=334365&action=review
> Source/WebCore/Modules/webvr/VRDisplay.cpp:49 > + , m_depthNear(0.01) // Default value from spec. > + , m_depthFar(10000) // Default value from spec.
Members that are being initialized with such constants can be initialized at the point of declaration.
> Source/WebCore/Modules/webvr/VRDisplay.h:110 > String m_displayName; > + unsigned m_displayId;
Nit: these should follow the order of the relevant getters.
> Source/WebCore/Modules/webvr/VRDisplay.h:113 > + double m_depthNear; > + double m_depthFar;
For instance: double m_depthNear { 0.01 }; double m_depthFar { 10000 };
> Source/WebCore/platform/vr/VRManager.cpp:64 > +unsigned long VRManager::s_displayIdentifier = 0; > + > +unsigned long VRManager::generateUniqueDisplayIdentifier() > +{ > + return ++s_displayIdentifier; > +}
I think this should be an implementation detail of the OpenVR backend. I.e. some other implementation may have a better way of determining the unique display identifier than to use a static counter.
> Source/WebCore/platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:36 > + m_displayInfo.displayIdentifier = VRManager::generateUniqueDisplayIdentifier();
unsigned long is being narrowed down to unsigned.
Sergio Villar Senin
Comment 3
2018-02-26 02:07:55 PST
Created
attachment 334600
[details]
Patch
Zan Dobersek
Comment 4
2018-02-26 02:35:11 PST
Comment on
attachment 334600
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=334600&action=review
> Source/WebCore/Modules/webvr/VRDisplay.h:63 > + unsigned displayId() const { return m_displayId; }
displayId attribute on the VRDisplay interface has the 'unsigned long' type, which in IDLTypes.h (through IDUnsignedLong) maps to uint32_t. IMO we should explicitly use uint32_t here too, as well as in the m_displayId declaration in this class.
> Source/WebCore/platform/vr/VRPlatformDisplay.h:50 > + unsigned long displayIdentifier;
Since this directly maps to the displayId attribute in VRDisplay, this too should be uint32_t.
> Source/WebCore/platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:38 > + m_displayInfo.displayIdentifier = ++s_displayIdentifier;
Problem is that in this case you're assigning from a 64-bit value to a 32-bit one. In reality this probably won't be a problem, but it's a small issue.
Sergio Villar Senin
Comment 5
2018-02-26 03:57:55 PST
Created
attachment 334608
[details]
Patch Patch for landing
Sergio Villar Senin
Comment 6
2018-02-26 05:38:03 PST
Committed
r229014
: <
https://trac.webkit.org/changeset/229014
>
Radar WebKit Bug Importer
Comment 7
2018-02-26 05:39:23 PST
<
rdar://problem/37898645
>
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