| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 force_anti_aliasing_off); | 387 force_anti_aliasing_off); |
| 388 | 388 |
| 389 SolidColorDrawQuad* right_quad = | 389 SolidColorDrawQuad* right_quad = |
| 390 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 390 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
| 391 right_quad->SetNew(shared_quad_state, right, right, | 391 right_quad->SetNew(shared_quad_state, right, right, |
| 392 colors[i % kNumColors], force_anti_aliasing_off); | 392 colors[i % kNumColors], force_anti_aliasing_off); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 | 396 |
| 397 // TODO(danakj): crbug.com/455931 |
| 398 static ResourceProvider::ResourceId ValidateResource( |
| 399 ResourceProvider* provider, |
| 400 ResourceProvider::ResourceId id) { |
| 401 provider->ValidateResource(id); |
| 402 return id; |
| 403 } |
| 404 |
| 397 void DelegatedRendererLayerImpl::AppendRenderPassQuads( | 405 void DelegatedRendererLayerImpl::AppendRenderPassQuads( |
| 398 RenderPass* render_pass, | 406 RenderPass* render_pass, |
| 399 const RenderPass* delegated_render_pass, | 407 const RenderPass* delegated_render_pass, |
| 400 const gfx::Size& frame_size) const { | 408 const gfx::Size& frame_size) const { |
| 401 const SharedQuadState* delegated_shared_quad_state = nullptr; | 409 const SharedQuadState* delegated_shared_quad_state = nullptr; |
| 402 SharedQuadState* output_shared_quad_state = nullptr; | 410 SharedQuadState* output_shared_quad_state = nullptr; |
| 403 | 411 |
| 404 for (const auto& delegated_quad : delegated_render_pass->quad_list) { | 412 for (const auto& delegated_quad : delegated_render_pass->quad_list) { |
| 405 bool is_root_delegated_render_pass = | 413 bool is_root_delegated_render_pass = |
| 406 delegated_render_pass == render_passes_in_draw_order_.back(); | 414 delegated_render_pass == render_passes_in_draw_order_.back(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 DCHECK(output_contributing_render_pass_id != render_pass->id); | 489 DCHECK(output_contributing_render_pass_id != render_pass->id); |
| 482 | 490 |
| 483 RenderPassDrawQuad* output_quad = | 491 RenderPassDrawQuad* output_quad = |
| 484 render_pass->CopyFromAndAppendRenderPassDrawQuad( | 492 render_pass->CopyFromAndAppendRenderPassDrawQuad( |
| 485 RenderPassDrawQuad::MaterialCast(delegated_quad), | 493 RenderPassDrawQuad::MaterialCast(delegated_quad), |
| 486 output_shared_quad_state, | 494 output_shared_quad_state, |
| 487 output_contributing_render_pass_id); | 495 output_contributing_render_pass_id); |
| 488 output_quad->visible_rect = quad_visible_rect; | 496 output_quad->visible_rect = quad_visible_rect; |
| 489 } | 497 } |
| 490 } | 498 } |
| 499 |
| 500 // TODO(danakj): crbug.com/455931 |
| 501 render_pass->quad_list.back()->IterateResources( |
| 502 base::Bind(&ValidateResource, layer_tree_impl()->resource_provider())); |
| 491 } | 503 } |
| 492 } | 504 } |
| 493 | 505 |
| 494 const char* DelegatedRendererLayerImpl::LayerTypeAsString() const { | 506 const char* DelegatedRendererLayerImpl::LayerTypeAsString() const { |
| 495 return "cc::DelegatedRendererLayerImpl"; | 507 return "cc::DelegatedRendererLayerImpl"; |
| 496 } | 508 } |
| 497 | 509 |
| 498 void DelegatedRendererLayerImpl::ClearChildId() { | 510 void DelegatedRendererLayerImpl::ClearChildId() { |
| 499 if (!child_id_) | 511 if (!child_id_) |
| 500 return; | 512 return; |
| 501 | 513 |
| 502 if (own_child_id_) { | 514 if (own_child_id_) { |
| 503 ResourceProvider* provider = layer_tree_impl()->resource_provider(); | 515 ResourceProvider* provider = layer_tree_impl()->resource_provider(); |
| 504 provider->DestroyChild(child_id_); | 516 provider->DestroyChild(child_id_); |
| 505 } | 517 } |
| 506 | 518 |
| 507 resources_.clear(); | 519 resources_.clear(); |
| 508 child_id_ = 0; | 520 child_id_ = 0; |
| 509 } | 521 } |
| 510 | 522 |
| 511 } // namespace cc | 523 } // namespace cc |
| OLD | NEW |