| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/delegated_renderer_layer_impl.h" | 5 #include "cc/layers/delegated_renderer_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 occlusion_in_quad_space.GetUnoccludedContentRect( | 467 occlusion_in_quad_space.GetUnoccludedContentRect( |
| 468 delegated_quad->visible_rect); | 468 delegated_quad->visible_rect); |
| 469 | 469 |
| 470 if (quad_visible_rect.IsEmpty()) | 470 if (quad_visible_rect.IsEmpty()) |
| 471 continue; | 471 continue; |
| 472 | 472 |
| 473 if (delegated_quad->material != DrawQuad::RENDER_PASS) { | 473 if (delegated_quad->material != DrawQuad::RENDER_PASS) { |
| 474 DrawQuad* output_quad = render_pass->CopyFromAndAppendDrawQuad( | 474 DrawQuad* output_quad = render_pass->CopyFromAndAppendDrawQuad( |
| 475 delegated_quad, output_shared_quad_state); | 475 delegated_quad, output_shared_quad_state); |
| 476 output_quad->visible_rect = quad_visible_rect; | 476 output_quad->visible_rect = quad_visible_rect; |
| 477 // TODO(danakj): crbug.com/455931 |
| 478 output_quad->IterateResources(base::Bind( |
| 479 &ValidateResource, layer_tree_impl()->resource_provider())); |
| 477 } else { | 480 } else { |
| 478 RenderPassId delegated_contributing_render_pass_id = | 481 RenderPassId delegated_contributing_render_pass_id = |
| 479 RenderPassDrawQuad::MaterialCast(delegated_quad)->render_pass_id; | 482 RenderPassDrawQuad::MaterialCast(delegated_quad)->render_pass_id; |
| 480 RenderPassId output_contributing_render_pass_id(-1, -1); | 483 RenderPassId output_contributing_render_pass_id(-1, -1); |
| 481 | 484 |
| 482 bool present = | 485 bool present = |
| 483 ConvertDelegatedRenderPassId(delegated_contributing_render_pass_id, | 486 ConvertDelegatedRenderPassId(delegated_contributing_render_pass_id, |
| 484 &output_contributing_render_pass_id); | 487 &output_contributing_render_pass_id); |
| 485 | 488 |
| 486 // The frame may have a RenderPassDrawQuad that points to a RenderPass not | 489 // The frame may have a RenderPassDrawQuad that points to a RenderPass not |
| 487 // part of the frame. Just ignore these quads. | 490 // part of the frame. Just ignore these quads. |
| 488 if (present) { | 491 if (present) { |
| 489 DCHECK(output_contributing_render_pass_id != render_pass->id); | 492 DCHECK(output_contributing_render_pass_id != render_pass->id); |
| 490 | 493 |
| 491 RenderPassDrawQuad* output_quad = | 494 RenderPassDrawQuad* output_quad = |
| 492 render_pass->CopyFromAndAppendRenderPassDrawQuad( | 495 render_pass->CopyFromAndAppendRenderPassDrawQuad( |
| 493 RenderPassDrawQuad::MaterialCast(delegated_quad), | 496 RenderPassDrawQuad::MaterialCast(delegated_quad), |
| 494 output_shared_quad_state, | 497 output_shared_quad_state, |
| 495 output_contributing_render_pass_id); | 498 output_contributing_render_pass_id); |
| 496 output_quad->visible_rect = quad_visible_rect; | 499 output_quad->visible_rect = quad_visible_rect; |
| 500 |
| 501 // TODO(danakj): crbug.com/455931 |
| 502 output_quad->IterateResources(base::Bind( |
| 503 &ValidateResource, layer_tree_impl()->resource_provider())); |
| 497 } | 504 } |
| 498 } | 505 } |
| 499 | |
| 500 // TODO(danakj): crbug.com/455931 | |
| 501 render_pass->quad_list.back()->IterateResources( | |
| 502 base::Bind(&ValidateResource, layer_tree_impl()->resource_provider())); | |
| 503 } | 506 } |
| 504 } | 507 } |
| 505 | 508 |
| 506 const char* DelegatedRendererLayerImpl::LayerTypeAsString() const { | 509 const char* DelegatedRendererLayerImpl::LayerTypeAsString() const { |
| 507 return "cc::DelegatedRendererLayerImpl"; | 510 return "cc::DelegatedRendererLayerImpl"; |
| 508 } | 511 } |
| 509 | 512 |
| 510 void DelegatedRendererLayerImpl::ClearChildId() { | 513 void DelegatedRendererLayerImpl::ClearChildId() { |
| 511 if (!child_id_) | 514 if (!child_id_) |
| 512 return; | 515 return; |
| 513 | 516 |
| 514 if (own_child_id_) { | 517 if (own_child_id_) { |
| 515 ResourceProvider* provider = layer_tree_impl()->resource_provider(); | 518 ResourceProvider* provider = layer_tree_impl()->resource_provider(); |
| 516 provider->DestroyChild(child_id_); | 519 provider->DestroyChild(child_id_); |
| 517 } | 520 } |
| 518 | 521 |
| 519 resources_.clear(); | 522 resources_.clear(); |
| 520 child_id_ = 0; | 523 child_id_ = 0; |
| 521 } | 524 } |
| 522 | 525 |
| 523 } // namespace cc | 526 } // namespace cc |
| OLD | NEW |