Chromium Code Reviews| 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 pass | |
| 291 // . | |
|
danakj
2017/07/27 21:24:33
this period should be attached to a word :) so wra
wutao
2017/07/28 17:05:16
Done
| |
| 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 id_to_render_pass_map_[copy_pass->id] = copy_pass.get(); | |
|
danakj
2017/07/27 21:24:33
one thought here: it seems like this map is only u
wutao
2017/07/28 17:05:16
Very nice, thank you.
The bool should not change a
| |
| 296 dest_pass_list_->push_back(std::move(copy_pass)); | 305 dest_pass_list_->push_back(std::move(copy_pass)); |
| 297 } | 306 } |
| 298 | 307 |
| 299 gfx::Transform surface_transform = | 308 gfx::Transform surface_transform = |
| 300 surface_quad->shared_quad_state->quad_to_target_transform; | 309 surface_quad->shared_quad_state->quad_to_target_transform; |
| 301 surface_transform.ConcatTransform(target_transform); | 310 surface_transform.ConcatTransform(target_transform); |
| 302 | 311 |
| 303 const auto& last_pass = *render_pass_list.back(); | 312 const auto& last_pass = *render_pass_list.back(); |
| 313 // This will check if all the surface_quads (including child surfaces) has | |
| 314 // damage because HandleSurfaceQuad is a recursive call by calling | |
| 315 // CopyQuadsToPass in it. | |
| 316 dest_pass->has_damage_from_contributing_content |= | |
| 317 !DamageRectForSurface(surface, last_pass, last_pass.output_rect) | |
| 318 .IsEmpty(); | |
| 319 | |
| 304 if (merge_pass) { | 320 if (merge_pass) { |
| 305 // TODO(jamesr): Clean up last pass special casing. | 321 // TODO(jamesr): Clean up last pass special casing. |
| 306 const cc::QuadList& quads = last_pass.quad_list; | 322 const cc::QuadList& quads = last_pass.quad_list; |
| 307 | 323 |
| 308 // Intersect the transformed visible rect and the clip rect to create a | 324 // Intersect the transformed visible rect and the clip rect to create a |
| 309 // smaller cliprect for the quad. | 325 // smaller cliprect for the quad. |
| 310 ClipData surface_quad_clip_rect( | 326 ClipData surface_quad_clip_rect( |
| 311 true, cc::MathUtil::MapEnclosingClippedRect( | 327 true, cc::MathUtil::MapEnclosingClippedRect( |
| 312 surface_quad->shared_quad_state->quad_to_target_transform, | 328 surface_quad->shared_quad_state->quad_to_target_transform, |
| 313 surface_quad->visible_rect)); | 329 surface_quad->visible_rect)); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 const cc::QuadList& source_quad_list, | 419 const cc::QuadList& source_quad_list, |
| 404 const cc::SharedQuadStateList& source_shared_quad_state_list, | 420 const cc::SharedQuadStateList& source_shared_quad_state_list, |
| 405 const std::unordered_map<cc::ResourceId, cc::ResourceId>& | 421 const std::unordered_map<cc::ResourceId, cc::ResourceId>& |
| 406 child_to_parent_map, | 422 child_to_parent_map, |
| 407 const gfx::Transform& target_transform, | 423 const gfx::Transform& target_transform, |
| 408 const ClipData& clip_rect, | 424 const ClipData& clip_rect, |
| 409 cc::RenderPass* dest_pass, | 425 cc::RenderPass* dest_pass, |
| 410 const SurfaceId& surface_id) { | 426 const SurfaceId& surface_id) { |
| 411 const cc::SharedQuadState* last_copied_source_shared_quad_state = nullptr; | 427 const cc::SharedQuadState* last_copied_source_shared_quad_state = nullptr; |
| 412 const cc::SharedQuadState* dest_shared_quad_state = nullptr; | 428 const cc::SharedQuadState* dest_shared_quad_state = nullptr; |
| 413 // If the current frame has copy requests then aggregate the entire | 429 // If the current frame has copy requests or cahced render passes, then |
|
danakj
2017/07/27 21:24:33
cached
wutao
2017/07/28 17:05:16
Done.
| |
| 414 // 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 |
| 415 const bool ignore_undamaged = aggregate_only_damaged_ && | 431 // ignored and we could cache partially drawn render pass. |
| 416 !has_copy_requests_ && | 432 const bool ignore_undamaged = |
| 417 !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); | |
| 418 // 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. |
| 419 // TODO(jbauman): This rect may contain unnecessary area if | 436 // TODO(jbauman): This rect may contain unnecessary area if |
| 420 // transform isn't axis-aligned. | 437 // transform isn't axis-aligned. |
| 421 gfx::Rect damage_rect_in_quad_space; | 438 gfx::Rect damage_rect_in_quad_space; |
| 422 bool damage_rect_in_quad_space_valid = false; | 439 bool damage_rect_in_quad_space_valid = false; |
| 423 | 440 |
| 424 #if DCHECK_IS_ON() | 441 #if DCHECK_IS_ON() |
| 425 // 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 |
| 426 // invalid SharedQuadState pointer, it should DCHECK. | 443 // invalid SharedQuadState pointer, it should DCHECK. |
| 427 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... | |
| 448 continue; | 465 continue; |
| 449 | 466 |
| 450 HandleSurfaceQuad(surface_quad, target_transform, clip_rect, dest_pass, | 467 HandleSurfaceQuad(surface_quad, target_transform, clip_rect, dest_pass, |
| 451 ignore_undamaged, &damage_rect_in_quad_space, | 468 ignore_undamaged, &damage_rect_in_quad_space, |
| 452 &damage_rect_in_quad_space_valid); | 469 &damage_rect_in_quad_space_valid); |
| 453 } else { | 470 } else { |
| 454 if (quad->shared_quad_state != last_copied_source_shared_quad_state) { | 471 if (quad->shared_quad_state != last_copied_source_shared_quad_state) { |
| 455 dest_shared_quad_state = CopySharedQuadState( | 472 dest_shared_quad_state = CopySharedQuadState( |
| 456 quad->shared_quad_state, target_transform, clip_rect, dest_pass); | 473 quad->shared_quad_state, target_transform, clip_rect, dest_pass); |
| 457 last_copied_source_shared_quad_state = quad->shared_quad_state; | 474 last_copied_source_shared_quad_state = quad->shared_quad_state; |
| 458 if (aggregate_only_damaged_ && !has_copy_requests_) { | 475 if (aggregate_only_damaged_ && !has_copy_requests_ && |
| 476 !has_cached_render_passes_) { | |
| 459 damage_rect_in_quad_space_valid = CalculateQuadSpaceDamageRect( | 477 damage_rect_in_quad_space_valid = CalculateQuadSpaceDamageRect( |
| 460 dest_shared_quad_state->quad_to_target_transform, | 478 dest_shared_quad_state->quad_to_target_transform, |
| 461 dest_pass->transform_to_root_target, root_damage_rect_, | 479 dest_pass->transform_to_root_target, root_damage_rect_, |
| 462 &damage_rect_in_quad_space); | 480 &damage_rect_in_quad_space); |
| 463 } | 481 } |
| 464 } | 482 } |
| 465 | 483 |
| 466 if (ignore_undamaged) { | 484 if (ignore_undamaged) { |
| 467 if (damage_rect_in_quad_space_valid && | 485 if (damage_rect_in_quad_space_valid && |
| 468 !damage_rect_in_quad_space.Intersects(quad->visible_rect)) | 486 !damage_rect_in_quad_space.Intersects(quad->visible_rect)) |
| 469 continue; | 487 continue; |
| 470 } | 488 } |
| 471 | 489 |
| 472 cc::DrawQuad* dest_quad; | 490 cc::DrawQuad* dest_quad; |
| 473 if (quad->material == cc::DrawQuad::RENDER_PASS) { | 491 if (quad->material == cc::DrawQuad::RENDER_PASS) { |
| 474 const auto* pass_quad = cc::RenderPassDrawQuad::MaterialCast(quad); | 492 const auto* pass_quad = cc::RenderPassDrawQuad::MaterialCast(quad); |
| 475 int original_pass_id = pass_quad->render_pass_id; | 493 cc::RenderPassId original_pass_id = pass_quad->render_pass_id; |
| 476 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 auto iter = id_to_render_pass_map_.find(remapped_pass_id); | |
| 501 if (iter != id_to_render_pass_map_.end()) { | |
| 502 dest_pass->has_damage_from_contributing_content |= | |
| 503 iter->second->has_damage_from_contributing_content; | |
| 504 } | |
| 477 | 505 |
| 478 dest_quad = dest_pass->CopyFromAndAppendRenderPassDrawQuad( | 506 dest_quad = dest_pass->CopyFromAndAppendRenderPassDrawQuad( |
| 479 pass_quad, dest_shared_quad_state, remapped_pass_id); | 507 pass_quad, dest_shared_quad_state, remapped_pass_id); |
| 480 } else if (quad->material == cc::DrawQuad::TEXTURE_CONTENT) { | 508 } else if (quad->material == cc::DrawQuad::TEXTURE_CONTENT) { |
| 481 const auto* texture_quad = cc::TextureDrawQuad::MaterialCast(quad); | 509 const auto* texture_quad = cc::TextureDrawQuad::MaterialCast(quad); |
| 482 if (texture_quad->secure_output_only && | 510 if (texture_quad->secure_output_only && |
| 483 (!output_is_secure_ || copy_request_passes_.count(dest_pass->id))) { | 511 (!output_is_secure_ || copy_request_passes_.count(dest_pass->id))) { |
| 484 auto* solid_color_quad = | 512 auto* solid_color_quad = |
| 485 dest_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); | 513 dest_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); |
| 486 solid_color_quad->SetNew(dest_shared_quad_state, quad->rect, | 514 solid_color_quad->SetNew(dest_shared_quad_state, quad->rect, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 535 auto copy_pass = cc::RenderPass::Create(sqs_size, dq_size); | 563 auto copy_pass = cc::RenderPass::Create(sqs_size, dq_size); |
| 536 | 564 |
| 537 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); | 565 MoveMatchingRequests(source.id, ©_requests, ©_pass->copy_requests); |
| 538 | 566 |
| 539 cc::RenderPassId remapped_pass_id = | 567 cc::RenderPassId remapped_pass_id = |
| 540 RemapPassId(source.id, surface->surface_id()); | 568 RemapPassId(source.id, surface->surface_id()); |
| 541 | 569 |
| 542 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, | 570 copy_pass->SetAll(remapped_pass_id, source.output_rect, source.output_rect, |
| 543 source.transform_to_root_target, source.filters, | 571 source.transform_to_root_target, source.filters, |
| 544 source.background_filters, blending_color_space_, | 572 source.background_filters, blending_color_space_, |
| 545 source.has_transparent_background); | 573 source.has_transparent_background, |
| 574 source.cache_render_pass, | |
| 575 source.has_damage_from_contributing_content); | |
| 546 | 576 |
| 547 CopyQuadsToPass(source.quad_list, source.shared_quad_state_list, | 577 CopyQuadsToPass(source.quad_list, source.shared_quad_state_list, |
| 548 child_to_parent_map, gfx::Transform(), ClipData(), | 578 child_to_parent_map, gfx::Transform(), ClipData(), |
| 549 copy_pass.get(), surface->surface_id()); | 579 copy_pass.get(), surface->surface_id()); |
| 580 | |
| 581 // If the render pass has copy requests, or should be cached, or has | |
| 582 // moving-pixel filters, or in a moving-pixel surface, we should damage the | |
| 583 // whole output rect so that we always drawn the full content. Otherwise, we | |
| 584 // might have incompleted copy request, or cached patially drawn render pass | |
| 585 // . | |
|
danakj
2017/07/27 21:24:33
this one also
wutao
2017/07/28 17:05:16
Done.
| |
| 550 if (!copy_request_passes_.count(remapped_pass_id) && | 586 if (!copy_request_passes_.count(remapped_pass_id) && |
| 587 !copy_pass->cache_render_pass && | |
| 551 !moved_pixel_passes_.count(remapped_pass_id)) { | 588 !moved_pixel_passes_.count(remapped_pass_id)) { |
| 552 gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); | 589 gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); |
| 553 if (copy_pass->transform_to_root_target.GetInverse(&inverse_transform)) { | 590 if (copy_pass->transform_to_root_target.GetInverse(&inverse_transform)) { |
| 554 gfx::Rect damage_rect_in_render_pass_space = | 591 gfx::Rect damage_rect_in_render_pass_space = |
| 555 cc::MathUtil::ProjectEnclosingClippedRect(inverse_transform, | 592 cc::MathUtil::ProjectEnclosingClippedRect(inverse_transform, |
| 556 root_damage_rect_); | 593 root_damage_rect_); |
| 557 copy_pass->damage_rect.Intersect(damage_rect_in_render_pass_space); | 594 copy_pass->damage_rect.Intersect(damage_rect_in_render_pass_space); |
| 558 } | 595 } |
| 559 } | 596 } |
| 560 | 597 |
| 598 id_to_render_pass_map_[copy_pass->id] = copy_pass.get(); | |
| 561 dest_pass_list_->push_back(std::move(copy_pass)); | 599 dest_pass_list_->push_back(std::move(copy_pass)); |
| 562 } | 600 } |
| 563 } | 601 } |
| 564 | 602 |
| 565 void SurfaceAggregator::ProcessAddedAndRemovedSurfaces() { | 603 void SurfaceAggregator::ProcessAddedAndRemovedSurfaces() { |
| 566 for (const auto& surface : previous_contained_surfaces_) { | 604 for (const auto& surface : previous_contained_surfaces_) { |
| 567 if (!contained_surfaces_.count(surface.first)) { | 605 if (!contained_surfaces_.count(surface.first)) { |
| 568 // Release resources of removed surface. | 606 // Release resources of removed surface. |
| 569 auto it = surface_id_to_resource_child_id_.find(surface.first); | 607 auto it = surface_id_to_resource_child_id_.find(surface.first); |
| 570 if (it != surface_id_to_resource_child_id_.end()) { | 608 if (it != surface_id_to_resource_child_id_.end()) { |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 761 CHECK(debug_weak_this.get()); | 799 CHECK(debug_weak_this.get()); |
| 762 // TODO(staraz): It shouldn't need to call the callback when the damage is | 800 // TODO(staraz): It shouldn't need to call the callback when the damage is |
| 763 // from |surface| and not from |child_surfaces|. | 801 // from |surface| and not from |child_surfaces|. |
| 764 if (!damage_rect.IsEmpty()) { | 802 if (!damage_rect.IsEmpty()) { |
| 765 surface->RunWillDrawCallback(damage_rect); | 803 surface->RunWillDrawCallback(damage_rect); |
| 766 manager_->SurfaceWillDraw(surface->surface_id()); | 804 manager_->SurfaceWillDraw(surface->surface_id()); |
| 767 } | 805 } |
| 768 | 806 |
| 769 CHECK(debug_weak_this.get()); | 807 CHECK(debug_weak_this.get()); |
| 770 for (const auto& render_pass : frame.render_pass_list) { | 808 for (const auto& render_pass : frame.render_pass_list) { |
| 771 if (!render_pass->copy_requests.empty()) { | 809 cc::RenderPassId remapped_pass_id = |
| 772 cc::RenderPassId remapped_pass_id = | 810 RemapPassId(render_pass->id, surface_id); |
| 773 RemapPassId(render_pass->id, surface_id); | 811 if (!render_pass->copy_requests.empty()) |
| 774 copy_request_passes_.insert(remapped_pass_id); | 812 copy_request_passes_.insert(remapped_pass_id); |
| 775 } | 813 if (render_pass->cache_render_pass) |
| 814 cached_render_passes_.insert(remapped_pass_id); | |
|
danakj
2017/07/27 21:24:33
it seems like we're building this structure just t
wutao
2017/07/28 17:05:16
Good point, done.
| |
| 776 } | 815 } |
| 777 | 816 |
| 778 // TODO(jbauman): Remove when https://crbug.com/745684 fixed. | 817 // TODO(jbauman): Remove when https://crbug.com/745684 fixed. |
| 779 CHECK(surface->surface_id() == surface_id); | 818 CHECK(surface->surface_id() == surface_id); |
| 780 auto it = referenced_surfaces_.find(surface_id); | 819 auto it = referenced_surfaces_.find(surface_id); |
| 781 // TODO(jbauman): Remove when https://crbug.com/745684 fixed. | 820 // TODO(jbauman): Remove when https://crbug.com/745684 fixed. |
| 782 CHECK(referenced_surfaces_.end() != it); | 821 CHECK(referenced_surfaces_.end() != it); |
| 783 referenced_surfaces_.erase(it); | 822 referenced_surfaces_.erase(it); |
| 784 if (!damage_rect.IsEmpty() && frame.metadata.may_contain_video) | 823 if (!damage_rect.IsEmpty() && frame.metadata.may_contain_video) |
| 785 result->may_contain_video = true; | 824 result->may_contain_video = true; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 864 | 903 |
| 865 cc::CompositorFrame frame; | 904 cc::CompositorFrame frame; |
| 866 | 905 |
| 867 dest_pass_list_ = &frame.render_pass_list; | 906 dest_pass_list_ = &frame.render_pass_list; |
| 868 | 907 |
| 869 valid_surfaces_.clear(); | 908 valid_surfaces_.clear(); |
| 870 PrewalkResult prewalk_result; | 909 PrewalkResult prewalk_result; |
| 871 root_damage_rect_ = PrewalkTree(surface_id, false, 0, &prewalk_result); | 910 root_damage_rect_ = PrewalkTree(surface_id, false, 0, &prewalk_result); |
| 872 PropagateCopyRequestPasses(); | 911 PropagateCopyRequestPasses(); |
| 873 has_copy_requests_ = !copy_request_passes_.empty(); | 912 has_copy_requests_ = !copy_request_passes_.empty(); |
| 913 has_cached_render_passes_ = !cached_render_passes_.empty(); | |
| 874 frame.metadata.may_contain_video = prewalk_result.may_contain_video; | 914 frame.metadata.may_contain_video = prewalk_result.may_contain_video; |
| 875 | 915 |
| 876 CopyUndrawnSurfaces(&prewalk_result); | 916 CopyUndrawnSurfaces(&prewalk_result); |
| 877 referenced_surfaces_.insert(surface_id); | 917 referenced_surfaces_.insert(surface_id); |
| 878 CopyPasses(root_surface_frame, surface); | 918 CopyPasses(root_surface_frame, surface); |
| 879 // CopyPasses may have mutated container, need to re-query to erase. | 919 // CopyPasses may have mutated container, need to re-query to erase. |
| 880 referenced_surfaces_.erase(referenced_surfaces_.find(surface_id)); | 920 referenced_surfaces_.erase(referenced_surfaces_.find(surface_id)); |
| 881 AddColorConversionPass(); | 921 AddColorConversionPass(); |
| 882 | 922 |
| 883 moved_pixel_passes_.clear(); | 923 moved_pixel_passes_.clear(); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 894 it = render_pass_allocator_map_.erase(it); | 934 it = render_pass_allocator_map_.erase(it); |
| 895 } | 935 } |
| 896 } | 936 } |
| 897 | 937 |
| 898 DCHECK(referenced_surfaces_.empty()); | 938 DCHECK(referenced_surfaces_.empty()); |
| 899 | 939 |
| 900 if (dest_pass_list_->empty()) | 940 if (dest_pass_list_->empty()) |
| 901 return {}; | 941 return {}; |
| 902 | 942 |
| 903 dest_pass_list_ = NULL; | 943 dest_pass_list_ = NULL; |
| 944 id_to_render_pass_map_.clear(); | |
| 904 ProcessAddedAndRemovedSurfaces(); | 945 ProcessAddedAndRemovedSurfaces(); |
| 905 contained_surfaces_.swap(previous_contained_surfaces_); | 946 contained_surfaces_.swap(previous_contained_surfaces_); |
| 906 contained_surfaces_.clear(); | 947 contained_surfaces_.clear(); |
| 907 | 948 |
| 908 for (auto it : previous_contained_surfaces_) { | 949 for (auto it : previous_contained_surfaces_) { |
| 909 Surface* surface = manager_->GetSurfaceForId(it.first); | 950 Surface* surface = manager_->GetSurfaceForId(it.first); |
| 910 if (surface) | 951 if (surface) |
| 911 surface->TakeLatencyInfo(&frame.metadata.latency_info); | 952 surface->TakeLatencyInfo(&frame.metadata.latency_info); |
| 912 } | 953 } |
| 913 | 954 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 947 const gfx::ColorSpace& output_color_space) { | 988 const gfx::ColorSpace& output_color_space) { |
| 948 blending_color_space_ = blending_color_space.IsValid() | 989 blending_color_space_ = blending_color_space.IsValid() |
| 949 ? blending_color_space | 990 ? blending_color_space |
| 950 : gfx::ColorSpace::CreateSRGB(); | 991 : gfx::ColorSpace::CreateSRGB(); |
| 951 output_color_space_ = output_color_space.IsValid() | 992 output_color_space_ = output_color_space.IsValid() |
| 952 ? output_color_space | 993 ? output_color_space |
| 953 : gfx::ColorSpace::CreateSRGB(); | 994 : gfx::ColorSpace::CreateSRGB(); |
| 954 } | 995 } |
| 955 | 996 |
| 956 } // namespace viz | 997 } // namespace viz |
| OLD | NEW |