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

Side by Side Diff: content/common/gpu/media/avda_shared_state.cc

Issue 1559203003: Add GLStreamTextureImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/GL_EXPORT/GPU_EXPORT for windows Created 4 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/common/gpu/media/avda_shared_state.h" 5 #include "content/common/gpu/media/avda_shared_state.h"
6 6
7 #include "ui/gl/gl_bindings.h" 7 #include "ui/gl/gl_bindings.h"
8 #include "ui/gl/scoped_make_current.h" 8 #include "ui/gl/scoped_make_current.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 AVDASharedState::AVDASharedState() 12 AVDASharedState::AVDASharedState()
13 : surface_texture_service_id_(0), 13 : surface_texture_service_id_(0),
14 frame_available_event_(false, false), 14 frame_available_event_(false, false),
15 surface_texture_is_attached_(false) {} 15 surface_texture_is_attached_(false) {}
16 16
17 AVDASharedState::~AVDASharedState() {} 17 AVDASharedState::~AVDASharedState() {}
18 18
19 void AVDASharedState::SignalFrameAvailable() { 19 void AVDASharedState::SignalFrameAvailable() {
20 frame_available_event_.Signal(); 20 frame_available_event_.Signal();
21 } 21 }
22 22
23 void AVDASharedState::WaitForFrameAvailable() { 23 void AVDASharedState::WaitForFrameAvailable() {
24 frame_available_event_.Wait(); 24 frame_available_event_.Wait();
25 } 25 }
26 26
27 void AVDASharedState::did_attach_surface_texture() { 27 void AVDASharedState::DidAttachSurfaceTexture() {
28 context_ = gfx::GLContext::GetCurrent(); 28 context_ = gfx::GLContext::GetCurrent();
29 surface_ = gfx::GLSurface::GetCurrent(); 29 surface_ = gfx::GLSurface::GetCurrent();
30 DCHECK(context_); 30 DCHECK(context_);
31 DCHECK(surface_); 31 DCHECK(surface_);
32 32
33 surface_texture_is_attached_ = true; 33 surface_texture_is_attached_ = true;
34 } 34 }
35 35
36 void AVDASharedState::DidDetachSurfaceTexture() {
37 context_ = nullptr;
38 surface_ = nullptr;
39 surface_texture_is_attached_ = false;
40 }
41
36 } // namespace content 42 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/avda_shared_state.h ('k') | gpu/GLES2/extensions/CHROMIUM/CHROMIUM_stream_texture_matrix.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698