| OLD | NEW |
| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 size_t sqs_size = source.shared_quad_state_list.size(); | 202 size_t sqs_size = source.shared_quad_state_list.size(); |
| 203 size_t dq_size = source.quad_list.size(); | 203 size_t dq_size = source.quad_list.size(); |
| 204 std::unique_ptr<RenderPass> copy_pass( | 204 std::unique_ptr<RenderPass> copy_pass( |
| 205 RenderPass::Create(sqs_size, dq_size)); | 205 RenderPass::Create(sqs_size, dq_size)); |
| 206 | 206 |
| 207 int remapped_pass_id = RemapPassId(source.id, surface_id); | 207 int remapped_pass_id = RemapPassId(source.id, surface_id); |
| 208 | 208 |
| 209 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, | 209 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, |
| 210 source.transform_to_root_target, source.filters, | 210 source.transform_to_root_target, source.filters, |
| 211 source.background_filters, | 211 source.background_filters, output_color_space_, |
| 212 source.has_transparent_background); | 212 source.has_transparent_background); |
| 213 | 213 |
| 214 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); | 214 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); |
| 215 | 215 |
| 216 // Contributing passes aggregated in to the pass list need to take the | 216 // Contributing passes aggregated in to the pass list need to take the |
| 217 // transform of the surface quad into account to update their transform to | 217 // transform of the surface quad into account to update their transform to |
| 218 // the root surface. | 218 // the root surface. |
| 219 copy_pass->transform_to_root_target.ConcatTransform( | 219 copy_pass->transform_to_root_target.ConcatTransform( |
| 220 surface_quad->shared_quad_state->quad_to_target_transform); | 220 surface_quad->shared_quad_state->quad_to_target_transform); |
| 221 copy_pass->transform_to_root_target.ConcatTransform(target_transform); | 221 copy_pass->transform_to_root_target.ConcatTransform(target_transform); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 size_t dq_size = source.quad_list.size(); | 468 size_t dq_size = source.quad_list.size(); |
| 469 std::unique_ptr<RenderPass> copy_pass( | 469 std::unique_ptr<RenderPass> copy_pass( |
| 470 RenderPass::Create(sqs_size, dq_size)); | 470 RenderPass::Create(sqs_size, dq_size)); |
| 471 | 471 |
| 472 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); | 472 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); |
| 473 | 473 |
| 474 int remapped_pass_id = RemapPassId(source.id, surface->surface_id()); | 474 int remapped_pass_id = RemapPassId(source.id, surface->surface_id()); |
| 475 | 475 |
| 476 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, | 476 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, |
| 477 source.transform_to_root_target, source.filters, | 477 source.transform_to_root_target, source.filters, |
| 478 source.background_filters, | 478 source.background_filters, output_color_space_, |
| 479 source.has_transparent_background); | 479 source.has_transparent_background); |
| 480 | 480 |
| 481 CopyQuadsToPass(source.quad_list, source.shared_quad_state_list, | 481 CopyQuadsToPass(source.quad_list, source.shared_quad_state_list, |
| 482 child_to_parent_map, gfx::Transform(), ClipData(), | 482 child_to_parent_map, gfx::Transform(), ClipData(), |
| 483 copy_pass.get(), surface->surface_id()); | 483 copy_pass.get(), surface->surface_id()); |
| 484 if (!copy_request_passes_.count(remapped_pass_id) && | 484 if (!copy_request_passes_.count(remapped_pass_id) && |
| 485 !moved_pixel_passes_.count(remapped_pass_id)) { | 485 !moved_pixel_passes_.count(remapped_pass_id)) { |
| 486 gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); | 486 gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); |
| 487 if (copy_pass->transform_to_root_target.GetInverse(&inverse_transform)) { | 487 if (copy_pass->transform_to_root_target.GetInverse(&inverse_transform)) { |
| 488 gfx::Rect damage_rect_in_render_pass_space = | 488 gfx::Rect damage_rect_in_render_pass_space = |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 } | 841 } |
| 842 | 842 |
| 843 void SurfaceAggregator::SetFullDamageForSurface(const SurfaceId& surface_id) { | 843 void SurfaceAggregator::SetFullDamageForSurface(const SurfaceId& surface_id) { |
| 844 auto it = previous_contained_surfaces_.find(surface_id); | 844 auto it = previous_contained_surfaces_.find(surface_id); |
| 845 if (it == previous_contained_surfaces_.end()) | 845 if (it == previous_contained_surfaces_.end()) |
| 846 return; | 846 return; |
| 847 // Set the last drawn index as 0 to ensure full damage next time it's drawn. | 847 // Set the last drawn index as 0 to ensure full damage next time it's drawn. |
| 848 it->second = 0; | 848 it->second = 0; |
| 849 } | 849 } |
| 850 | 850 |
| 851 void SurfaceAggregator::SetOutputColorSpace( |
| 852 const gfx::ColorSpace& output_color_space) { |
| 853 output_color_space_ = output_color_space; |
| 854 } |
| 855 |
| 851 } // namespace cc | 856 } // namespace cc |
| OLD | NEW |