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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 } | 367 } |
368 | 368 |
369 // Update the plane lists. | 369 // Update the plane lists. |
370 { | 370 { |
371 // Sort the input planes by z-index, and remove any overlays from the | 371 // Sort the input planes by z-index, and remove any overlays from the |
372 // damage rect. | 372 // damage rect. |
373 gfx::RectF dip_damage_rect = ConvertRectToDIPF( | 373 gfx::RectF dip_damage_rect = ConvertRectToDIPF( |
374 swap->scale_factor, swap->pixel_damage_rect); | 374 swap->scale_factor, swap->pixel_damage_rect); |
375 std::sort(swap->overlay_planes.begin(), swap->overlay_planes.end(), | 375 std::sort(swap->overlay_planes.begin(), swap->overlay_planes.end(), |
376 OverlayPlane::Compare); | 376 OverlayPlane::Compare); |
| 377 for (auto& plane : swap->overlay_planes) |
| 378 dip_damage_rect.Subtract(plane->dip_frame_rect); |
377 | 379 |
378 ScopedCAActionDisabler disabler; | 380 ScopedCAActionDisabler disabler; |
379 UpdateRootAndPartialDamagePlanes(swap->root_plane, dip_damage_rect); | 381 UpdateRootAndPartialDamagePlanes(swap->root_plane, dip_damage_rect); |
380 UpdateOverlayPlanes(swap->overlay_planes); | 382 UpdateOverlayPlanes(swap->overlay_planes); |
381 UpdateCALayerTree(); | 383 UpdateCALayerTree(); |
382 swap->overlay_planes.clear(); | 384 swap->overlay_planes.clear(); |
383 } | 385 } |
384 | 386 |
385 // Send acknowledgement to the browser. | 387 // Send acknowledgement to the browser. |
386 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; | 388 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // Compute the previous vsync time. | 744 // Compute the previous vsync time. |
743 base::TimeTicks previous_vsync = | 745 base::TimeTicks previous_vsync = |
744 vsync_interval_ * ((from - vsync_timebase_) / vsync_interval_) + | 746 vsync_interval_ * ((from - vsync_timebase_) / vsync_interval_) + |
745 vsync_timebase_; | 747 vsync_timebase_; |
746 | 748 |
747 // Return |interval_fraction| through the next vsync. | 749 // Return |interval_fraction| through the next vsync. |
748 return previous_vsync + (1 + interval_fraction) * vsync_interval_; | 750 return previous_vsync + (1 + interval_fraction) * vsync_interval_; |
749 } | 751 } |
750 | 752 |
751 } // namespace content | 753 } // namespace content |
OLD | NEW |