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

Side by Side Diff: cc/surfaces/surface_aggregator.cc

Issue 1945533002: Add way to mark other Surface a predecessor for a Surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/surfaces/surface_aggregator.h" 5 #include "cc/surfaces/surface_aggregator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } else { 146 } else {
147 return it->second; 147 return it->second;
148 } 148 }
149 } 149 }
150 150
151 gfx::Rect SurfaceAggregator::DamageRectForSurface( 151 gfx::Rect SurfaceAggregator::DamageRectForSurface(
152 const Surface* surface, 152 const Surface* surface,
153 const RenderPass& source, 153 const RenderPass& source,
154 const gfx::Rect& full_rect) const { 154 const gfx::Rect& full_rect) const {
155 auto it = previous_contained_surfaces_.find(surface->surface_id()); 155 auto it = previous_contained_surfaces_.find(surface->surface_id());
156 if (it == previous_contained_surfaces_.end()) 156 if (it != previous_contained_surfaces_.end()) {
157 return full_rect; 157 int previous_index = it->second;
158 if (previous_index == surface->frame_index())
159 return gfx::Rect();
160 }
161 SurfaceId previous_surface_id = surface->previous_frame_surface_id();
158 162
159 int previous_index = it->second; 163 if (surface->surface_id() != previous_surface_id) {
160 if (previous_index == surface->frame_index()) 164 it = previous_contained_surfaces_.find(previous_surface_id);
161 return gfx::Rect(); 165 }
162 if (previous_index == surface->frame_index() - 1) 166 if (it != previous_contained_surfaces_.end()) {
163 return source.damage_rect; 167 int previous_index = it->second;
168 if (previous_index == surface->frame_index() - 1)
169 return source.damage_rect;
170 }
171
164 return full_rect; 172 return full_rect;
165 } 173 }
166 174
167 void SurfaceAggregator::HandleSurfaceQuad( 175 void SurfaceAggregator::HandleSurfaceQuad(
168 const SurfaceDrawQuad* surface_quad, 176 const SurfaceDrawQuad* surface_quad,
169 const gfx::Transform& target_transform, 177 const gfx::Transform& target_transform,
170 const ClipData& clip_rect, 178 const ClipData& clip_rect,
171 RenderPass* dest_pass) { 179 RenderPass* dest_pass) {
172 SurfaceId surface_id = surface_quad->surface_id; 180 SurfaceId surface_id = surface_quad->surface_id;
173 // If this surface's id is already in our referenced set then it creates 181 // If this surface's id is already in our referenced set then it creates
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 822
815 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) { 823 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) {
816 auto it = previous_contained_surfaces_.find(surface_id); 824 auto it = previous_contained_surfaces_.find(surface_id);
817 if (it == previous_contained_surfaces_.end()) 825 if (it == previous_contained_surfaces_.end())
818 return; 826 return;
819 // Set the last drawn index as 0 to ensure full damage next time it's drawn. 827 // Set the last drawn index as 0 to ensure full damage next time it's drawn.
820 it->second = 0; 828 it->second = 0;
821 } 829 }
822 830
823 } // namespace cc 831 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698