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 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 if (frame_subscriber->ShouldCaptureFrame(&frame, &callback)) { | 469 if (frame_subscriber->ShouldCaptureFrame(&frame, &callback)) { |
470 copy_done_callback = CopyToVideoFrameWithinContext( | 470 copy_done_callback = CopyToVideoFrameWithinContext( |
471 gfx::Rect(io_surface_size_), scale_factor, true, frame, | 471 gfx::Rect(io_surface_size_), scale_factor, true, frame, |
472 base::Bind(callback, base::Time::Now())); | 472 base::Bind(callback, base::Time::Now())); |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
476 CGLFlushDrawable(cglContext_); | 476 CGLFlushDrawable(cglContext_); |
477 | 477 |
478 // For latency_tests.cc: | 478 // For latency_tests.cc: |
479 UNSHIPPED_TRACE_EVENT_INSTANT0("test_gpu", "CompositorSwapBuffersComplete"); | 479 UNSHIPPED_TRACE_EVENT_INSTANT0("test_gpu", "CompositorSwapBuffersComplete", |
| 480 TRACE_EVENT_SCOPE_THREAD); |
480 | 481 |
481 // Try to finish previous copy requests after flush to get better pipelining. | 482 // Try to finish previous copy requests after flush to get better pipelining. |
482 std::vector<base::Closure> copy_done_callbacks; | 483 std::vector<base::Closure> copy_done_callbacks; |
483 FinishAllCopiesWithinContext(©_done_callbacks); | 484 FinishAllCopiesWithinContext(©_done_callbacks); |
484 | 485 |
485 CGLSetCurrentContext(0); | 486 CGLSetCurrentContext(0); |
486 | 487 |
487 if (!copy_done_callback.is_null()) | 488 if (!copy_done_callback.is_null()) |
488 copy_done_callbacks.push_back(copy_done_callback); | 489 copy_done_callbacks.push_back(copy_done_callback); |
489 for (size_t i = 0; i < copy_done_callbacks.size(); ++i) | 490 for (size_t i = 0; i < copy_done_callbacks.size(); ++i) |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 } | 1009 } |
1009 | 1010 |
1010 gfx::Rect CompositingIOSurfaceMac::IntersectWithIOSurface( | 1011 gfx::Rect CompositingIOSurfaceMac::IntersectWithIOSurface( |
1011 const gfx::Rect& rect, float scale_factor) const { | 1012 const gfx::Rect& rect, float scale_factor) const { |
1012 return gfx::IntersectRects(rect, | 1013 return gfx::IntersectRects(rect, |
1013 gfx::ToEnclosingRect(gfx::ScaleRect(gfx::Rect(io_surface_size_), | 1014 gfx::ToEnclosingRect(gfx::ScaleRect(gfx::Rect(io_surface_size_), |
1014 scale_factor))); | 1015 scale_factor))); |
1015 } | 1016 } |
1016 | 1017 |
1017 } // namespace content | 1018 } // namespace content |
OLD | NEW |