#include <algorithm>
#include <iomanip>
#include <queue>
#include <sstream>
#include <string>
#include <utility>
#include "chrome/browser/vr/ui.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/numerics/angle_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "chrome/browser/vr/model/model.h"
#include "chrome/browser/vr/skia_surface_provider_factory.h"
#include "chrome/browser/vr/ui_element_renderer.h"
#include "chrome/browser/vr/ui_renderer.h"
#include "chrome/browser/vr/ui_scene.h"
#include "chrome/browser/vr/ui_scene_constants.h"
#include "chrome/browser/vr/ui_scene_creator.h"
#include "chrome/browser/vr/ui_test_input.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace vr {
namespace {
constexpr float kMargin = …;
UiElementName UserFriendlyElementNameToUiElementName(
UserFriendlyElementName name) { … }
}
Ui::Ui()
: … { … }
Ui::~Ui() = default;
base::WeakPtr<BrowserUiInterface> Ui::GetBrowserUiWeakPtr() { … }
SchedulerUiInterface* Ui::GetSchedulerUiPtr() { … }
void Ui::SetCapturingState(const CapturingStateModel& active_capturing,
const CapturingStateModel& background_capturing,
const CapturingStateModel& potential_capturing) { … }
void Ui::OnGlInitialized() { … }
void Ui::OnWebXrFrameAvailable() { … }
void Ui::OnWebXrTimeoutImminent() { … }
void Ui::OnWebXrTimedOut() { … }
bool Ui::GetElementVisibility(UserFriendlyElementName element_name) { … }
gfx::Point3F Ui::GetTargetPointForTesting(UserFriendlyElementName element_name,
const gfx::PointF& position) { … }
void Ui::SetVisibleExternalPromptNotification(
ExternalPromptNotificationType prompt) { … }
bool Ui::OnBeginFrame(base::TimeTicks current_time,
const gfx::Transform& head_pose) { … }
bool Ui::SceneHasDirtyTextures() const { … }
void Ui::UpdateSceneTextures() { … }
void Ui::Draw(const vr::RenderInfo& info) { … }
void Ui::DrawWebVrOverlayForeground(const vr::RenderInfo& info) { … }
bool Ui::HasWebXrOverlayElementsToDraw() { … }
std::pair<FovRectangle, FovRectangle> Ui::GetMinimalFovForWebXrOverlayElements(
const gfx::Transform& left_view,
const FovRectangle& fov_recommended_left,
const gfx::Transform& right_view,
const FovRectangle& fov_recommended_right,
float z_near) { … }
FovRectangle Ui::GetMinimalFov(const gfx::Transform& view_matrix,
const std::vector<const UiElement*>& elements,
const FovRectangle& fov_recommended,
float z_near) { … }
}