| OLD | NEW |
| 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 "gpu/ipc/service/image_transport_surface_overlay_mac.h" | 5 #include "gpu/ipc/service/image_transport_surface_overlay_mac.h" |
| 6 | 6 |
| 7 #include <CoreGraphics/CoreGraphics.h> | 7 #include <CoreGraphics/CoreGraphics.h> |
| 8 #include <IOSurface/IOSurface.h> | 8 #include <IOSurface/IOSurface.h> |
| 9 #include <OpenGL/CGLRenderers.h> | 9 #include <OpenGL/CGLRenderers.h> |
| 10 #include <OpenGL/CGLTypes.h> | 10 #include <OpenGL/CGLTypes.h> |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 297 } |
| 298 | 298 |
| 299 gfx::Size ImageTransportSurfaceOverlayMac::GetSize() { | 299 gfx::Size ImageTransportSurfaceOverlayMac::GetSize() { |
| 300 return gfx::Size(); | 300 return gfx::Size(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void* ImageTransportSurfaceOverlayMac::GetHandle() { | 303 void* ImageTransportSurfaceOverlayMac::GetHandle() { |
| 304 return nullptr; | 304 return nullptr; |
| 305 } | 305 } |
| 306 | 306 |
| 307 gl::GLSurfaceFormat ImageTransportSurfaceOverlayMac::GetFormat() { |
| 308 return gl::GLSurfaceFormat(); |
| 309 } |
| 310 |
| 307 bool ImageTransportSurfaceOverlayMac::OnMakeCurrent(gl::GLContext* context) { | 311 bool ImageTransportSurfaceOverlayMac::OnMakeCurrent(gl::GLContext* context) { |
| 308 // Ensure that the context is on the appropriate GL renderer. The GL renderer | 312 // Ensure that the context is on the appropriate GL renderer. The GL renderer |
| 309 // will generally only change when the GPU changes. | 313 // will generally only change when the GPU changes. |
| 310 if (gl_renderer_id_ && context) | 314 if (gl_renderer_id_ && context) |
| 311 context->share_group()->SetRendererID(gl_renderer_id_); | 315 context->share_group()->SetRendererID(gl_renderer_id_); |
| 312 return true; | 316 return true; |
| 313 } | 317 } |
| 314 | 318 |
| 315 bool ImageTransportSurfaceOverlayMac::ScheduleOverlayPlane( | 319 bool ImageTransportSurfaceOverlayMac::ScheduleOverlayPlane( |
| 316 int z_order, | 320 int z_order, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 gl_renderer_id_ = context_renderer_id & kCGLRendererIDMatchingMask; | 388 gl_renderer_id_ = context_renderer_id & kCGLRendererIDMatchingMask; |
| 385 | 389 |
| 386 // Post a task holding a reference to the new GL context. The reason for | 390 // Post a task holding a reference to the new GL context. The reason for |
| 387 // this is to avoid creating-then-destroying the context for every image | 391 // this is to avoid creating-then-destroying the context for every image |
| 388 // transport surface that is observing the GPU switch. | 392 // transport surface that is observing the GPU switch. |
| 389 base::ThreadTaskRunnerHandle::Get()->PostTask( | 393 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 390 FROM_HERE, base::Bind(&IOSurfaceContextNoOp, context_on_new_gpu)); | 394 FROM_HERE, base::Bind(&IOSurfaceContextNoOp, context_on_new_gpu)); |
| 391 } | 395 } |
| 392 | 396 |
| 393 } // namespace gpu | 397 } // namespace gpu |
| OLD | NEW |