| 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 <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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 } | 351 } |
| 352 | 352 |
| 353 // Update the plane lists. | 353 // Update the plane lists. |
| 354 { | 354 { |
| 355 // Sort the input planes by z-index, and remove any overlays from the | 355 // Sort the input planes by z-index, and remove any overlays from the |
| 356 // damage rect. | 356 // damage rect. |
| 357 gfx::RectF dip_damage_rect = ConvertRectToDIPF( | 357 gfx::RectF dip_damage_rect = ConvertRectToDIPF( |
| 358 swap->scale_factor, swap->pixel_damage_rect); | 358 swap->scale_factor, swap->pixel_damage_rect); |
| 359 std::sort(swap->overlay_planes.begin(), swap->overlay_planes.end(), | 359 std::sort(swap->overlay_planes.begin(), swap->overlay_planes.end(), |
| 360 OverlayPlane::Compare); | 360 OverlayPlane::Compare); |
| 361 for (auto& plane : swap->overlay_planes) |
| 362 dip_damage_rect.Subtract(plane->dip_frame_rect); |
| 361 | 363 |
| 362 ScopedCAActionDisabler disabler; | 364 ScopedCAActionDisabler disabler; |
| 363 UpdateRootAndPartialDamagePlanes(swap->root_plane, dip_damage_rect); | 365 UpdateRootAndPartialDamagePlanes(swap->root_plane, dip_damage_rect); |
| 364 UpdateOverlayPlanes(swap->overlay_planes); | 366 UpdateOverlayPlanes(swap->overlay_planes); |
| 365 UpdateCALayerTree(); | 367 UpdateCALayerTree(); |
| 366 swap->overlay_planes.clear(); | 368 swap->overlay_planes.clear(); |
| 367 } | 369 } |
| 368 | 370 |
| 369 // Send acknowledgement to the browser. | 371 // Send acknowledgement to the browser. |
| 370 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; | 372 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 // Compute the previous vsync time. | 716 // Compute the previous vsync time. |
| 715 base::TimeTicks previous_vsync = | 717 base::TimeTicks previous_vsync = |
| 716 vsync_interval_ * ((from - vsync_timebase_) / vsync_interval_) + | 718 vsync_interval_ * ((from - vsync_timebase_) / vsync_interval_) + |
| 717 vsync_timebase_; | 719 vsync_timebase_; |
| 718 | 720 |
| 719 // Return |interval_fraction| through the next vsync. | 721 // Return |interval_fraction| through the next vsync. |
| 720 return previous_vsync + (1 + interval_fraction) * vsync_interval_; | 722 return previous_vsync + (1 + interval_fraction) * vsync_interval_; |
| 721 } | 723 } |
| 722 | 724 |
| 723 } // namespace content | 725 } // namespace content |
| OLD | NEW |