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

Unified Diff: ui/gl/gl_context_cgl.cc

Issue 2005463002: Attach YUV420 to RGB converter to GLContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 | « ui/gl/gl_context_cgl.h ('k') | ui/gl/gl_image_io_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_cgl.cc
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc
index 147e4b193daff0fcc6db1629bfd912460e3df567..47ace7f1822dd90e87acf1db6deb081e7f7447a5 100644
--- a/ui/gl/gl_context_cgl.cc
+++ b/ui/gl/gl_context_cgl.cc
@@ -15,6 +15,8 @@
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface.h"
#include "ui/gl/gpu_switching_manager.h"
+#include "ui/gl/scoped_cgl.h"
+#include "ui/gl/yuv_to_rgb_converter.h"
namespace gfx {
@@ -135,6 +137,10 @@ bool GLContextCGL::Initialize(GLSurface* compatible_surface,
}
void GLContextCGL::Destroy() {
+ if (yuv_to_rgb_converter_) {
+ gfx::ScopedCGLSetCurrentContext(static_cast<CGLContextObj>(context_));
+ yuv_to_rgb_converter_.reset();
+ }
if (discrete_pixelformat_) {
if (base::MessageLoop::current() != nullptr) {
// Delay releasing the pixel format for 10 seconds to reduce the number of
@@ -194,6 +200,12 @@ bool GLContextCGL::ForceGpuSwitchIfNeeded() {
return true;
}
+gl::YUVToRGBConverter* GLContextCGL::GetYUVToRGBConverter() {
+ if (!yuv_to_rgb_converter_)
+ yuv_to_rgb_converter_.reset(new gl::YUVToRGBConverter);
+ return yuv_to_rgb_converter_.get();
+}
+
bool GLContextCGL::MakeCurrent(GLSurface* surface) {
DCHECK(context_);
« no previous file with comments | « ui/gl/gl_context_cgl.h ('k') | ui/gl/gl_image_io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698