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

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

Issue 1559203003: Add GLStreamTextureImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added enum, removed count parameter. 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/android_deferred_rendering_backing_strategy.h " 5 #include "content/common/gpu/media/android_deferred_rendering_backing_strategy.h "
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 30 matching lines...) Expand all
41 surface_texture_->DetachFromGLContext(); 41 surface_texture_->DetachFromGLContext();
42 surface = gfx::ScopedJavaSurface(surface_texture_.get()); 42 surface = gfx::ScopedJavaSurface(surface_texture_.get());
43 } 43 }
44 44
45 // Create a texture for the SurfaceTexture to use. We don't attach it here 45 // Create a texture for the SurfaceTexture to use. We don't attach it here
46 // so that it gets attached in the compositor gl context in the common case. 46 // so that it gets attached in the compositor gl context in the common case.
47 GLuint service_id = 0; 47 GLuint service_id = 0;
48 glGenTextures(1, &service_id); 48 glGenTextures(1, &service_id);
49 DCHECK(service_id); 49 DCHECK(service_id);
50 shared_state_->set_surface_texture_service_id(service_id); 50 shared_state_->set_surface_texture_service_id(service_id);
51 shared_state_->set_share_group(gfx::GLContext::GetCurrent()->share_group());
reveman 2016/02/18 17:16:49 is this related to this patch?
liberato (no reviews please) 2016/02/18 19:34:41 i'm not sure it's needed at all, to be honest. if
reveman 2016/02/18 20:20:56 Ok, can we do this in a separate patch?
liberato (no reviews please) 2016/02/19 18:39:55 Done.
51 52
52 return surface; 53 return surface;
53 } 54 }
54 55
55 void AndroidDeferredRenderingBackingStrategy::Cleanup( 56 void AndroidDeferredRenderingBackingStrategy::Cleanup(
56 bool have_context, 57 bool have_context,
57 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) { 58 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) {
58 // If we failed before Initialize, then do nothing. 59 // If we failed before Initialize, then do nothing.
59 if (!shared_state_) 60 if (!shared_state_)
60 return; 61 return;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 shared_state_->SignalFrameAvailable(); 229 shared_state_->SignalFrameAvailable();
229 } 230 }
230 231
231 bool AndroidDeferredRenderingBackingStrategy::ArePicturesOverlayable() { 232 bool AndroidDeferredRenderingBackingStrategy::ArePicturesOverlayable() {
232 // SurfaceView frames are always overlayable because that's the only way to 233 // SurfaceView frames are always overlayable because that's the only way to
233 // display them. 234 // display them.
234 return !surface_texture_; 235 return !surface_texture_;
235 } 236 }
236 237
237 } // namespace content 238 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698