| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/compositing_iosurface_mac.h" | 5 #include "content/browser/renderer_host/compositing_iosurface_mac.h" |
| 6 | 6 |
| 7 #include <OpenGL/CGLRenderers.h> | 7 #include <OpenGL/CGLRenderers.h> |
| 8 #include <OpenGL/OpenGL.h> | 8 #include <OpenGL/OpenGL.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // by forcing the graphics pipeline to be completely drained at this | 462 // by forcing the graphics pipeline to be completely drained at this |
| 463 // point. This workaround is not necessary on Mountain Lion. | 463 // point. This workaround is not necessary on Mountain Lion. |
| 464 // http://crbug.com/318877 : work around a bug where the window does | 464 // http://crbug.com/318877 : work around a bug where the window does |
| 465 // not finish rendering its contents before displaying them on Mavericks | 465 // not finish rendering its contents before displaying them on Mavericks |
| 466 // on Retina MacBook Pro when using the Intel HD graphics GPU. | 466 // on Retina MacBook Pro when using the Intel HD graphics GPU. |
| 467 glFinish(); | 467 glFinish(); |
| 468 } | 468 } |
| 469 | 469 |
| 470 base::Closure copy_done_callback; | 470 base::Closure copy_done_callback; |
| 471 if (frame_subscriber) { | 471 if (frame_subscriber) { |
| 472 const base::Time present_time = base::Time::Now(); | 472 const base::TimeTicks present_time = base::TimeTicks::Now(); |
| 473 scoped_refptr<media::VideoFrame> frame; | 473 scoped_refptr<media::VideoFrame> frame; |
| 474 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback; | 474 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback; |
| 475 if (frame_subscriber->ShouldCaptureFrame(present_time, &frame, &callback)) { | 475 if (frame_subscriber->ShouldCaptureFrame(present_time, &frame, &callback)) { |
| 476 copy_done_callback = CopyToVideoFrameWithinContext( | 476 copy_done_callback = CopyToVideoFrameWithinContext( |
| 477 gfx::Rect(pixel_io_surface_size_), true, frame, | 477 gfx::Rect(pixel_io_surface_size_), true, frame, |
| 478 base::Bind(callback, present_time)); | 478 base::Bind(callback, present_time)); |
| 479 } | 479 } |
| 480 } | 480 } |
| 481 | 481 |
| 482 bool result = true; | 482 bool result = true; |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 GLenum CompositingIOSurfaceMac::GetAndSaveGLError() { | 1041 GLenum CompositingIOSurfaceMac::GetAndSaveGLError() { |
| 1042 GLenum gl_error = glGetError(); | 1042 GLenum gl_error = glGetError(); |
| 1043 if (gl_error_ == GL_NO_ERROR) | 1043 if (gl_error_ == GL_NO_ERROR) |
| 1044 gl_error_ = gl_error; | 1044 gl_error_ = gl_error; |
| 1045 return gl_error; | 1045 return gl_error; |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 } // namespace content | 1048 } // namespace content |
| OLD | NEW |