| 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 "components/viz/service/display/surface_aggregator.h" | 5 #include "components/viz/service/display/surface_aggregator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 size_t sqs_size = source.shared_quad_state_list.size(); | 258 size_t sqs_size = source.shared_quad_state_list.size(); |
| 259 size_t dq_size = source.quad_list.size(); | 259 size_t dq_size = source.quad_list.size(); |
| 260 std::unique_ptr<cc::RenderPass> copy_pass( | 260 std::unique_ptr<cc::RenderPass> copy_pass( |
| 261 cc::RenderPass::Create(sqs_size, dq_size)); | 261 cc::RenderPass::Create(sqs_size, dq_size)); |
| 262 | 262 |
| 263 cc::RenderPassId remapped_pass_id = RemapPassId(source.id, surface_id); | 263 cc::RenderPassId remapped_pass_id = RemapPassId(source.id, surface_id); |
| 264 | 264 |
| 265 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, | 265 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, |
| 266 source.transform_to_root_target, source.filters, | 266 source.transform_to_root_target, source.filters, |
| 267 source.background_filters, blending_color_space_, | 267 source.background_filters, blending_color_space_, |
| 268 source.has_transparent_background); | 268 source.has_transparent_background, |
| 269 source.cache_render_pass, |
| 270 source.has_damage_from_contributing_content); |
| 269 | 271 |
| 270 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); | 272 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); |
| 271 | 273 |
| 272 // Contributing passes aggregated in to the pass list need to take the | 274 // Contributing passes aggregated in to the pass list need to take the |
| 273 // transform of the surface quad into account to update their transform to | 275 // transform of the surface quad into account to update their transform to |
| 274 // the root surface. | 276 // the root surface. |
| 275 copy_pass->transform_to_root_target.ConcatTransform( | 277 copy_pass->transform_to_root_target.ConcatTransform( |
| 276 surface_quad->shared_quad_state->quad_to_target_transform); | 278 surface_quad->shared_quad_state->quad_to_target_transform); |
| 277 copy_pass->transform_to_root_target.ConcatTransform(target_transform); | 279 copy_pass->transform_to_root_target.ConcatTransform(target_transform); |
| 278 copy_pass->transform_to_root_target.ConcatTransform( | 280 copy_pass->transform_to_root_target.ConcatTransform( |
| 279 dest_pass->transform_to_root_target); | 281 dest_pass->transform_to_root_target); |
| 280 | 282 |
| 281 CopyQuadsToPass(source.quad_list, source.shared_quad_state_list, | 283 CopyQuadsToPass(source.quad_list, source.shared_quad_state_list, |
| 282 child_to_parent_map, gfx::Transform(), ClipData(), | 284 child_to_parent_map, gfx::Transform(), ClipData(), |
| 283 copy_pass.get(), surface_id); | 285 copy_pass.get(), surface_id); |
| 284 | 286 |
| 287 // If the render pass has copy requests, or should be cached, or has |
| 288 // moving-pixel filters, or in a moving-pixel surface, we should damage the |
| 289 // whole output rect so that we always drawn the full content. Otherwise, we |
| 290 // might have incompleted copy request, or cached patially drawn render |
| 291 // pass. |
| 285 if (!copy_request_passes_.count(remapped_pass_id) && | 292 if (!copy_request_passes_.count(remapped_pass_id) && |
| 293 !copy_pass->cache_render_pass && |
| 286 !moved_pixel_passes_.count(remapped_pass_id)) { | 294 !moved_pixel_passes_.count(remapped_pass_id)) { |
| 287 gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); | 295 gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); |
| 288 if (copy_pass->transform_to_root_target.GetInverse(&inverse_transform)) { | 296 if (copy_pass->transform_to_root_target.GetInverse(&inverse_transform)) { |
| 289 gfx::Rect damage_rect_in_render_pass_space = | 297 gfx::Rect damage_rect_in_render_pass_space = |
| 290 cc::MathUtil::ProjectEnclosingClippedRect(inverse_transform, | 298 cc::MathUtil::ProjectEnclosingClippedRect(inverse_transform, |
| 291 root_damage_rect_); | 299 root_damage_rect_); |
| 292 copy_pass->damage_rect.Intersect(damage_rect_in_render_pass_space); | 300 copy_pass->damage_rect.Intersect(damage_rect_in_render_pass_space); |
| 293 } | 301 } |
| 294 } | 302 } |
| 295 | 303 |
| 304 if (copy_pass->has_damage_from_contributing_content) |
| 305 contributing_content_damaged_passes_.insert(copy_pass->id); |
| 296 dest_pass_list_->push_back(std::move(copy_pass)); | 306 dest_pass_list_->push_back(std::move(copy_pass)); |
| 297 } | 307 } |
| 298 | 308 |
| 299 gfx::Transform surface_transform = | 309 gfx::Transform surface_transform = |
| 300 surface_quad->shared_quad_state->quad_to_target_transform; | 310 surface_quad->shared_quad_state->quad_to_target_transform; |
| 301 surface_transform.ConcatTransform(target_transform); | 311 surface_transform.ConcatTransform(target_transform); |
| 302 | 312 |
| 303 const auto& last_pass = *render_pass_list.back(); | 313 const auto& last_pass = *render_pass_list.back(); |
| 314 // This will check if all the surface_quads (including child surfaces) has |
| 315 // damage because HandleSurfaceQuad is a recursive call by calling |
| 316 // CopyQuadsToPass in it. |
| 317 dest_pass->has_damage_from_contributing_content |= |
| 318 !DamageRectForSurface(surface, last_pass, last_pass.output_rect) |
| 319 .IsEmpty(); |
| 320 |
| 304 if (merge_pass) { | 321 if (merge_pass) { |
| 305 // TODO(jamesr): Clean up last pass special casing. | 322 // TODO(jamesr): Clean up last pass special casing. |
| 306 const cc::QuadList& quads = last_pass.quad_list; | 323 const cc::QuadList& quads = last_pass.quad_list; |
| 307 | 324 |
| 308 // Intersect the transformed visible rect and the clip rect to create a | 325 // Intersect the transformed visible rect and the clip rect to create a |
| 309 // smaller cliprect for the quad. | 326 // smaller cliprect for the quad. |
| 310 ClipData surface_quad_clip_rect( | 327 ClipData surface_quad_clip_rect( |
| 311 true, cc::MathUtil::MapEnclosingClippedRect( | 328 true, cc::MathUtil::MapEnclosingClippedRect( |
| 312 surface_quad->shared_quad_state->quad_to_target_transform, | 329 surface_quad->shared_quad_state->quad_to_target_transform, |
| 313 surface_quad->visible_rect)); | 330 surface_quad->visible_rect)); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 void SurfaceAggregator::CopyQuadsToPass( | 419 void SurfaceAggregator::CopyQuadsToPass( |
| 403 const cc::QuadList& source_quad_list, | 420 const cc::QuadList& source_quad_list, |
| 404 const cc::SharedQuadStateList& source_shared_quad_state_list, | 421 const cc::SharedQuadStateList& source_shared_quad_state_list, |
| 405 const std::unordered_map<ResourceId, ResourceId>& child_to_parent_map, | 422 const std::unordered_map<ResourceId, ResourceId>& child_to_parent_map, |
| 406 const gfx::Transform& target_transform, | 423 const gfx::Transform& target_transform, |
| 407 const ClipData& clip_rect, | 424 const ClipData& clip_rect, |
| 408 cc::RenderPass* dest_pass, | 425 cc::RenderPass* dest_pass, |
| 409 const SurfaceId& surface_id) { | 426 const SurfaceId& surface_id) { |
| 410 const cc::SharedQuadState* last_copied_source_shared_quad_state = nullptr; | 427 const cc::SharedQuadState* last_copied_source_shared_quad_state = nullptr; |
| 411 const cc::SharedQuadState* dest_shared_quad_state = nullptr; | 428 const cc::SharedQuadState* dest_shared_quad_state = nullptr; |
| 412 // If the current frame has copy requests then aggregate the entire | 429 // If the current frame has copy requests or cached render passes, then |
| 413 // thing, as otherwise parts of the copy requests may be ignored. | 430 // aggregate the entire thing, as otherwise parts of the copy requests may be |
| 414 const bool ignore_undamaged = aggregate_only_damaged_ && | 431 // ignored and we could cache partially drawn render pass. |
| 415 !has_copy_requests_ && | 432 const bool ignore_undamaged = |
| 416 !moved_pixel_passes_.count(dest_pass->id); | 433 aggregate_only_damaged_ && !has_copy_requests_ && |
| 434 !has_cached_render_passes_ && !moved_pixel_passes_.count(dest_pass->id); |
| 417 // Damage rect in the quad space of the current shared quad state. | 435 // Damage rect in the quad space of the current shared quad state. |
| 418 // TODO(jbauman): This rect may contain unnecessary area if | 436 // TODO(jbauman): This rect may contain unnecessary area if |
| 419 // transform isn't axis-aligned. | 437 // transform isn't axis-aligned. |
| 420 gfx::Rect damage_rect_in_quad_space; | 438 gfx::Rect damage_rect_in_quad_space; |
| 421 bool damage_rect_in_quad_space_valid = false; | 439 bool damage_rect_in_quad_space_valid = false; |
| 422 | 440 |
| 423 #if DCHECK_IS_ON() | 441 #if DCHECK_IS_ON() |
| 424 // If quads have come in with SharedQuadState out of order, or when quads have | 442 // If quads have come in with SharedQuadState out of order, or when quads have |
| 425 // invalid SharedQuadState pointer, it should DCHECK. | 443 // invalid SharedQuadState pointer, it should DCHECK. |
| 426 auto sqs_iter = source_shared_quad_state_list.cbegin(); | 444 auto sqs_iter = source_shared_quad_state_list.cbegin(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 447 continue; | 465 continue; |
| 448 | 466 |
| 449 HandleSurfaceQuad(surface_quad, target_transform, clip_rect, dest_pass, | 467 HandleSurfaceQuad(surface_quad, target_transform, clip_rect, dest_pass, |
| 450 ignore_undamaged, &damage_rect_in_quad_space, | 468 ignore_undamaged, &damage_rect_in_quad_space, |
| 451 &damage_rect_in_quad_space_valid); | 469 &damage_rect_in_quad_space_valid); |
| 452 } else { | 470 } else { |
| 453 if (quad->shared_quad_state != last_copied_source_shared_quad_state) { | 471 if (quad->shared_quad_state != last_copied_source_shared_quad_state) { |
| 454 dest_shared_quad_state = CopySharedQuadState( | 472 dest_shared_quad_state = CopySharedQuadState( |
| 455 quad->shared_quad_state, target_transform, clip_rect, dest_pass); | 473 quad->shared_quad_state, target_transform, clip_rect, dest_pass); |
| 456 last_copied_source_shared_quad_state = quad->shared_quad_state; | 474 last_copied_source_shared_quad_state = quad->shared_quad_state; |
| 457 if (aggregate_only_damaged_ && !has_copy_requests_) { | 475 if (aggregate_only_damaged_ && !has_copy_requests_ && |
| 476 !has_cached_render_passes_) { |
| 458 damage_rect_in_quad_space_valid = CalculateQuadSpaceDamageRect( | 477 damage_rect_in_quad_space_valid = CalculateQuadSpaceDamageRect( |
| 459 dest_shared_quad_state->quad_to_target_transform, | 478 dest_shared_quad_state->quad_to_target_transform, |
| 460 dest_pass->transform_to_root_target, root_damage_rect_, | 479 dest_pass->transform_to_root_target, root_damage_rect_, |
| 461 &damage_rect_in_quad_space); | 480 &damage_rect_in_quad_space); |
| 462 } | 481 } |
| 463 } | 482 } |
| 464 | 483 |
| 465 if (ignore_undamaged) { | 484 if (ignore_undamaged) { |
| 466 if (damage_rect_in_quad_space_valid && | 485 if (damage_rect_in_quad_space_valid && |
| 467 !damage_rect_in_quad_space.Intersects(quad->visible_rect)) | 486 !damage_rect_in_quad_space.Intersects(quad->visible_rect)) |
| 468 continue; | 487 continue; |
| 469 } | 488 } |
| 470 | 489 |
| 471 cc::DrawQuad* dest_quad; | 490 cc::DrawQuad* dest_quad; |
| 472 if (quad->material == cc::DrawQuad::RENDER_PASS) { | 491 if (quad->material == cc::DrawQuad::RENDER_PASS) { |
| 473 const auto* pass_quad = cc::RenderPassDrawQuad::MaterialCast(quad); | 492 const auto* pass_quad = cc::RenderPassDrawQuad::MaterialCast(quad); |
| 474 int original_pass_id = pass_quad->render_pass_id; | 493 cc::RenderPassId original_pass_id = pass_quad->render_pass_id; |
| 475 int remapped_pass_id = RemapPassId(original_pass_id, surface_id); | 494 cc::RenderPassId remapped_pass_id = |
| 495 RemapPassId(original_pass_id, surface_id); |
| 496 |
| 497 // If the RenderPassDrawQuad is referring to other render pass with the |
| 498 // |has_damage_from_contributing_content| set on it, then the dest_pass |
| 499 // should have the flag set on it as well. |
| 500 if (contributing_content_damaged_passes_.count(remapped_pass_id)) |
| 501 dest_pass->has_damage_from_contributing_content = true; |
| 476 | 502 |
| 477 dest_quad = dest_pass->CopyFromAndAppendRenderPassDrawQuad( | 503 dest_quad = dest_pass->CopyFromAndAppendRenderPassDrawQuad( |
| 478 pass_quad, dest_shared_quad_state, remapped_pass_id); | 504 pass_quad, dest_shared_quad_state, remapped_pass_id); |
| 479 } else if (quad->material == cc::DrawQuad::TEXTURE_CONTENT) { | 505 } else if (quad->material == cc::DrawQuad::TEXTURE_CONTENT) { |
| 480 const auto* texture_quad = cc::TextureDrawQuad::MaterialCast(quad); | 506 const auto* texture_quad = cc::TextureDrawQuad::MaterialCast(quad); |
| 481 if (texture_quad->secure_output_only && | 507 if (texture_quad->secure_output_only && |
| 482 (!output_is_secure_ || copy_request_passes_.count(dest_pass->id))) { | 508 (!output_is_secure_ || copy_request_passes_.count(dest_pass->id))) { |
| 483 auto* solid_color_quad = | 509 auto* solid_color_quad = |
| 484 dest_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); | 510 dest_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); |
| 485 solid_color_quad->SetNew(dest_shared_quad_state, quad->rect, | 511 solid_color_quad->SetNew(dest_shared_quad_state, quad->rect, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 auto copy_pass = cc::RenderPass::Create(sqs_size, dq_size); | 560 auto copy_pass = cc::RenderPass::Create(sqs_size, dq_size); |
| 535 | 561 |
| 536 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); | 562 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); |
| 537 | 563 |
| 538 cc::RenderPassId remapped_pass_id = | 564 cc::RenderPassId remapped_pass_id = |
| 539 RemapPassId(source.id, surface->surface_id()); | 565 RemapPassId(source.id, surface->surface_id()); |
| 540 | 566 |
| 541 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, | 567 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, |
| 542 source.transform_to_root_target, source.filters, | 568 source.transform_to_root_target, source.filters, |
| 543 source.background_filters, blending_color_space_, | 569 source.background_filters, blending_color_space_, |
| 544 source.has_transparent_background); | 570 source.has_transparent_background, |
| 571 source.cache_render_pass, |
| 572 source.has_damage_from_contributing_content); |
| 545 | 573 |
| 546 CopyQuadsToPass(source.quad_list, source.shared_quad_state_list, | 574 CopyQuadsToPass(source.quad_list, source.shared_quad_state_list, |
| 547 child_to_parent_map, gfx::Transform(), ClipData(), | 575 child_to_parent_map, gfx::Transform(), ClipData(), |
| 548 copy_pass.get(), surface->surface_id()); | 576 copy_pass.get(), surface->surface_id()); |
| 577 |
| 578 // If the render pass has copy requests, or should be cached, or has |
| 579 // moving-pixel filters, or in a moving-pixel surface, we should damage the |
| 580 // whole output rect so that we always drawn the full content. Otherwise, we |
| 581 // might have incompleted copy request, or cached patially drawn render |
| 582 // pass. |
| 549 if (!copy_request_passes_.count(remapped_pass_id) && | 583 if (!copy_request_passes_.count(remapped_pass_id) && |
| 584 !copy_pass->cache_render_pass && |
| 550 !moved_pixel_passes_.count(remapped_pass_id)) { | 585 !moved_pixel_passes_.count(remapped_pass_id)) { |
| 551 gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); | 586 gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); |
| 552 if (copy_pass->transform_to_root_target.GetInverse(&inverse_transform)) { | 587 if (copy_pass->transform_to_root_target.GetInverse(&inverse_transform)) { |
| 553 gfx::Rect damage_rect_in_render_pass_space = | 588 gfx::Rect damage_rect_in_render_pass_space = |
| 554 cc::MathUtil::ProjectEnclosingClippedRect(inverse_transform, | 589 cc::MathUtil::ProjectEnclosingClippedRect(inverse_transform, |
| 555 root_damage_rect_); | 590 root_damage_rect_); |
| 556 copy_pass->damage_rect.Intersect(damage_rect_in_render_pass_space); | 591 copy_pass->damage_rect.Intersect(damage_rect_in_render_pass_space); |
| 557 } | 592 } |
| 558 } | 593 } |
| 559 | 594 |
| 595 if (copy_pass->has_damage_from_contributing_content) |
| 596 contributing_content_damaged_passes_.insert(copy_pass->id); |
| 560 dest_pass_list_->push_back(std::move(copy_pass)); | 597 dest_pass_list_->push_back(std::move(copy_pass)); |
| 561 } | 598 } |
| 562 } | 599 } |
| 563 | 600 |
| 564 void SurfaceAggregator::ProcessAddedAndRemovedSurfaces() { | 601 void SurfaceAggregator::ProcessAddedAndRemovedSurfaces() { |
| 565 for (const auto& surface : previous_contained_surfaces_) { | 602 for (const auto& surface : previous_contained_surfaces_) { |
| 566 if (!contained_surfaces_.count(surface.first)) { | 603 if (!contained_surfaces_.count(surface.first)) { |
| 567 // Release resources of removed surface. | 604 // Release resources of removed surface. |
| 568 auto it = surface_id_to_resource_child_id_.find(surface.first); | 605 auto it = surface_id_to_resource_child_id_.find(surface.first); |
| 569 if (it != surface_id_to_resource_child_id_.end()) { | 606 if (it != surface_id_to_resource_child_id_.end()) { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 manager_->SurfaceWillDraw(surface->surface_id()); | 802 manager_->SurfaceWillDraw(surface->surface_id()); |
| 766 } | 803 } |
| 767 | 804 |
| 768 CHECK(debug_weak_this.get()); | 805 CHECK(debug_weak_this.get()); |
| 769 for (const auto& render_pass : frame.render_pass_list) { | 806 for (const auto& render_pass : frame.render_pass_list) { |
| 770 if (!render_pass->copy_requests.empty()) { | 807 if (!render_pass->copy_requests.empty()) { |
| 771 cc::RenderPassId remapped_pass_id = | 808 cc::RenderPassId remapped_pass_id = |
| 772 RemapPassId(render_pass->id, surface_id); | 809 RemapPassId(render_pass->id, surface_id); |
| 773 copy_request_passes_.insert(remapped_pass_id); | 810 copy_request_passes_.insert(remapped_pass_id); |
| 774 } | 811 } |
| 812 if (render_pass->cache_render_pass) |
| 813 has_cached_render_passes_ = true; |
| 775 } | 814 } |
| 776 | 815 |
| 777 // TODO(jbauman): Remove when https://crbug.com/745684 fixed. | 816 // TODO(jbauman): Remove when https://crbug.com/745684 fixed. |
| 778 CHECK(surface->surface_id() == surface_id); | 817 CHECK(surface->surface_id() == surface_id); |
| 779 auto it = referenced_surfaces_.find(surface_id); | 818 auto it = referenced_surfaces_.find(surface_id); |
| 780 // TODO(jbauman): Remove when https://crbug.com/745684 fixed. | 819 // TODO(jbauman): Remove when https://crbug.com/745684 fixed. |
| 781 CHECK(referenced_surfaces_.end() != it); | 820 CHECK(referenced_surfaces_.end() != it); |
| 782 referenced_surfaces_.erase(it); | 821 referenced_surfaces_.erase(it); |
| 783 if (!damage_rect.IsEmpty() && frame.metadata.may_contain_video) | 822 if (!damage_rect.IsEmpty() && frame.metadata.may_contain_video) |
| 784 result->may_contain_video = true; | 823 result->may_contain_video = true; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 return {}; | 898 return {}; |
| 860 | 899 |
| 861 const cc::CompositorFrame& root_surface_frame = surface->GetActiveFrame(); | 900 const cc::CompositorFrame& root_surface_frame = surface->GetActiveFrame(); |
| 862 TRACE_EVENT0("viz", "SurfaceAggregator::Aggregate"); | 901 TRACE_EVENT0("viz", "SurfaceAggregator::Aggregate"); |
| 863 | 902 |
| 864 cc::CompositorFrame frame; | 903 cc::CompositorFrame frame; |
| 865 | 904 |
| 866 dest_pass_list_ = &frame.render_pass_list; | 905 dest_pass_list_ = &frame.render_pass_list; |
| 867 | 906 |
| 868 valid_surfaces_.clear(); | 907 valid_surfaces_.clear(); |
| 908 has_cached_render_passes_ = false; |
| 869 PrewalkResult prewalk_result; | 909 PrewalkResult prewalk_result; |
| 870 root_damage_rect_ = PrewalkTree(surface_id, false, 0, &prewalk_result); | 910 root_damage_rect_ = PrewalkTree(surface_id, false, 0, &prewalk_result); |
| 871 PropagateCopyRequestPasses(); | 911 PropagateCopyRequestPasses(); |
| 872 has_copy_requests_ = !copy_request_passes_.empty(); | 912 has_copy_requests_ = !copy_request_passes_.empty(); |
| 873 frame.metadata.may_contain_video = prewalk_result.may_contain_video; | 913 frame.metadata.may_contain_video = prewalk_result.may_contain_video; |
| 874 | 914 |
| 875 CopyUndrawnSurfaces(&prewalk_result); | 915 CopyUndrawnSurfaces(&prewalk_result); |
| 876 referenced_surfaces_.insert(surface_id); | 916 referenced_surfaces_.insert(surface_id); |
| 877 CopyPasses(root_surface_frame, surface); | 917 CopyPasses(root_surface_frame, surface); |
| 878 // CopyPasses may have mutated container, need to re-query to erase. | 918 // CopyPasses may have mutated container, need to re-query to erase. |
| 879 referenced_surfaces_.erase(referenced_surfaces_.find(surface_id)); | 919 referenced_surfaces_.erase(referenced_surfaces_.find(surface_id)); |
| 880 AddColorConversionPass(); | 920 AddColorConversionPass(); |
| 881 | 921 |
| 882 moved_pixel_passes_.clear(); | 922 moved_pixel_passes_.clear(); |
| 883 copy_request_passes_.clear(); | 923 copy_request_passes_.clear(); |
| 924 contributing_content_damaged_passes_.clear(); |
| 884 render_pass_dependencies_.clear(); | 925 render_pass_dependencies_.clear(); |
| 885 | 926 |
| 886 // Remove all render pass mappings that weren't used in the current frame. | 927 // Remove all render pass mappings that weren't used in the current frame. |
| 887 for (auto it = render_pass_allocator_map_.begin(); | 928 for (auto it = render_pass_allocator_map_.begin(); |
| 888 it != render_pass_allocator_map_.end();) { | 929 it != render_pass_allocator_map_.end();) { |
| 889 if (it->second.in_use) { | 930 if (it->second.in_use) { |
| 890 it->second.in_use = false; | 931 it->second.in_use = false; |
| 891 it++; | 932 it++; |
| 892 } else { | 933 } else { |
| 893 it = render_pass_allocator_map_.erase(it); | 934 it = render_pass_allocator_map_.erase(it); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 const gfx::ColorSpace& output_color_space) { | 987 const gfx::ColorSpace& output_color_space) { |
| 947 blending_color_space_ = blending_color_space.IsValid() | 988 blending_color_space_ = blending_color_space.IsValid() |
| 948 ? blending_color_space | 989 ? blending_color_space |
| 949 : gfx::ColorSpace::CreateSRGB(); | 990 : gfx::ColorSpace::CreateSRGB(); |
| 950 output_color_space_ = output_color_space.IsValid() | 991 output_color_space_ = output_color_space.IsValid() |
| 951 ? output_color_space | 992 ? output_color_space |
| 952 : gfx::ColorSpace::CreateSRGB(); | 993 : gfx::ColorSpace::CreateSRGB(); |
| 953 } | 994 } |
| 954 | 995 |
| 955 } // namespace viz | 996 } // namespace viz |
| OLD | NEW |