Remove texture_target from DoRuntimeInitialization
It's always TEXTURE_2D. Bug: 360147123 Change-Id: I25a9580dc1aab021b87d7516f8d099c0b4a440d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6064585 Reviewed-by: Alexander Cooper <alcooper@chromium.org> Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org> Cr-Commit-Position: refs/heads/main@{#1418860}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
6c14278644
commit
f41598b6b8
@ -21,7 +21,7 @@ ArImageTransport::ArImageTransport(
|
||||
|
||||
ArImageTransport::~ArImageTransport() = default;
|
||||
|
||||
void ArImageTransport::DoRuntimeInitialization(int texture_taget) {
|
||||
void ArImageTransport::DoRuntimeInitialization() {
|
||||
renderer_ = std::make_unique<XrRenderer>();
|
||||
glGenTextures(1, &camera_texture_arcore_.id);
|
||||
camera_texture_arcore_.target = GL_TEXTURE_EXTERNAL_OES;
|
||||
|
@ -54,7 +54,7 @@ class COMPONENT_EXPORT(VR_ARCORE) ArImageTransport
|
||||
const gfx::Transform& uv_transform);
|
||||
|
||||
private:
|
||||
void DoRuntimeInitialization(int texture_taget) override;
|
||||
void DoRuntimeInitialization() override;
|
||||
|
||||
// Makes all the relevant GL calls to actually draw the texture for the
|
||||
// runtime, will operate on the supplied framebuffer.
|
||||
|
@ -39,17 +39,12 @@ CardboardImageTransport::CardboardImageTransport(
|
||||
|
||||
CardboardImageTransport::~CardboardImageTransport() = default;
|
||||
|
||||
void CardboardImageTransport::DoRuntimeInitialization(int texture_target) {
|
||||
CHECK(texture_target == GL_TEXTURE_EXTERNAL_OES ||
|
||||
texture_target == GL_TEXTURE_2D);
|
||||
void CardboardImageTransport::DoRuntimeInitialization() {
|
||||
// TODO(crbug.com/40900864): Move this into helper classes rather than
|
||||
// directly using the cardboard types here.
|
||||
CardboardOpenGlEsDistortionRendererConfig config = {
|
||||
texture_target == GL_TEXTURE_EXTERNAL_OES
|
||||
? CardboardSupportedOpenGlEsTextureType::kGlTextureExternalOes
|
||||
: CardboardSupportedOpenGlEsTextureType::kGlTexture2D,
|
||||
CardboardSupportedOpenGlEsTextureType::kGlTexture2D,
|
||||
};
|
||||
eye_texture_target_ = texture_target;
|
||||
|
||||
renderer_ = internal::ScopedCardboardObject<CardboardDistortionRenderer*>(
|
||||
CardboardOpenGlEs2DistortionRenderer_create(&config));
|
||||
@ -123,7 +118,7 @@ void CardboardImageTransport::Render(WebXrPresentationState* webxr,
|
||||
}
|
||||
|
||||
LocalTexture texture = GetRenderingTexture(webxr);
|
||||
CHECK_EQ(eye_texture_target_, texture.target);
|
||||
CHECK_EQ(static_cast<uint32_t>(GL_TEXTURE_2D), texture.target);
|
||||
|
||||
left_eye_description_.texture = texture.id;
|
||||
right_eye_description_.texture = texture.id;
|
||||
|
@ -47,7 +47,7 @@ class COMPONENT_EXPORT(VR_CARDBOARD) CardboardImageTransport
|
||||
void Render(WebXrPresentationState* webxr, GLuint framebuffer);
|
||||
|
||||
private:
|
||||
void DoRuntimeInitialization(int texture_target) override;
|
||||
void DoRuntimeInitialization() override;
|
||||
void UpdateDistortionMesh();
|
||||
|
||||
// Display size is the size of the actual display in pixels, and is needed for
|
||||
@ -60,7 +60,6 @@ class COMPONENT_EXPORT(VR_CARDBOARD) CardboardImageTransport
|
||||
CardboardEyeTextureDescription left_eye_description_;
|
||||
CardboardEyeTextureDescription right_eye_description_;
|
||||
|
||||
uint32_t eye_texture_target_ = 0;
|
||||
internal::ScopedCardboardObject<CardboardDistortionRenderer*> renderer_;
|
||||
internal::ScopedCardboardObject<CardboardLensDistortion*> lens_distortion_;
|
||||
|
||||
|
@ -64,7 +64,7 @@ void XrImageTransportBase::Initialize(WebXrPresentationState* webxr,
|
||||
|
||||
webgpu_session_ = webgpu_session;
|
||||
|
||||
DoRuntimeInitialization(GL_TEXTURE_2D);
|
||||
DoRuntimeInitialization();
|
||||
|
||||
mailbox_bridge_->CreateAndBindContextProvider(
|
||||
base::BindOnce(&XrImageTransportBase::OnMailboxBridgeReady,
|
||||
|
@ -102,7 +102,7 @@ class XrImageTransportBase {
|
||||
// Runs before the rest of the initialization for the XrImageTransport to
|
||||
// allow for any specialized gl context setup or other setup that may be
|
||||
// needed by the particular runtime that's in use.
|
||||
virtual void DoRuntimeInitialization(int texture_target) = 0;
|
||||
virtual void DoRuntimeInitialization() = 0;
|
||||
|
||||
std::unique_ptr<MailboxToSurfaceBridge> mailbox_bridge_;
|
||||
|
||||
|
Reference in New Issue
Block a user