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

Unified Diff: media/gpu/avda_shared_state.cc

Issue 2706653002: Added SurfaceTextureGLOwner to create / own GL objects. (Closed)
Patch Set: stopped including gl_initializer.h Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/avda_shared_state.h ('k') | media/gpu/surface_texture_gl_owner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/avda_shared_state.cc
diff --git a/media/gpu/avda_shared_state.cc b/media/gpu/avda_shared_state.cc
index 48ad88cc591907965b318bf4bce22dd99bec4df3..1309dabe2385dc409b8c3a7c395257a1b5bba9c1 100644
--- a/media/gpu/avda_shared_state.cc
+++ b/media/gpu/avda_shared_state.cc
@@ -62,8 +62,7 @@ class AVDASharedState::OnFrameAvailableHandler
};
AVDASharedState::AVDASharedState()
- : surface_texture_service_id_(0),
- frame_available_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
+ : frame_available_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED),
gl_matrix_{
@@ -74,15 +73,10 @@ AVDASharedState::AVDASharedState()
} {}
AVDASharedState::~AVDASharedState() {
- if (!surface_texture_service_id_)
+ if (!surface_texture_)
return;
on_frame_available_handler_->ClearListener();
- ui::ScopedMakeCurrent scoped_make_current(context_.get(), surface_.get());
- if (scoped_make_current.Succeeded()) {
- glDeleteTextures(1, &surface_texture_service_id_);
- DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
- }
}
void AVDASharedState::SignalFrameAvailable() {
@@ -120,16 +114,9 @@ void AVDASharedState::WaitForFrameAvailable() {
}
void AVDASharedState::SetSurfaceTexture(
- scoped_refptr<gl::SurfaceTexture> surface_texture,
- GLuint attached_service_id) {
+ scoped_refptr<SurfaceTextureGLOwner> surface_texture) {
DCHECK(surface_texture);
- DCHECK(attached_service_id);
surface_texture_ = surface_texture;
- surface_texture_service_id_ = attached_service_id;
- context_ = gl::GLContext::GetCurrent();
- surface_ = gl::GLSurface::GetCurrent();
- DCHECK(context_);
- DCHECK(surface_);
on_frame_available_handler_ =
new OnFrameAvailableHandler(this, surface_texture_.get());
}
« no previous file with comments | « media/gpu/avda_shared_state.h ('k') | media/gpu/surface_texture_gl_owner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698