| 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 "content/common/gpu/image_transport_surface_overlay_mac.h" | 5 #include "content/common/gpu/image_transport_surface_overlay_mac.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <CoreGraphics/CoreGraphics.h> | 8 #include <CoreGraphics/CoreGraphics.h> |
| 9 #include <IOSurface/IOSurface.h> | 9 #include <IOSurface/IOSurface.h> |
| 10 #include <OpenGL/CGLRenderers.h> | 10 #include <OpenGL/CGLRenderers.h> |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 if (!allocated) { | 729 if (!allocated) { |
| 730 DisplayAndClearAllPendingSwaps(); | 730 DisplayAndClearAllPendingSwaps(); |
| 731 last_swap_time_ = base::TimeTicks(); | 731 last_swap_time_ = base::TimeTicks(); |
| 732 } | 732 } |
| 733 return true; | 733 return true; |
| 734 } | 734 } |
| 735 | 735 |
| 736 bool ImageTransportSurfaceOverlayMac::ScheduleOverlayPlane( | 736 bool ImageTransportSurfaceOverlayMac::ScheduleOverlayPlane( |
| 737 int z_order, | 737 int z_order, |
| 738 gfx::OverlayTransform transform, | 738 gfx::OverlayTransform transform, |
| 739 gfx::BufferFormat storage_format, |
| 739 gl::GLImage* image, | 740 gl::GLImage* image, |
| 740 const gfx::Rect& pixel_frame_rect, | 741 const gfx::Rect& pixel_frame_rect, |
| 741 const gfx::RectF& crop_rect) { | 742 const gfx::RectF& crop_rect, |
| 743 bool handle_scaling) { |
| 742 DCHECK_EQ(transform, gfx::OVERLAY_TRANSFORM_NONE); | 744 DCHECK_EQ(transform, gfx::OVERLAY_TRANSFORM_NONE); |
| 743 if (transform != gfx::OVERLAY_TRANSFORM_NONE) | 745 if (transform != gfx::OVERLAY_TRANSFORM_NONE) |
| 744 return false; | 746 return false; |
| 745 | 747 |
| 746 linked_ptr<OverlayPlane> plane = OverlayPlane::CreateWithFrameRect( | 748 linked_ptr<OverlayPlane> plane = OverlayPlane::CreateWithFrameRect( |
| 747 z_order, static_cast<gl::GLImageIOSurface*>(image)->io_surface_id().id, | 749 z_order, static_cast<gl::GLImageIOSurface*>(image)->io_surface_id().id, |
| 748 static_cast<gl::GLImageIOSurface*>(image)->io_surface(), | 750 static_cast<gl::GLImageIOSurface*>(image)->io_surface(), |
| 749 gfx::RectF(pixel_frame_rect), crop_rect); | 751 gfx::RectF(pixel_frame_rect), crop_rect); |
| 750 if (z_order == 0) | 752 if (z_order == 0) |
| 751 pending_root_plane_ = plane; | 753 pending_root_plane_ = plane; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 // Compute the previous vsync time. | 853 // Compute the previous vsync time. |
| 852 base::TimeTicks previous_vsync = | 854 base::TimeTicks previous_vsync = |
| 853 vsync_interval_ * ((from - vsync_timebase_) / vsync_interval_) + | 855 vsync_interval_ * ((from - vsync_timebase_) / vsync_interval_) + |
| 854 vsync_timebase_; | 856 vsync_timebase_; |
| 855 | 857 |
| 856 // Return |interval_fraction| through the next vsync. | 858 // Return |interval_fraction| through the next vsync. |
| 857 return previous_vsync + (1 + interval_fraction) * vsync_interval_; | 859 return previous_vsync + (1 + interval_fraction) * vsync_interval_; |
| 858 } | 860 } |
| 859 | 861 |
| 860 } // namespace content | 862 } // namespace content |
| OLD | NEW |