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

Unified Diff: ui/gl/gl_context_cgl.cc

Issue 1882953006: Attach YUV420 to RGB converter to GLContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: ui/gl/gl_context_cgl.cc
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc
index 374b38e1bb6a7e2e18734a39a32aa994c5b18aeb..4079e853db785eda96ff1b2492e44b37c40152a7 100644
--- a/ui/gl/gl_context_cgl.cc
+++ b/ui/gl/gl_context_cgl.cc
@@ -16,6 +16,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/yuv420_rgb_converter.h"
namespace gfx {
@@ -136,6 +138,10 @@ bool GLContextCGL::Initialize(GLSurface* compatible_surface,
}
void GLContextCGL::Destroy() {
+ if (yuv420_rgb_converter_) {
+ gfx::ScopedCGLSetCurrentContext(static_cast<CGLContextObj>(context_));
+ yuv420_rgb_converter_.reset();
+ }
if (discrete_pixelformat_) {
if (base::MessageLoop::current() != nullptr) {
// Delay releasing the pixel format for 10 seconds to reduce the number of
@@ -195,6 +201,12 @@ bool GLContextCGL::ForceGpuSwitchIfNeeded() {
return true;
}
+YUV420RGBConverter* GLContextCGL::GetYUV420RGBConverter() {
+ if (!yuv420_rgb_converter_)
+ yuv420_rgb_converter_.reset(new YUV420RGBConverter);
+ return yuv420_rgb_converter_.get();
+}
+
bool GLContextCGL::MakeCurrent(GLSurface* surface) {
DCHECK(context_);

Powered by Google App Engine
This is Rietveld 408576698