Chromium Code Reviews| Index: third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| index c286f069f65efba7d5c194963e6b69a5bd3a168b..3250eb45808d45f826d885811fb4ce388004f173 100644 |
| --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| @@ -612,8 +612,10 @@ void VRDisplay::submitFrame() { |
| gl->ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |
| int idx = m_framePose->poseIndex; |
| // Careful with the arithmetic here. Float color 1.f is equivalent to int 255. |
| - gl->ClearColor((idx & 255) / 255.0f, ((idx >> 8) & 255) / 255.0f, |
| - ((idx >> 16) & 255) / 255.0f, 1.0f); |
| + // Use the low byte of the index as the red component, and store an arbitrary |
| + // magic number in green/blue. This number must match the reading code in |
| + // vr_shell.cc. Avoid all-black/all-white. |
| + gl->ClearColor((idx & 255) / 255.0f, 42 / 255.0f, 142 / 255.0f, 1.0f); |
|
mthiesse
2016/12/01 21:53:15
Make constants for the magic numbers, here and in
klausw
2016/12/01 22:36:04
Done.
|
| gl->Clear(GL_COLOR_BUFFER_BIT); |
| // Set the GL state back to what was set by the WebVR application. |