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

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell_gl.cc

Issue 2869273008: VR: Fix cursor draw order. (Closed)
Patch Set: Add comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_gl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" 5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h"
6 6
7 #include <chrono> 7 #include <chrono>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 24 matching lines...) Expand all
35 #include "ui/gl/android/surface_texture.h" 35 #include "ui/gl/android/surface_texture.h"
36 #include "ui/gl/gl_bindings.h" 36 #include "ui/gl/gl_bindings.h"
37 #include "ui/gl/gl_context.h" 37 #include "ui/gl/gl_context.h"
38 #include "ui/gl/gl_surface.h" 38 #include "ui/gl/gl_surface.h"
39 #include "ui/gl/init/gl_factory.h" 39 #include "ui/gl/init/gl_factory.h"
40 40
41 namespace vr_shell { 41 namespace vr_shell {
42 42
43 namespace { 43 namespace {
44 static constexpr float kZNear = 0.1f; 44 static constexpr float kZNear = 0.1f;
45 static constexpr float kZFar = 1000.0f; 45 // This should be kept fairly small with current reticle rendering technique
46 // which requires fairly high precision to draw on top of elements correctly.
47 static constexpr float kZFar = 100.0f;
46 48
47 static constexpr float kReticleWidth = 0.025f; 49 static constexpr float kReticleWidth = 0.025f;
48 static constexpr float kReticleHeight = 0.025f; 50 static constexpr float kReticleHeight = 0.025f;
49 51
50 static constexpr float kLaserWidth = 0.01f; 52 static constexpr float kLaserWidth = 0.01f;
51 53
52 static constexpr gfx::Point3F kOrigin = {0.0f, 0.0f, 0.0f}; 54 static constexpr gfx::Point3F kOrigin = {0.0f, 0.0f, 0.0f};
53 55
54 // Fraction of the distance to the object the cursor is drawn at to avoid 56 // Fraction of the distance to the object the cursor is drawn at to avoid
55 // rounding errors drawing the cursor behind the object. 57 // rounding errors drawing the cursor behind the object.
56 static constexpr float kReticleOffset = 0.99f; 58 // TODO(mthiesse): Find a better approach for drawing the reticle on an object.
59 // Right now we have to wedge it very precisely between the content window and
60 // backplane to avoid rendering artifacts.
61 static constexpr float kReticleOffset = 0.999f;
57 62
58 // GVR buffer indices for use with viewport->SetSourceBufferIndex 63 // GVR buffer indices for use with viewport->SetSourceBufferIndex
59 // or frame.BindBuffer. We use one for world content (with reprojection) 64 // or frame.BindBuffer. We use one for world content (with reprojection)
60 // including main VrShell and WebVR content plus world-space UI. 65 // including main VrShell and WebVR content plus world-space UI.
61 // The headlocked buffer is for UI that should not use reprojection. 66 // The headlocked buffer is for UI that should not use reprojection.
62 static constexpr int kFramePrimaryBuffer = 0; 67 static constexpr int kFramePrimaryBuffer = 0;
63 static constexpr int kFrameHeadlockedBuffer = 1; 68 static constexpr int kFrameHeadlockedBuffer = 1;
64 69
65 // Pixel dimensions and field of view for the head-locked content. This 70 // Pixel dimensions and field of view for the head-locked content. This
66 // is currently sized to fit the WebVR "insecure transport" warnings, 71 // is currently sized to fit the WebVR "insecure transport" warnings,
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 QuatToMatrix(controller_quat_, &mat); 531 QuatToMatrix(controller_quat_, &mat);
527 gfx::Vector3dF controller_direction = 532 gfx::Vector3dF controller_direction =
528 vr::MatrixVectorMul(mat, ergo_neutral_pose); 533 vr::MatrixVectorMul(mat, ergo_neutral_pose);
529 534
530 HandleControllerAppButtonActivity(controller_direction); 535 HandleControllerAppButtonActivity(controller_direction);
531 536
532 if (ShouldDrawWebVr()) 537 if (ShouldDrawWebVr())
533 return; 538 return;
534 gfx::PointF target_local_point; 539 gfx::PointF target_local_point;
535 gfx::Vector3dF eye_to_target; 540 gfx::Vector3dF eye_to_target;
536 cursor_render_target_ = nullptr; 541 reticle_render_target_ = nullptr;
537 GetVisualTargetElement(controller_direction, eye_to_target, target_point_, 542 GetVisualTargetElement(controller_direction, eye_to_target, target_point_,
538 &cursor_render_target_, target_local_point); 543 &reticle_render_target_, target_local_point);
539 544
540 UiElement* target_element = nullptr; 545 UiElement* target_element = nullptr;
541 if (input_locked_element_) { 546 if (input_locked_element_) {
542 gfx::Point3F plane_intersection_point; 547 gfx::Point3F plane_intersection_point;
543 float distance_to_plane; 548 float distance_to_plane;
544 GetTargetLocalPoint(eye_to_target, *input_locked_element_, 549 GetTargetLocalPoint(eye_to_target, *input_locked_element_,
545 2 * scene_->GetBackgroundDistance(), target_local_point, 550 2 * scene_->GetBackgroundDistance(), target_local_point,
546 plane_intersection_point, distance_to_plane); 551 plane_intersection_point, distance_to_plane);
547 target_element = input_locked_element_; 552 target_element = input_locked_element_;
548 } else if (!in_scroll_ && !in_click_) { 553 } else if (!in_scroll_ && !in_click_) {
549 target_element = cursor_render_target_; 554 target_element = reticle_render_target_;
550 } 555 }
551 556
552 // Handle input targeting on the content quad, ignoring any other elements. 557 // Handle input targeting on the content quad, ignoring any other elements.
553 // Content is treated specially to accomodate scrolling, flings, etc. 558 // Content is treated specially to accomodate scrolling, flings, etc.
554 gfx::Point local_point_pixels; 559 gfx::Point local_point_pixels;
555 if (target_element && (target_element->fill() == Fill::CONTENT)) { 560 if (target_element && (target_element->fill() == Fill::CONTENT)) {
556 gfx::RectF pixel_rect(0, 0, content_tex_css_width_, 561 gfx::RectF pixel_rect(0, 0, content_tex_css_width_,
557 content_tex_css_height_); 562 content_tex_css_height_);
558 local_point_pixels.set_x(pixel_rect.x() + 563 local_point_pixels.set_x(pixel_rect.x() +
559 pixel_rect.width() * target_local_point.x()); 564 pixel_rect.width() * target_local_point.x());
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 vr::Mat4f eye_view_matrix; 1089 vr::Mat4f eye_view_matrix;
1085 vr::Mat4f eye_matrix; 1090 vr::Mat4f eye_matrix;
1086 GvrMatToMatf(gvr_api_->GetEyeFromHeadMatrix(eye), &eye_matrix); 1091 GvrMatToMatf(gvr_api_->GetEyeFromHeadMatrix(eye), &eye_matrix);
1087 vr::MatrixMul(eye_matrix, head_pose, &eye_view_matrix); 1092 vr::MatrixMul(eye_matrix, head_pose, &eye_view_matrix);
1088 1093
1089 const gfx::RectF& rect = GfxRectFromUV(buffer_viewport_->GetSourceUv()); 1094 const gfx::RectF& rect = GfxRectFromUV(buffer_viewport_->GetSourceUv());
1090 const gfx::Rect& pixel_rect = CalculatePixelSpaceRect(render_size, rect); 1095 const gfx::Rect& pixel_rect = CalculatePixelSpaceRect(render_size, rect);
1091 glViewport(pixel_rect.x(), pixel_rect.y(), pixel_rect.width(), 1096 glViewport(pixel_rect.x(), pixel_rect.y(), pixel_rect.width(),
1092 pixel_rect.height()); 1097 pixel_rect.height());
1093 1098
1094 vr::Mat4f render_matrix; 1099 vr::Mat4f view_proj_matrix;
1095 vr::Mat4f perspective_matrix; 1100 vr::Mat4f perspective_matrix;
1096 GvrMatToMatf(PerspectiveMatrixFromView(buffer_viewport_->GetSourceFov(), 1101 GvrMatToMatf(PerspectiveMatrixFromView(buffer_viewport_->GetSourceFov(),
1097 kZNear, kZFar), 1102 kZNear, kZFar),
1098 &perspective_matrix); 1103 &perspective_matrix);
1099 1104
1100 vr::MatrixMul(perspective_matrix, eye_view_matrix, &render_matrix); 1105 vr::MatrixMul(perspective_matrix, eye_view_matrix, &view_proj_matrix);
1101 1106
1102 DrawElements(render_matrix, elementsInDrawOrder); 1107 DrawElements(view_proj_matrix, elementsInDrawOrder, draw_cursor);
1103 if (draw_cursor) { 1108 if (draw_cursor) {
1104 DrawController(render_matrix); 1109 DrawLaser(view_proj_matrix);
1105 DrawCursor(render_matrix); 1110 DrawController(view_proj_matrix);
1106 } 1111 }
1107 } 1112 }
1108 } 1113 }
1109 1114
1110 void VrShellGl::DrawElements(const vr::Mat4f& view_proj_matrix, 1115 void VrShellGl::DrawElements(const vr::Mat4f& view_proj_matrix,
1111 const std::vector<const UiElement*>& elements) { 1116 const std::vector<const UiElement*>& elements,
1112 for (const auto* rect : elements) { 1117 bool draw_cursor) {
cjgrant 2017/05/11 17:21:52 draw_reticle (maybe elsewhere, based on your other
mthiesse 2017/05/11 17:55:02 Done.
1118 if (elements.empty())
1119 return;
1120 int initial_draw_phase = elements.front()->draw_phase();
1121 bool drawn_cursor = false;
1122 for (const auto* element : elements) {
1123 // If we have no element to draw the cursor on, draw it after the
cjgrant 2017/05/11 17:21:52 This seems fragile (ie. assuming which elements ar
mthiesse 2017/05/11 17:55:02 Won't work because the cursor is partially transpa
1124 // background (the initial draw phase).
1125 if (!reticle_render_target_ && draw_cursor && !drawn_cursor &&
1126 element->draw_phase() > initial_draw_phase) {
1127 DrawReticle(view_proj_matrix);
1128 drawn_cursor = true;
1129 }
1113 vr::Mat4f transform; 1130 vr::Mat4f transform;
cjgrant 2017/05/11 17:21:52 Suggestion - now that this method is mixing in ret
mthiesse 2017/05/11 17:55:02 Done.
1114 vr::MatrixMul(view_proj_matrix, rect->TransformMatrix(), &transform); 1131 vr::MatrixMul(view_proj_matrix, element->TransformMatrix(), &transform);
1115 1132
1116 switch (rect->fill()) { 1133 switch (element->fill()) {
1117 case Fill::OPAQUE_GRADIENT: { 1134 case Fill::OPAQUE_GRADIENT: {
1118 vr_shell_renderer_->GetGradientQuadRenderer()->Draw( 1135 vr_shell_renderer_->GetGradientQuadRenderer()->Draw(
1119 transform, rect->edge_color(), rect->center_color(), 1136 transform, element->edge_color(), element->center_color(),
1120 rect->computed_opacity()); 1137 element->computed_opacity());
1121 break; 1138 break;
1122 } 1139 }
1123 case Fill::GRID_GRADIENT: { 1140 case Fill::GRID_GRADIENT: {
1124 vr_shell_renderer_->GetGradientGridRenderer()->Draw( 1141 vr_shell_renderer_->GetGradientGridRenderer()->Draw(
1125 transform, rect->edge_color(), rect->center_color(), 1142 transform, element->edge_color(), element->center_color(),
1126 rect->gridline_count(), rect->computed_opacity()); 1143 element->gridline_count(), element->computed_opacity());
1127 break; 1144 break;
1128 } 1145 }
1129 case Fill::CONTENT: { 1146 case Fill::CONTENT: {
1130 gfx::RectF copy_rect(0, 0, 1, 1); 1147 gfx::RectF copy_rect(0, 0, 1, 1);
1131 vr_shell_renderer_->GetExternalTexturedQuadRenderer()->Draw( 1148 vr_shell_renderer_->GetExternalTexturedQuadRenderer()->Draw(
1132 content_texture_id_, transform, copy_rect, 1149 content_texture_id_, transform, copy_rect,
1133 rect->computed_opacity()); 1150 element->computed_opacity());
1134 break; 1151 break;
1135 } 1152 }
1136 case Fill::SELF: { 1153 case Fill::SELF: {
1137 rect->Render(vr_shell_renderer_.get(), transform); 1154 element->Render(vr_shell_renderer_.get(), transform);
1138 break; 1155 break;
1139 } 1156 }
1140 default: 1157 default:
1141 break; 1158 break;
1142 } 1159 }
1160
1161 if (draw_cursor && (reticle_render_target_ == element)) {
1162 DrawReticle(view_proj_matrix);
1163 }
1143 } 1164 }
1144 vr_shell_renderer_->Flush(); 1165 vr_shell_renderer_->Flush();
cjgrant 2017/05/11 17:21:51 I assume no side effects of now skipping this Flus
mthiesse 2017/05/11 17:55:29 Correct.
1145 } 1166 }
1146 1167
1147 std::vector<const UiElement*> VrShellGl::GetElementsInDrawOrder( 1168 std::vector<const UiElement*> VrShellGl::GetElementsInDrawOrder(
1148 const vr::Mat4f& view_matrix, 1169 const vr::Mat4f& view_matrix,
1149 const std::vector<const UiElement*>& elements) { 1170 const std::vector<const UiElement*>& elements) {
1150 std::vector<const UiElement*> sorted_elements = elements; 1171 std::vector<const UiElement*> sorted_elements = elements;
1151 1172
1152 // Sort elements primarily based on their draw phase (lower draw phase first) 1173 // Sort elements primarily based on their draw phase (lower draw phase first)
1153 // and secondarily based on their z-axis distance (more distant first). 1174 // and secondarily based on their z-axis distance (more distant first).
1154 // TODO(mthiesse, crbug.com/721356): This will not work well for elements not 1175 // TODO(mthiesse, crbug.com/721356): This will not work well for elements not
1155 // directly in front of the user, but works well enough for our initial 1176 // directly in front of the user, but works well enough for our initial
1156 // release, and provides a consistent ordering that we can easily design 1177 // release, and provides a consistent ordering that we can easily design
1157 // around. 1178 // around.
1158 std::sort(sorted_elements.begin(), sorted_elements.end(), 1179 std::sort(sorted_elements.begin(), sorted_elements.end(),
1159 [](const UiElement* first, const UiElement* second) { 1180 [](const UiElement* first, const UiElement* second) {
1160 if (first->draw_phase() != second->draw_phase()) { 1181 if (first->draw_phase() != second->draw_phase()) {
1161 return first->draw_phase() < second->draw_phase(); 1182 return first->draw_phase() < second->draw_phase();
1162 } else { 1183 } else {
1163 return vr::GetTranslation(first->TransformMatrix()).z() < 1184 return vr::GetTranslation(first->TransformMatrix()).z() <
1164 vr::GetTranslation(second->TransformMatrix()).z(); 1185 vr::GetTranslation(second->TransformMatrix()).z();
1165 } 1186 }
1166 }); 1187 });
1167 1188
1168 return sorted_elements; 1189 return sorted_elements;
1169 } 1190 }
1170 1191
1171 void VrShellGl::DrawCursor(const vr::Mat4f& render_matrix) { 1192 void VrShellGl::DrawReticle(const vr::Mat4f& render_matrix) {
1172 vr::Mat4f mat; 1193 vr::Mat4f mat;
1173 vr::SetIdentityM(&mat); 1194 vr::SetIdentityM(&mat);
1174 1195
1175 // Draw the reticle. 1196 // Scale the reticle to have a fixed FOV size at any distance.
1176
1177 // Scale the pointer to have a fixed FOV size at any distance.
1178 const float eye_to_target = 1197 const float eye_to_target =
1179 std::sqrt(target_point_.SquaredDistanceTo(kOrigin)); 1198 std::sqrt(target_point_.SquaredDistanceTo(kOrigin));
1180 vr::ScaleM( 1199 vr::ScaleM(
1181 mat, 1200 mat,
1182 {kReticleWidth * eye_to_target, kReticleHeight * eye_to_target, 1.0f}, 1201 {kReticleWidth * eye_to_target, kReticleHeight * eye_to_target, 1.0f},
1183 &mat); 1202 &mat);
1184 1203
1185 vr::Quatf rotation; 1204 vr::Quatf rotation;
1186 if (cursor_render_target_ != nullptr) { 1205 if (reticle_render_target_ != nullptr) {
1187 // Make the reticle planar to the element it's hitting. 1206 // Make the reticle planar to the element it's hitting.
1188 rotation = GetRotationFromZAxis(cursor_render_target_->GetNormal()); 1207 rotation = GetRotationFromZAxis(reticle_render_target_->GetNormal());
1189 } else { 1208 } else {
1190 // Rotate the cursor to directly face the eyes. 1209 // Rotate the cursor to directly face the eyes.
1191 rotation = GetRotationFromZAxis(target_point_ - kOrigin); 1210 rotation = GetRotationFromZAxis(target_point_ - kOrigin);
1192 } 1211 }
1193 vr::Mat4f rotation_mat; 1212 vr::Mat4f rotation_mat;
1194 vr::QuatToMatrix(rotation, &rotation_mat); 1213 vr::QuatToMatrix(rotation, &rotation_mat);
1195 vr::MatrixMul(rotation_mat, mat, &mat); 1214 vr::MatrixMul(rotation_mat, mat, &mat);
1196 1215
1197 gfx::Point3F target_point = ScalePoint(target_point_, kReticleOffset); 1216 gfx::Point3F target_point = ScalePoint(target_point_, kReticleOffset);
1198 // Place the pointer slightly in front of the plane intersection point. 1217 // Place the pointer slightly in front of the plane intersection point.
1199 vr::TranslateM(mat, target_point - kOrigin, &mat); 1218 vr::TranslateM(mat, target_point - kOrigin, &mat);
1200 1219
1201 vr::Mat4f transform; 1220 vr::Mat4f transform;
1202 vr::MatrixMul(render_matrix, mat, &transform); 1221 vr::MatrixMul(render_matrix, mat, &transform);
1203 vr_shell_renderer_->GetReticleRenderer()->Draw(transform); 1222 vr_shell_renderer_->GetReticleRenderer()->Draw(transform);
1223 }
1204 1224
1205 // Draw the laser. 1225 void VrShellGl::DrawLaser(const vr::Mat4f& render_matrix) {
1206 1226 gfx::Point3F target_point = ScalePoint(target_point_, kReticleOffset);
1207 // Find the length of the beam (from hand to target). 1227 // Find the length of the beam (from hand to target).
1208 const float laser_length = 1228 const float laser_length =
1209 std::sqrt(pointer_start_.SquaredDistanceTo(target_point)); 1229 std::sqrt(pointer_start_.SquaredDistanceTo(target_point));
1210 1230
1231 vr::Mat4f mat;
1211 // Build a beam, originating from the origin. 1232 // Build a beam, originating from the origin.
1212 vr::SetIdentityM(&mat); 1233 vr::SetIdentityM(&mat);
1213 1234
1214 // Move the beam half its height so that its end sits on the origin. 1235 // Move the beam half its height so that its end sits on the origin.
1215 vr::TranslateM(mat, {0.0f, 0.5f, 0.0f}, &mat); 1236 vr::TranslateM(mat, {0.0f, 0.5f, 0.0f}, &mat);
1216 vr::ScaleM(mat, {kLaserWidth, laser_length, 1}, &mat); 1237 vr::ScaleM(mat, {kLaserWidth, laser_length, 1}, &mat);
1217 1238
1218 // Tip back 90 degrees to flat, pointing at the scene. 1239 // Tip back 90 degrees to flat, pointing at the scene.
1219 const vr::Quatf quat = vr::QuatFromAxisAngle({1.0f, 0.0f, 0.0f, -M_PI / 2}); 1240 const vr::Quatf quat = vr::QuatFromAxisAngle({1.0f, 0.0f, 0.0f, -M_PI / 2});
1241 vr::Mat4f rotation_mat;
1220 vr::QuatToMatrix(quat, &rotation_mat); 1242 vr::QuatToMatrix(quat, &rotation_mat);
1221 vr::MatrixMul(rotation_mat, mat, &mat); 1243 vr::MatrixMul(rotation_mat, mat, &mat);
1222 1244
1223 const gfx::Vector3dF beam_direction = target_point_ - pointer_start_; 1245 const gfx::Vector3dF beam_direction = target_point_ - pointer_start_;
1224 1246
1225 vr::Mat4f beam_direction_mat; 1247 vr::Mat4f beam_direction_mat;
1226 vr::QuatToMatrix(GetRotationFromZAxis(beam_direction), &beam_direction_mat); 1248 vr::QuatToMatrix(GetRotationFromZAxis(beam_direction), &beam_direction_mat);
1227 1249
1228 float opacity = controller_->GetOpacity(); 1250 float opacity = controller_->GetOpacity();
1229 // Render multiple faces to make the laser appear cylindrical. 1251 // Render multiple faces to make the laser appear cylindrical.
1230 const int faces = 4; 1252 const int faces = 4;
1253 vr::Mat4f face_transform;
1254 vr::Mat4f transform;
1231 for (int i = 0; i < faces; i++) { 1255 for (int i = 0; i < faces; i++) {
1232 // Rotate around Z. 1256 // Rotate around Z.
1233 const float angle = M_PI * 2 * i / faces; 1257 const float angle = M_PI * 2 * i / faces;
1234 const vr::Quatf rot = vr::QuatFromAxisAngle({0.0f, 0.0f, 1.0f, angle}); 1258 const vr::Quatf rot = vr::QuatFromAxisAngle({0.0f, 0.0f, 1.0f, angle});
1235 vr::Mat4f face_transform;
1236 vr::QuatToMatrix(rot, &face_transform); 1259 vr::QuatToMatrix(rot, &face_transform);
1237 vr::MatrixMul(face_transform, mat, &face_transform); 1260 vr::MatrixMul(face_transform, mat, &face_transform);
1238 // Orient according to target direction. 1261 // Orient according to target direction.
1239 vr::MatrixMul(beam_direction_mat, face_transform, &face_transform); 1262 vr::MatrixMul(beam_direction_mat, face_transform, &face_transform);
1240 1263
1241 // Move the beam origin to the hand. 1264 // Move the beam origin to the hand.
1242 vr::TranslateM(face_transform, pointer_start_ - kOrigin, &face_transform); 1265 vr::TranslateM(face_transform, pointer_start_ - kOrigin, &face_transform);
1243
1244 vr::MatrixMul(render_matrix, face_transform, &transform); 1266 vr::MatrixMul(render_matrix, face_transform, &transform);
1245 vr_shell_renderer_->GetLaserRenderer()->Draw(opacity, transform); 1267 vr_shell_renderer_->GetLaserRenderer()->Draw(opacity, transform);
1246 } 1268 }
1247 } 1269 }
1248 1270
1249 void VrShellGl::DrawController(const vr::Mat4f& view_proj_matrix) { 1271 void VrShellGl::DrawController(const vr::Mat4f& view_proj_matrix) {
1250 if (!vr_shell_renderer_->GetControllerRenderer()->IsSetUp()) 1272 if (!vr_shell_renderer_->GetControllerRenderer()->IsSetUp())
1251 return; 1273 return;
1252 auto state = controller_->GetModelState(); 1274 auto state = controller_->GetModelState();
1253 auto opacity = controller_->GetOpacity(); 1275 auto opacity = controller_->GetOpacity();
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 // This assumes that the initial webvr_surface_size_ was set to the 1452 // This assumes that the initial webvr_surface_size_ was set to the
1431 // appropriate recommended render resolution as the default size during 1453 // appropriate recommended render resolution as the default size during
1432 // InitializeGl. Revisit if the initialization order changes. 1454 // InitializeGl. Revisit if the initialization order changes.
1433 device::mojom::VRDisplayInfoPtr info = 1455 device::mojom::VRDisplayInfoPtr info =
1434 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), 1456 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(),
1435 webvr_surface_size_, device_id); 1457 webvr_surface_size_, device_id);
1436 browser_->RunVRDisplayInfoCallback(callback, &info); 1458 browser_->RunVRDisplayInfoCallback(callback, &info);
1437 } 1459 }
1438 1460
1439 } // namespace vr_shell 1461 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_gl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698