| 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..333f2f1af5a2b09005701cbc01088717e9537bd5 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/yuv_to_rgb_converter.h"
|
|
|
| namespace gfx {
|
|
|
| @@ -136,6 +138,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
|
| @@ -195,6 +201,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_);
|
|
|
|
|