Skip to content

Commit

Permalink
[GPU] Remove TextureOwner::EnsureTexImageBound()
Browse files Browse the repository at this point in the history
The implementations of this method no longer do anything. Removing it
paves the way to further simplification in followups.

Bug: 1466805
Change-Id: Ie6d6c09f75072fe628db1ae9aa9c907a6270128f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4706110
Reviewed-by: vikas soni <vikassoni@chromium.org>
Commit-Queue: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1173574}
  • Loading branch information
colinblundell authored and Chromium LUCI CQ committed Jul 21, 2023
1 parent 8fd356b commit 9a77d80
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 29 deletions.
8 changes: 0 additions & 8 deletions gpu/command_buffer/service/image_reader_gl_owner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,6 @@ void ImageReaderGLOwner::UpdateTexImage() {
current_image_ref_.emplace(this, image, std::move(scoped_acquire_fence_fd));
}

void ImageReaderGLOwner::EnsureTexImageBound(GLuint service_id) {
// This method is supposed to be called only if the TextureOwner instance
// binds the texture on update, which ImageReaderGLOwner does not. If this
// method *is* ever called on this class it will not work as the caller is
// expecting; hence CHECK to ensure that any such instances are caught.
CHECK(false);
}

std::unique_ptr<base::android::ScopedHardwareBufferFenceSync>
ImageReaderGLOwner::GetAHardwareBuffer() {
base::AutoLock auto_lock(lock_);
Expand Down
1 change: 0 additions & 1 deletion gpu/command_buffer/service/image_reader_gl_owner.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class GPU_GLES2_EXPORT ImageReaderGLOwner : public TextureOwner,
const base::RepeatingClosure& frame_available_cb) override;
gl::ScopedJavaSurface CreateJavaSurface() const override;
void UpdateTexImage() override;
void EnsureTexImageBound(GLuint service_id) override;
void ReleaseBackBuffers() override;
std::unique_ptr<base::android::ScopedHardwareBufferFenceSync>
GetAHardwareBuffer() override;
Expand Down
1 change: 0 additions & 1 deletion gpu/command_buffer/service/mock_texture_owner.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class MockTextureOwner : public TextureOwner {
MOCK_CONST_METHOD0(GetSurface, gl::GLSurface*());
MOCK_CONST_METHOD0(CreateJavaSurface, gl::ScopedJavaSurface());
MOCK_METHOD0(UpdateTexImage, void());
MOCK_METHOD1(EnsureTexImageBound, void(GLuint));
MOCK_METHOD0(ReleaseBackBuffers, void());
MOCK_METHOD0(ReleaseResources, void());
MOCK_METHOD1(SetFrameAvailableCallback, void(const base::RepeatingClosure&));
Expand Down
5 changes: 0 additions & 5 deletions gpu/command_buffer/service/surface_texture_gl_owner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ void SurfaceTextureGLOwner::UpdateTexImage() {
}
}

void SurfaceTextureGLOwner::EnsureTexImageBound(GLuint service_id) {
// We can't bind SurfaceTexture to different ids.
DCHECK_EQ(service_id, GetTextureId());
}

void SurfaceTextureGLOwner::ReleaseBackBuffers() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (surface_texture_)
Expand Down
1 change: 0 additions & 1 deletion gpu/command_buffer/service/surface_texture_gl_owner.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class GPU_GLES2_EXPORT SurfaceTextureGLOwner : public TextureOwner {
const base::RepeatingClosure& frame_available_cb) override;
gl::ScopedJavaSurface CreateJavaSurface() const override;
void UpdateTexImage() override;
void EnsureTexImageBound(GLuint service_id) override;
void ReleaseBackBuffers() override;
std::unique_ptr<base::android::ScopedHardwareBufferFenceSync>
GetAHardwareBuffer() override;
Expand Down
5 changes: 0 additions & 5 deletions gpu/command_buffer/service/texture_owner.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ class GPU_GLES2_EXPORT TextureOwner
// Update the texture image using the latest available image data.
virtual void UpdateTexImage() = 0;

// Ensures that the latest texture image is bound to the provided texture
// service_id. Should only be used if the TextureOwner requires explicit
// binding of the image after an update.
virtual void EnsureTexImageBound(GLuint service_id) = 0;

// Transformation matrix if any associated with the texture image.
virtual void ReleaseBackBuffers() = 0;

Expand Down
7 changes: 1 addition & 6 deletions gpu/ipc/service/stream_texture_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,7 @@ bool StreamTexture::IsUsingGpuMemory() const {
return true;
}

void StreamTexture::UpdateAndBindTexImage(GLuint service_id) {
// UpdateTexImage happens via OnFrameAvailable callback now. So we
// just need to ensure that image is bound to the correct texture id.
DCHECK_GT(service_id, static_cast<unsigned>(0));
texture_owner_->EnsureTexImageBound(service_id);
}
void StreamTexture::UpdateAndBindTexImage(GLuint service_id) {}

bool StreamTexture::HasTextureOwner() const {
return !!texture_owner_;
Expand Down
2 changes: 0 additions & 2 deletions media/gpu/android/codec_output_buffer_renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ void CodecOutputBufferRenderer::EnsureBoundIfNeeded(BindingsMode mode,

if (mode == BindingsMode::kBindImage) {
DCHECK_GT(service_id, 0u);
codec_buffer_wait_coordinator_->texture_owner()->EnsureTexImageBound(
service_id);
was_tex_image_bound_ = true;
}
}
Expand Down

0 comments on commit 9a77d80

Please sign in to comment.