Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: content/common/gpu/image_transport_surface_overlay_mac.mm

Issue 1330563004: Avoid Copying damage rect when using Overlays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update ImageSurface Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« cc/output/direct_renderer.cc ('K') | « cc/output/direct_renderer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
363 361
364 ScopedCAActionDisabler disabler; 362 ScopedCAActionDisabler disabler;
365 if (swap->root_plane.get()) 363 if (swap->root_plane.get())
366 UpdateRootAndPartialDamagePlanes(swap->root_plane, dip_damage_rect); 364 UpdateRootAndPartialDamagePlanes(swap->root_plane, dip_damage_rect);
367 UpdateOverlayPlanes(swap->overlay_planes); 365 UpdateOverlayPlanes(swap->overlay_planes);
368 UpdateCALayerTree(); 366 UpdateCALayerTree();
369 swap->overlay_planes.clear(); 367 swap->overlay_planes.clear();
370 } 368 }
371 369
372 // Send acknowledgement to the browser. 370 // Send acknowledgement to the browser.
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 // Compute the previous vsync time. 705 // Compute the previous vsync time.
708 base::TimeTicks previous_vsync = 706 base::TimeTicks previous_vsync =
709 vsync_interval_ * ((from - vsync_timebase_) / vsync_interval_) + 707 vsync_interval_ * ((from - vsync_timebase_) / vsync_interval_) +
710 vsync_timebase_; 708 vsync_timebase_;
711 709
712 // Return |interval_fraction| through the next vsync. 710 // Return |interval_fraction| through the next vsync.
713 return previous_vsync + (1 + interval_fraction) * vsync_interval_; 711 return previous_vsync + (1 + interval_fraction) * vsync_interval_;
714 } 712 }
715 713
716 } // namespace content 714 } // namespace content
OLDNEW
« cc/output/direct_renderer.cc ('K') | « cc/output/direct_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698